From 909b0271b9f58dda3699ee9d1d97170f7d48c142 Mon Sep 17 00:00:00 2001 From: qqmyers Date: Mon, 12 Aug 2024 12:50:53 -0400 Subject: [PATCH] Upgrade to modified v0.43.0 --- previewers/betatest/js/voyager.js | 6 +- .../lib/voyager-explorer.v0.42.1.gdcc.min.js | 381 ----------------- .../lib/voyager-explorer.v0.43.0.gdcc.min.js | 395 ++++++++++++++++++ 3 files changed, 399 insertions(+), 383 deletions(-) delete mode 100644 previewers/betatest/lib/voyager-explorer.v0.42.1.gdcc.min.js create mode 100644 previewers/betatest/lib/voyager-explorer.v0.43.0.gdcc.min.js diff --git a/previewers/betatest/js/voyager.js b/previewers/betatest/js/voyager.js index 452fc9a..618ae78 100644 --- a/previewers/betatest/js/voyager.js +++ b/previewers/betatest/js/voyager.js @@ -14,8 +14,10 @@ function writeContent(fileUrl, file, title, authors) { const rootUrl = fileUrl.substring(0, lastIndexOfChar + 1); const fileName = fileUrl.substring(lastIndexOfChar + 1); console.log(fileUrl); - $("voyager-explorer").attr("root", rootUrl).attr("model", fileName); + // To use v0.43.0, we have to add the quality attribute + // See https://github.com/Smithsonian/dpo-voyager/issues/297 + $("voyager-explorer").attr("root", rootUrl).attr("model", fileName).attr("quality", "High"); //For Dataverse 6.4+, this can use the standard script: //$.getScript("https://3d-api.si.edu/resources/js/v0.42.1/voyager-explorer.min.js"); - $.getScript("lib/voyager-explorer.v0.42.1.gdcc.min.js"); + $.getScript("lib/voyager-explorer.v0.43.0.gdcc.min.js"); } \ No newline at end of file diff --git a/previewers/betatest/lib/voyager-explorer.v0.42.1.gdcc.min.js b/previewers/betatest/lib/voyager-explorer.v0.42.1.gdcc.min.js deleted file mode 100644 index 97d90a2..0000000 --- a/previewers/betatest/lib/voyager-explorer.v0.42.1.gdcc.min.js +++ /dev/null @@ -1,381 +0,0 @@ -/*! For license information please see voyager-explorer.min.js.LICENSE.txt */ -(()=>{var e={93523:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n\n// #include \n// replaced with\nvarying vec2 vUv;\n\n//#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include \n\n vec2 coords = vUv * 2.0 - 1.0;\n float f = dot(coords, coords);\n\tgl_FragColor = vec4(outgoingLight, mix(diffuseColor.a, 0.0, f));\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n\n"},62001:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include \n\n//#include \n// replaced with\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\n//#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t// replaced with\n\tvUv = ( vec3( uv, 1 ) ).xy;\n\n\t//#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n\n"},8669:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="//#define STANDARD\n\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef IOR\n\tuniform float ior;\n#endif\n\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\n\nvarying vec3 vViewPosition;\n\n\n#include \n#include \n#include \n#include \n\n#include \n\n// Zone map support\n#if defined(USE_ZONEMAP)\n\tvarying vec2 vZoneUv;\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#ifdef USE_ZONEMAP\n\tuniform sampler2D zoneMap;\n#endif\n\n#ifdef USE_AOMAP\n uniform vec3 aoMapMix;\n#endif\n\n#ifdef MODE_XRAY\n varying float vIntensity;\n#endif\n\n#ifdef CUT_PLANE\n\t#if !defined(USE_TRANSMISSION)\n \tvarying vec3 vWorldPosition;\n\t#endif\n uniform vec4 cutPlaneDirection;\n uniform vec3 cutPlaneColor;\n#endif\n\nvoid main() {\n #ifdef CUT_PLANE\n if (dot(vWorldPosition, cutPlaneDirection.xyz) < -cutPlaneDirection.w) {\n discard;\n }\n #endif\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#ifdef CUT_PLANE\n\t // on the cut surface (back facing fragments revealed), replace normal with cut plane direction\n if (!gl_FrontFacing) {\n normal = -cutPlaneDirection.xyz;\n diffuseColor.rgb = cutPlaneColor.rgb;\n }\n\t#endif\n\n #include \n #include \n #include \n\t\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t//#include \n\t// REPLACED WITH\n\t#ifdef USE_AOMAP\n\t // if cut plane is enabled, disable ambient occlusion on back facing fragments\n\t #ifdef CUT_PLANE\n if (gl_FrontFacing) {\n\t #endif\n\n \t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n \tvec3 aoSample = vec3(texture2D(aoMap, vAoMapUv).r,texture2D(aoMap, vAoMapUv).r,texture2D(aoMap, vAoMapUv).r);\n \tvec3 aoFactors = mix(vec3(1.0), aoSample, clamp(aoMapMix * aoMapIntensity, 0.0, 1.0));\n \tfloat ambientOcclusion = aoFactors.x * aoFactors.y * aoFactors.z;\n \tfloat ambientOcclusion2 = ambientOcclusion * ambientOcclusion;\n \treflectedLight.directDiffuse *= ambientOcclusion2;\n \treflectedLight.directSpecular *= ambientOcclusion;\n \t//reflectedLight.indirectDiffuse *= ambientOcclusion;\n\n \t#if defined( USE_CLEARCOAT ) \n\t\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t\t#endif\n\n\t\t#if defined( USE_SHEEN ) \n\t\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t\t#endif\n\n\t\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\n\t\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\n\t\t#endif\n\n \t#ifdef CUT_PLANE\n \t }\n \t#endif\n #endif\n\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\n\t#include \n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\n #ifdef USE_SHEEN\n\n\t\t// Sheen energy compensation approximation calculation can be found at the end of\n\t\t// https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\n\t#endif\n\n\t#ifdef CUT_PLANE\n\tif (!gl_FrontFacing) {\n\t\toutgoingLight = cutPlaneColor.rgb;\n\t}\n\t#endif\n\n\t#include \n\n\t#ifdef USE_ZONEMAP\n\t\tvec4 zoneColor = texture2D(zoneMap, vZoneUv);\n\t\tgl_FragColor += mix(vec4(0.0, 0.0, 0.0, 1.0), vec4(zoneColor.rgb, 1.0), zoneColor.a);\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n #ifdef MODE_NORMALS\n gl_FragColor = vec4(vec3(normal * 0.5 + 0.5), 1.0);\n #endif\n\n #ifdef MODE_XRAY\n gl_FragColor = vec4(vec3(0.4, 0.7, 1.0) * vIntensity, 1.0);\n #endif\n}\n"},9849:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="//#define PHYSICAL\n//#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#if defined(USE_TRANSMISSION) || defined(CUT_PLANE)\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n// Zone map support\n#if defined(USE_ZONEMAP)\t\n\tvarying vec2 vZoneUv;\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#ifdef MODE_XRAY\n varying float vIntensity;\n#endif\n\n//#ifdef CUT_PLANE\n// varying vec3 vWorldPosition;\n//#endif\n\nvoid main() {\n\n\t#include \n\n// Zone map support\n#if defined(USE_ZONEMAP)\n\t#if defined(USE_MAP)\n\t\tvZoneUv = (mapTransform * vec3(vMapUv, 1)).xy;\n\t#else\n\t\tvZoneUv = uv;\n\t#endif\n#endif\n\n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n#ifdef MODE_XRAY\n vIntensity = pow(abs(1.0 - abs(dot(vNormal, vec3(0.0, 0.0, 1.0)))), 3.0);\n#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t// #include \n\t// REPLACED WITH\n\t#if defined(USE_ENVMAP) || defined(DISTANCE) || defined(USE_SHADOWMAP) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 || defined(CUT_PLANE)\n \tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n #endif\n\n\t#include \n\t#include \n\n#ifdef USE_TRANSMISSION\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif\n\n#ifdef CUT_PLANE\n vWorldPosition = worldPosition.xyz / worldPosition.w;\n#endif\n\n#ifdef MODE_NORMALS\n vNormal = normal;\n#endif\n}"},75310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const i=n(72206),s=n(610),r=n(73348),o=n(90360),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends i.default{_addVocabularies(){super._addVocabularies(),s.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var h=n(43750);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var d=n(56110);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}})},6657:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class i extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=i;class s extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof i&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function r(e,...t){const n=[e[0]];let i=0;for(;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const i=n(6657),s=n(32715);var r=n(6657);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var o=n(32715);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),t.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?s.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,e,t)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof i.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=L(this.rhs,e,t),this}get names(){return R(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class h extends c{constructor(e,t,n,i){super(e,n,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class u extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class p extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class m extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=L(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class f extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let i=n.length;for(;i--;){const s=n[i];s.optimizeNames(e,t)||(N(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>P(e,t.names)),{})}}class g extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class v extends f{}class y extends g{}y.kind="else";class b extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(D(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=L(this.condition,e,t),this}get names(){const e=super.names;return R(e,this.condition),this.else&&P(e,this.else.names),e}}b.kind="if";class _ extends g{}_.kind="for";class x extends _{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=L(this.iteration,e,t),this}get names(){return P(super.names,this.iteration.names)}}class w extends _{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){const t=e.es5?s.varKinds.var:this.varKind,{name:n,from:i,to:r}=this;return`for(${t} ${n}=${i}; ${n}<${r}; ${n}++)`+super.render(e)}get names(){const e=R(super.names,this.from);return R(e,this.to)}}class S extends _{constructor(e,t,n,i){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=L(this.iterable,e,t),this}get names(){return P(super.names,this.iterable.names)}}class M extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}M.kind="func";class E extends f{render(e){return"return "+super.render(e)}}E.kind="return";class T extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,i;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(i=this.finally)||void 0===i||i.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&P(e,this.catch.names),this.finally&&P(e,this.finally.names),e}}class C extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}C.kind="catch";class A extends g{render(e){return"finally"+super.render(e)}}A.kind="finally";function P(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function R(e,t){return t instanceof i._CodeOrName?P(e,t.names):e}function L(e,t,n){return e instanceof i.Name?r(e):(s=e)instanceof i._Code&&s._items.some((e=>e instanceof i.Name&&1===t[e.str]&&void 0!==n[e.str]))?new i._Code(e._items.reduce(((e,t)=>(t instanceof i.Name&&(t=r(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;var s;function r(e){const i=n[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}}function N(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function D(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${k(e)}`}t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new s.Scope({parent:e}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,i){const s=this._scope.toName(t);return void 0!==n&&i&&(this._constants[s.str]=n),this._leafNode(new l(e,s,n)),s}const(e,t,n){return this._def(s.varKinds.const,e,t,n)}let(e,t,n){return this._def(s.varKinds.let,e,t,n)}var(e,t,n){return this._def(s.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new c(e,t,n))}add(e,n){return this._leafNode(new h(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==i.nil&&this._leafNode(new m(e)),this}object(...e){const t=["{"];for(const[n,s]of e)t.length>1&&t.push(","),t.push(n),(n!==s||this.opts.es5)&&(t.push(":"),(0,i.addCodeArg)(t,s));return t.push("}"),new i._Code(t)}if(e,t,n){if(this._blockNode(new b(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(b,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new x(e),t)}forRange(e,t,n,i,r=(this.opts.es5?s.varKinds.var:s.varKinds.let)){const o=this._scope.toName(e);return this._for(new w(r,o,t,n),(()=>i(o)))}forOf(e,t,n,r=s.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof i.Name?t:this.var("_arr",t);return this.forRange("_i",0,i._`${e}.length`,(t=>{this.var(o,i._`${e}[${t}]`),n(o)}))}return this._for(new S("of",r,o,t),(()=>n(o)))}forIn(e,t,n,r=(this.opts.es5?s.varKinds.var:s.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,n);const o=this._scope.toName(e);return this._for(new S("in",r,o,t),(()=>n(o)))}endFor(){return this._endBlockNode(_)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new u(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new T;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new C(e),t(e)}return n&&(this._currNode=i.finally=new A,this.code(n)),this._endBlockNode(C,A)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=i.nil,n,s){return this._blockNode(new M(e,t,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(M)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=D;const I=U(t.operators.AND);t.and=function(...e){return e.reduce(I)};const O=U(t.operators.OR);function U(e){return(t,n)=>t===i.nil?n:n===i.nil?t:i._`${k(t)} ${e} ${k(n)}`}function k(e){return e instanceof i.Name?e:i._`(${e})`}t.or=function(...e){return e.reduce(O)}},32715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const i=n(6657);class s extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var r;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(r=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class a extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=i._`.${new i.Name(t)}[${n}]`}}t.ValueScopeName=a;const l=i._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:i.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const i=this.toName(e),{prefix:s}=i,r=null!==(n=t.key)&&void 0!==n?n:t.ref;let o=this._values[s];if(o){const e=o.get(r);if(e)return e}else o=this._values[s]=new Map;o.set(r,i);const a=this._scope[s]||(this._scope[s]=[]),l=a.length;return a[l]=t.ref,i.setValue(t,{property:s,itemIndex:l}),i}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return i._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,o={},a){let l=i.nil;for(const c in e){const h=e[c];if(!h)continue;const d=o[c]=o[c]||new Map;h.forEach((e=>{if(d.has(e))return;d.set(e,r.Started);let o=n(e);if(o){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${n} ${e} = ${o};${this.opts._n}`}else{if(!(o=null==a?void 0:a(e)))throw new s(e);l=i._`${l}${o}${this.opts._n}`}d.set(e,r.Completed)}))}return l}}},16257:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const i=n(56110),s=n(20530),r=n(17748);function o(e,t){const n=e.const("err",t);e.if(i._`${r.default.vErrors} === null`,(()=>e.assign(r.default.vErrors,i._`[${n}]`)),i._`${r.default.vErrors}.push(${n})`),e.code(i._`${r.default.errors}++`)}function a(e,t){const{gen:n,validateName:s,schemaEnv:r}=e;r.$async?n.throw(i._`new ${e.ValidationError}(${t})`):(n.assign(i._`${s}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>i.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?i.str`"${e}" keyword must be ${t} ($data)`:i.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,s,r){const{it:l}=e,{gen:h,compositeRule:d,allErrors:u}=l,p=c(e,n,s);(null!=r?r:d||u)?o(h,p):a(l,i._`[${p}]`)},t.reportExtraError=function(e,n=t.keywordError,i){const{it:s}=e,{gen:l,compositeRule:h,allErrors:d}=s;o(l,c(e,n,i)),h||d||a(s,r.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(r.default.errors,t),e.if(i._`${r.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${r.default.vErrors}.length`,t)),(()=>e.assign(r.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:s,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,r.default.errors,(o=>{e.const(l,i._`${r.default.vErrors}[${o}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(r.default.instancePath,a.errorPath)))),e.assign(i._`${l}.schemaPath`,i.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(i._`${l}.schema`,n),e.assign(i._`${l}.data`,s))}))};const l={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function c(e,t,n){const{createErrors:s}=e.it;return!1===s?i._`{}`:function(e,t,n={}){const{gen:s,it:o}=e,a=[h(o,n),d(e,n)];return function(e,{params:t,message:n},s){const{keyword:o,data:a,schemaValue:c,it:h}=e,{opts:d,propertyName:u,topSchemaRef:p,schemaPath:m}=h;s.push([l.keyword,o],[l.params,"function"==typeof t?t(e):t||i._`{}`]),d.messages&&s.push([l.message,"function"==typeof n?n(e):n]);d.verbose&&s.push([l.schema,c],[l.parentSchema,i._`${p}${m}`],[r.default.data,a]);u&&s.push([l.propertyName,u])}(e,t,a),s.object(...a)}(e,t,n)}function h({errorPath:e},{instancePath:t}){const n=t?i.str`${e}${(0,s.getErrorPath)(t,s.Type.Str)}`:e;return[r.default.instancePath,(0,i.strConcat)(r.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:i.str`${t}/${e}`;return n&&(o=i.str`${o}${(0,s.getErrorPath)(n,s.Type.Str)}`),[l.schemaPath,o]}},59336:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const i=n(56110),s=n(97939),r=n(17748),o=n(66184),a=n(20530),l=n(43750),c=n(55858);class h{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function d(e){const t=p.call(this,e);if(t)return t;const n=(0,o.getFullPath)(e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:h}=this.opts,d=new i.CodeGen(this.scope,{es5:a,lines:c,ownProperties:h});let u;e.$async&&(u=d.scopeValue("Error",{ref:s.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const m=d.scopeName("validate");e.validateName=m;const f={gen:d,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,i.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(f),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(r.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:m,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=f;n.evaluated={props:e instanceof i.Name?void 0:e,items:t instanceof i.Name?void 0:t,dynamicProps:e instanceof i.Name,dynamicItems:t instanceof i.Name},n.source&&(n.source.evaluated=(0,i.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function u(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:d.call(this,e)}function p(e){for(const i of this._compilations)if(n=e,(t=i).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return i;var t,n}function m(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||f.call(this,e,t)}function f(e,t){const n=c.parse(t),i=(0,o._getFullPath)(n);let s=(0,o.getFullPath)(e.baseId);if(Object.keys(e.schema).length>0&&i===s)return v.call(this,n,e);const r=(0,o.normalizeId)(i),a=this.refs[r]||this.schemas[r];if("string"==typeof a){const t=f.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return v.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||d.call(this,a),r===(0,o.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,i=t[n];return i&&(s=(0,o.resolveUrl)(s,i)),new h({schema:t,schemaId:n,root:e,baseId:s})}return v.call(this,n,a)}}t.SchemaEnv=h,t.compileSchema=d,t.resolveRef=function(e,t,n){var i;n=(0,o.resolveUrl)(t,n);const s=e.refs[n];if(s)return s;let r=m.call(this,e,n);if(void 0===r){const s=null===(i=e.localRefs)||void 0===i?void 0:i[n],{schemaId:o}=this.opts;s&&(r=new h({schema:s,schemaId:o,root:e,baseId:t}))}return void 0!==r?e.refs[n]=u.call(this,r):void 0},t.getCompilingSchema=p,t.resolveSchema=f;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function v(e,{baseId:t,schema:n,root:i}){var s;if("/"!==(null===(s=e.fragment)||void 0===s?void 0:s[0]))return;for(const i of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(i)];if(void 0===e)return;const s="object"==typeof(n=e)&&n[this.opts.schemaId];!g.has(i)&&s&&(t=(0,o.resolveUrl)(t,s))}let r;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,o.resolveUrl)(t,n.$ref);r=f.call(this,i,e)}const{schemaId:l}=this.opts;return r=r||new h({schema:n,schemaId:l,root:i,baseId:t}),r.schema!==r.root.schema?r:void 0}},17748:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};t.default=s},33482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(66184);class s extends Error{constructor(e,t,n){super(n||`can't resolve reference ${t} from id ${e}`),this.missingRef=(0,i.resolveUrl)(e,t),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(this.missingRef))}}t.default=s},66184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const i=n(20530),s=n(28926),r=n(68125),o=n(55858),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&h(e)<=t)};const l=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(l.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(c))return!0;if("object"==typeof n&&c(n))return!0}return!1}function h(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!a.has(n)&&("object"==typeof e[n]&&(0,i.eachItem)(e[n],(e=>t+=h(e))),t===1/0))return 1/0}return t}function d(e="",t){!1!==t&&(e=m(e));return u(o.parse(e))}function u(e){return o.serialize(e).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=u;const p=/#\/?$/;function m(e){return e?e.replace(p,""):""}t.normalizeId=m,t.resolveUrl=function(e,t){return t=m(t),o.resolve(e,t)};const f=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n}=this.opts,i=m(e[n]||t),a={"":i},l=d(i,!1),c={},h=new Set;return r(e,{allKeys:!0},((e,t,i,s)=>{if(void 0===s)return;const r=l+t;let d=a[s];function g(t){if(t=m(d?o.resolve(d,t):t),h.has(t))throw p(t);h.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==m(r)&&("#"===t[0]?(u(e,c[t],t),c[t]=e):this.refs[t]=r),t}function v(e){if("string"==typeof e){if(!f.test(e))throw new Error(`invalid anchor "${e}"`);g.call(this,`#${e}`)}}"string"==typeof e[n]&&(d=g.call(this,e[n])),v.call(this,e.$anchor),v.call(this,e.$dynamicAnchor),a[t]=d})),c;function u(e,t,n){if(void 0!==t&&!s(e,t))throw p(n)}function p(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},46754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},20530:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const i=n(56110),s=n(6657);function r(e,t=e.schema){const{opts:n,self:i}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const s=i.RULES.keywords;for(const n in t)s[n]||m(e,`unknown keyword: "${n}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:s}){return(r,o,a,l)=>{const c=void 0===a?o:a instanceof i.Name?(o instanceof i.Name?e(r,o,a):t(r,o,a),a):o instanceof i.Name?(t(r,a,o),o):n(o,a);return l!==i.Name||c instanceof i.Name?c:s(r,c)}}function h(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",i._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(i._`${t}${(0,i.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!o(t,e.self.RULES.all))},t.checkUnknownRules=r,t.schemaHasRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,s,r){if(!r){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return i._`${n}`}return i._`${e}${t}${(0,i.getProperty)(s)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>{e.if(i._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,i._`${n} || {}`).code(i._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,i._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:h}),items:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,i._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>e.assign(n,!0===t||i._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=h,t.setEvaluated=d;const u={};var p;function m(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:u[t.code]||(u[t.code]=new s._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(p=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof i.Name){const s=t===p.Num;return n?s?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:s?i._`"/" + ${e}`:i._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,i.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=m},87177:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>i(e,t)))}function i(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},i){const s=t.RULES.types[i];return s&&!0!==s&&n(e,s)},t.shouldUseGroup=n,t.shouldUseRule=i},42971:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const i=n(16257),s=n(56110),r=n(17748),o={message:"boolean schema is false"};function a(e,t){const{gen:n,data:s}=e,r={gen:n,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,i.reportError)(r,o,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:i}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(r.default.data):(t.assign(s._`${i}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:i}=e;!1===i?(n.var(t,!1),a(e)):n.var(t,!0)}},97349:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const i=n(46754),s=n(87177),r=n(16257),o=n(56110),a=n(20530);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:i,opts:r}=e,a=function(e,t){return t?e.filter((e=>h.has(e)||"array"===t&&"array"===e)):[]}(t,r.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,s.schemaHasRulesForType)(e,t[0]));if(c){const s=u(t,i,r.strictNumbers,l.Wrong);n.if(s,(()=>{a.length?function(e,t,n){const{gen:i,data:s,opts:r}=e,a=i.let("dataType",o._`typeof ${s}`),l=i.let("coerced",o._`undefined`);"array"===r.coerceTypes&&i.if(o._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,(()=>i.assign(s,o._`${s}[0]`).assign(a,o._`typeof ${s}`).if(u(t,s,r.strictNumbers),(()=>i.assign(l,s)))));i.if(o._`${l} !== undefined`);for(const e of n)(h.has(e)||"array"===e&&"array"===r.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void i.elseIf(o._`${a} == "number" || ${a} == "boolean"`).assign(l,o._`"" + ${s}`).elseIf(o._`${s} === null`).assign(l,o._`""`);case"number":return void i.elseIf(o._`${a} == "boolean" || ${s} === null - || (${a} == "string" && ${s} && ${s} == +${s})`).assign(l,o._`+${s}`);case"integer":return void i.elseIf(o._`${a} === "boolean" || ${s} === null - || (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(l,o._`+${s}`);case"boolean":return void i.elseIf(o._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(l,!1).elseIf(o._`${s} === "true" || ${s} === 1`).assign(l,!0);case"null":return i.elseIf(o._`${s} === "" || ${s} === 0 || ${s} === false`),void i.assign(l,null);case"array":i.elseIf(o._`${a} === "string" || ${a} === "number" - || ${a} === "boolean" || ${s} === null`).assign(l,o._`[${s}]`)}}i.else(),m(e),i.endIf(),i.if(o._`${l} !== undefined`,(()=>{i.assign(s,l),function({gen:e,parentData:t,parentDataProperty:n},i){e.if(o._`${t} !== undefined`,(()=>e.assign(o._`${t}[${n}]`,i)))}(e,l)}))}(e,t,a):m(e)}))}return c};const h=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,i=l.Correct){const s=i===l.Correct?o.operators.EQ:o.operators.NEQ;let r;switch(e){case"null":return o._`${t} ${s} null`;case"array":r=o._`Array.isArray(${t})`;break;case"object":r=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":r=a(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":r=a();break;default:return o._`typeof ${t} ${s} ${e}`}return i===l.Correct?r:(0,o.not)(r);function a(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,n?o._`isFinite(${t})`:o.nil)}}function u(e,t,n,i){if(1===e.length)return d(e[0],t,n,i);let s;const r=(0,a.toHash)(e);if(r.array&&r.object){const e=o._`typeof ${t} != "object"`;s=r.null?e:o._`!${t} || ${e}`,delete r.null,delete r.array,delete r.object}else s=o.nil;r.number&&delete r.integer;for(const e in r)s=(0,o.and)(s,d(e,t,n,i));return s}t.checkDataType=d,t.checkDataTypes=u;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function m(e){const t=function(e){const{gen:t,data:n,schema:i}=e,s=(0,a.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:n,schema:i.type,schemaCode:s,schemaValue:s,parentSchema:i,params:{},it:e}}(e);(0,r.reportError)(t,p)}t.reportTypeError=m},15944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const i=n(56110),s=n(20530);function r(e,t,n){const{gen:r,compositeRule:o,data:a,opts:l}=e;if(void 0===n)return;const c=i._`${a}${(0,i.getProperty)(t)}`;if(o)return void(0,s.checkStrictMode)(e,`default is ignored for: ${c}`);let h=i._`${c} === undefined`;"empty"===l.useDefaults&&(h=i._`${h} || ${c} === null || ${c} === ""`),r.if(h,i._`${c} = ${(0,i.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:i}=e.schema;if("object"===t&&n)for(const t in n)r(e,t,n[t].default);else"array"===t&&Array.isArray(i)&&i.forEach(((t,n)=>r(e,n,t.default)))}},43750:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const i=n(42971),s=n(97349),r=n(87177),o=n(97349),a=n(15944),l=n(42e3),c=n(35678),h=n(56110),d=n(17748),u=n(66184),p=n(20530),m=n(16257);function f({gen:e,validateName:t,schema:n,schemaEnv:i,opts:s},r){s.code.es5?e.func(t,h._`${d.default.data}, ${d.default.valCxt}`,i.$async,(()=>{e.code(h._`"use strict"; ${g(n,s)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,h._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,h._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,h._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,h._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,h._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,h._`""`),e.var(d.default.parentData,h._`undefined`),e.var(d.default.parentDataProperty,h._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,h._`{}`)}))}(e,s),e.code(r)})):e.func(t,h._`${d.default.data}, ${function(e){return h._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?h._`, ${d.default.dynamicAnchors}={}`:h.nil}}={}`}(s)}`,i.$async,(()=>e.code(g(n,s)).code(r)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?h._`/*# sourceURL=${n} */`:h.nil}function v(e,t){b(e)&&(_(e),y(e))?function(e,t){const{schema:n,gen:i,opts:s}=e;s.$comment&&n.$comment&&w(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const r=i.const("_errs",d.default.errors);x(e,r),i.var(t,h._`${r} === ${d.default.errors}`)}(e,t):(0,i.boolOrEmptySchema)(e,t)}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function b(e){return"boolean"!=typeof e.schema}function _(e){(0,p.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:i,self:s}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function x(e,t){if(e.opts.jtd)return S(e,[],!1,t);const n=(0,s.getSchemaTypes)(e.schema);S(e,n,!(0,s.coerceAndCheckDataType)(e,n),t)}function w({gen:e,schemaEnv:t,schema:n,errSchemaPath:i,opts:s}){const r=n.$comment;if(!0===s.$comment)e.code(h._`${d.default.self}.logger.log(${r})`);else if("function"==typeof s.$comment){const n=h.str`${i}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code(h._`${d.default.self}.opts.$comment(${r}, ${n}, ${s}.schema)`)}}function S(e,t,n,i){const{gen:s,schema:a,data:l,allErrors:c,opts:u,self:m}=e,{RULES:f}=m;function g(p){(0,r.shouldUseGroup)(a,p)&&(p.type?(s.if((0,o.checkDataType)(p.type,l,u.strictNumbers)),M(e,p),1===t.length&&t[0]===p.type&&n&&(s.else(),(0,o.reportTypeError)(e)),s.endIf()):M(e,p),c||s.if(h._`${d.default.errors} === ${i||0}`))}!a.$ref||!u.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(a,f)?(u.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{T(e.dataTypes,t)||C(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>T(t,e)))})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&C(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const n=e.self.RULES.all;for(const i in n){const s=n[i];if("object"==typeof s&&(0,r.shouldUseRule)(e.schema,s)){const{type:n}=s.definition;n.length&&!n.some((e=>E(t,e)))&&C(e,`missing type "${n.join(",")}" for keyword "${i}"`)}}}(e,e.dataTypes)}(e,t),s.block((()=>{for(const e of f.rules)g(e);g(f.post)}))):s.block((()=>P(e,"$ref",f.all.$ref.definition)))}function M(e,t){const{gen:n,schema:i,opts:{useDefaults:s}}=e;s&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,r.shouldUseRule)(i,n)&&P(e,n.keyword,n.definition,t.type)}))}function E(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function T(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function C(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){b(e)&&(_(e),y(e))?function(e){const{schema:t,opts:n,gen:i}=e;f(e,(()=>{n.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),i.let(d.default.vErrors,null),i.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",h._`${n}.evaluated`),t.if(h._`${e.evaluated}.dynamicProps`,(()=>t.assign(h._`${e.evaluated}.props`,h._`undefined`))),t.if(h._`${e.evaluated}.dynamicItems`,(()=>t.assign(h._`${e.evaluated}.items`,h._`undefined`)))}(e),x(e),function(e){const{gen:t,schemaEnv:n,validateName:i,ValidationError:s,opts:r}=e;n.$async?t.if(h._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(h._`new ${s}(${d.default.vErrors})`))):(t.assign(h._`${i}.errors`,d.default.vErrors),r.unevaluated&&function({gen:e,evaluated:t,props:n,items:i}){n instanceof h.Name&&e.assign(h._`${t}.props`,n);i instanceof h.Name&&e.assign(h._`${t}.items`,i)}(e),t.return(h._`${d.default.errors} === 0`))}(e)}))}(e):f(e,(()=>(0,i.topBoolOrEmptySchema)(e)))};class A{constructor(e,t,n){if((0,l.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",N(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,n){this.failResult((0,h.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,h.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(h._`${t} !== undefined && (${(0,h.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?m.reportExtraError:m.reportError)(this,this.def.error,t)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=h.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=h.nil,t=h.nil){if(!this.$data)return;const{gen:n,schemaCode:i,schemaType:s,def:r}=this;n.if((0,h.or)(h._`${i} === undefined`,t)),e!==h.nil&&n.assign(e,!0),(s.length||r.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==h.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:i,it:s}=this;return(0,h.or)(function(){if(n.length){if(!(t instanceof h.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return h._`${(0,o.checkDataTypes)(e,t,s.opts.strictNumbers,o.DataType.Wrong)}`}return h.nil}(),function(){if(i.validateSchema){const n=e.scopeValue("validate$data",{ref:i.validateSchema});return h._`!${n}(${t})`}return h.nil}())}subschema(e,t){const n=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(n,this.it,e),(0,c.extendSubschemaMode)(n,e);const i={...this.it,...n,items:void 0,props:void 0};return v(i,t),i}mergeEvaluated(e,t){const{it:n,gen:i}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=p.mergeEvaluated.props(i,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=p.mergeEvaluated.items(i,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:i}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return i.if(t,(()=>this.mergeEvaluated(e,h.Name))),!0}}function P(e,t,n,i){const s=new A(e,n,t);"code"in n?n.code(s,i):s.$data&&n.validate?(0,l.funcKeywordCode)(s,n):"macro"in n?(0,l.macroKeywordCode)(s,n):(n.compile||n.validate)&&(0,l.funcKeywordCode)(s,n)}t.KeywordCxt=A;const R=/^\/(?:[^~]|~0|~1)*$/,L=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N(e,{dataLevel:t,dataNames:n,dataPathArr:i}){let s,r;if(""===e)return d.default.rootData;if("/"===e[0]){if(!R.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,r=d.default.rootData}else{const o=L.exec(e);if(!o)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+o[1];if(s=o[2],"#"===s){if(a>=t)throw new Error(l("property/index",a));return i[t-a]}if(a>t)throw new Error(l("data",a));if(r=n[t-a],!s)return r}let o=r;const a=s.split("/");for(const e of a)e&&(r=h._`${r}${(0,h.getProperty)((0,p.unescapeJsonPointer)(e))}`,o=h._`${o} && ${r}`);return o;function l(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=N},42e3:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const i=n(56110),s=n(17748),r=n(57111),o=n(16257);function a(e){const{gen:t,data:n,it:s}=e;t.if(s.parentData,(()=>t.assign(n,i._`${s.parentData}[${s.parentDataProperty}]`)))}function l(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,i.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:s,schema:r,parentSchema:o,it:a}=e,c=t.macro.call(a.self,r,o,a),h=l(n,s,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const d=n.name("valid");e.subschema({schema:c,schemaPath:i.nil,errSchemaPath:`${a.errSchemaPath}/${s}`,topSchemaRef:h,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:c,keyword:h,schema:d,parentSchema:u,$data:p,it:m}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(m,t);const f=!p&&t.compile?t.compile.call(m.self,d,u,m):t.validate,g=l(c,h,f),v=c.let("valid");function y(n=(t.async?i._`await `:i.nil)){const o=m.opts.passContext?s.default.this:s.default.self,a=!("compile"in t&&!p||!1===t.schema);c.assign(v,i._`${n}${(0,r.callValidateCode)(e,g,o,a)}`,t.modifying)}function b(e){var n;c.if((0,i.not)(null!==(n=t.valid)&&void 0!==n?n:v),e)}e.block$data(v,(function(){if(!1===t.errors)y(),t.modifying&&a(e),b((()=>e.error()));else{const n=t.async?function(){const e=c.let("ruleErrs",null);return c.try((()=>y(i._`await `)),(t=>c.assign(v,!1).if(i._`${t} instanceof ${m.ValidationError}`,(()=>c.assign(e,i._`${t}.errors`)),(()=>c.throw(t))))),e}():function(){const e=i._`${g}.errors`;return c.assign(e,null),y(i.nil),e}();t.modifying&&a(e),b((()=>function(e,t){const{gen:n}=e;n.if(i._`Array.isArray(${t})`,(()=>{n.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,i._`${s.default.vErrors}.length`),(0,o.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:v)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:i},s,r){if(Array.isArray(s.keyword)?!s.keyword.includes(r):s.keyword!==r)throw new Error("ajv implementation error");const o=s.dependencies;if(null==o?void 0:o.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${r}: ${o.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[r])){const e=`keyword "${r}" value is invalid at path "${i}": `+n.errorsText(s.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}}},35678:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const i=n(56110),s=n(20530);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:r,schemaPath:o,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==r)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const r=e.schema[t];return void 0===n?{schema:r,schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:r[n],schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}${(0,i.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,s.escapeFragment)(n)}`}}if(void 0!==r){if(void 0===o||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:r,data:o,dataTypes:a,propertyName:l}){if(void 0!==o&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==n){const{errorPath:o,dataPathArr:a,opts:l}=t;h(c.let("data",i._`${t.data}${(0,i.getProperty)(n)}`,!0)),e.errorPath=i.str`${o}${(0,s.getErrorPath)(n,r,l.jsPropertySyntax)}`,e.parentDataProperty=i._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}if(void 0!==o){h(o instanceof i.Name?o:c.let("data",o,!0)),void 0!==l&&(e.propertyName=l)}function h(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:i,createErrors:s,allErrors:r}){void 0!==i&&(e.compositeRule=i),void 0!==s&&(e.createErrors=s),void 0!==r&&(e.allErrors=r),e.jtdDiscriminator=t,e.jtdMetadata=n}},72206:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var i=n(43750);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return i.KeywordCxt}});var s=n(56110);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});const r=n(97939),o=n(33482),a=n(46754),l=n(59336),c=n(56110),h=n(66184),d=n(97349),u=n(20530),p=n(338),m=["removeAdditional","useDefaults","coerceTypes"],f=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function y(e){var t,n,i,s,r,o,a,l,c,h,d,u,p,m,f,g,v,y,b,_,x,w;const S=e.strict,M=null===(t=e.code)||void 0===t?void 0:t.optimize,E=!0===M||void 0===M?1:M||0;return{strictSchema:null===(i=null!==(n=e.strictSchema)&&void 0!==n?n:S)||void 0===i||i,strictNumbers:null===(r=null!==(s=e.strictNumbers)&&void 0!==s?s:S)||void 0===r||r,strictTypes:null!==(a=null!==(o=e.strictTypes)&&void 0!==o?o:S)&&void 0!==a?a:"log",strictTuples:null!==(c=null!==(l=e.strictTuples)&&void 0!==l?l:S)&&void 0!==c?c:"log",strictRequired:null!==(d=null!==(h=e.strictRequired)&&void 0!==h?h:S)&&void 0!==d&&d,code:e.code?{...e.code,optimize:E}:{optimize:E},loopRequired:null!==(u=e.loopRequired)&&void 0!==u?u:200,loopEnum:null!==(p=e.loopEnum)&&void 0!==p?p:200,meta:null===(m=e.meta)||void 0===m||m,messages:null===(f=e.messages)||void 0===f||f,inlineRefs:null===(g=e.inlineRefs)||void 0===g||g,schemaId:null!==(v=e.schemaId)&&void 0!==v?v:"$id",addUsedSchema:null===(y=e.addUsedSchema)||void 0===y||y,validateSchema:null===(b=e.validateSchema)||void 0===b||b,validateFormats:null===(_=e.validateFormats)||void 0===_||_,unicodeRegExp:null===(x=e.unicodeRegExp)||void 0===x||x,int32range:null===(w=e.int32range)||void 0===w||w}}class b{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...y(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:f,es5:t,lines:n}),this.logger=function(e){if(!1===e)return T;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),_.call(this,g,e,"NOT SUPPORTED"),_.call(this,v,e,"DEPRECATED","warn"),this._metaOpts=E.call(this),e.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&M.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),w.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let i=p;"id"===n&&(i={...p},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const i=n(t);return"$async"in n||(this.errors=n.errors),i}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return i.call(this,e,t);async function i(e,t){await s.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||r.call(this,n)}async function s(e){e&&!this.getSchema(e)&&await i.call(this,{$ref:e},!0)}async function r(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),r.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const n=await c.call(this,e);this.refs[e]||await s.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function c(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,i);return this}let s;if("object"==typeof e){const{schemaId:t}=this.opts;if(s=e[t],void 0!==s&&"string"!=typeof s)throw new Error(`schema ${t} must be string`)}return t=(0,h.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,i,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const i=this.validate(n,e);if(!i&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return i}getSchema(e){let t;for(;"string"==typeof(t=x.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,i=new l.SchemaEnv({schema:{},schemaId:n});if(t=l.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=x.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,h.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(A.call(this,n,t),!t)return(0,u.eachItem)(n,(e=>P.call(this,e))),this;L.call(this,t);const i={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(n,0===i.type.length?e=>P.call(this,e,i):e=>i.type.forEach((t=>P.call(this,e,i,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const i of t){const t=i.split("/").slice(1);let s=e;for(const e of t)s=s[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:i}=t.definition,r=s[e];i&&r&&(s[e]=D(r))}}return e}_removeAllSchemas(e,t){for(const n in e){const i=e[n];t&&!t.test(n)||("string"==typeof i?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,t,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let r;const{schemaId:o}=this.opts;if("object"==typeof e)r=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,h.normalizeId)(r||n);const c=h.getSchemaRefs.call(this,e,n);return a=new l.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:c}),this._cache.set(a.schema,a),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),i&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function _(e,t,n,i="error"){for(const s in e){const r=s;r in t&&this.logger[i](`${n}: option ${s}. ${e[r]}`)}}function x(e){return e=(0,h.normalizeId)(e),this.schemas[e]||this.refs[e]}function w(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function S(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function M(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function E(){const e={...this.opts};for(const t of m)delete e[t];return e}t.default=b,b.ValidationError=r.default,b.MissingRefError=o.default;const T={log(){},warn(){},error(){}};const C=/^[a-z_$][a-z0-9_$:-]*$/i;function A(e,t){const{RULES:n}=this;if((0,u.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!C.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function P(e,t,n){var i;const s=null==t?void 0:t.post;if(n&&s)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:r}=this;let o=s?r.post:r.rules.find((({type:e})=>e===n));if(o||(o={type:n,rules:[]},r.rules.push(o)),r.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?R.call(this,o,a,t.before):o.rules.push(a),r.all[e]=a,null===(i=t.implements)||void 0===i||i.forEach((e=>this.addKeyword(e)))}function R(e,t,n){const i=e.rules.findIndex((e=>e.keyword===n));i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function L(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=D(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function D(e){return{anyOf:[e,N]}}},18062:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(28926);i.code='require("ajv/dist/runtime/equal").default',t.default=i},75842:(e,t)=>{"use strict";function n(e){const t=e.length;let n,i=0,s=0;for(;s=55296&&n<=56319&&s{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},81600:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const i=n(56110),s=n(20530),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:i}=t;Array.isArray(i)?o(e,i):(0,s.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function o(e,t){const{gen:n,schema:r,data:o,keyword:a,it:l}=e;l.items=!0;const c=n.const("len",i._`${o}.length`);if(!1===r)e.setParams({len:t.length}),e.pass(i._`${c} <= ${t.length}`);else if("object"==typeof r&&!(0,s.alwaysValidSchema)(l,r)){const r=n.var("valid",i._`${c} <= ${t.length}`);n.if((0,i.not)(r),(()=>function(r){n.forRange("i",t.length,c,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:s.Type.Num},r),l.allErrors||n.if((0,i.not)(r),(()=>n.break()))}))}(r))),e.ok(r)}}t.validateAdditionalItems=o,t.default=r},88183:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r=n(17748),o=n(20530),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>s._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:l,errsCount:c,it:h}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:d,opts:u}=h;if(h.props=!0,"all"!==u.removeAdditional&&(0,o.alwaysValidSchema)(h,n))return;const p=(0,i.allSchemaProperties)(a.properties),m=(0,i.allSchemaProperties)(a.patternProperties);function f(e){t.code(s._`delete ${l}[${e}]`)}function g(i){if("all"===u.removeAdditional||u.removeAdditional&&!1===n)f(i);else{if(!1===n)return e.setParams({additionalProperty:i}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,o.alwaysValidSchema)(h,n)){const n=t.name("valid");"failing"===u.removeAdditional?(v(i,n,!1),t.if((0,s.not)(n),(()=>{e.reset(),f(i)}))):(v(i,n),d||t.if((0,s.not)(n),(()=>t.break())))}}}function v(t,n,i){const s={keyword:"additionalProperties",dataProp:t,dataPropType:o.Type.Str};!1===i&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(s,n)}t.forIn("key",l,(n=>{p.length||m.length?t.if(function(n){let r;if(p.length>8){const e=(0,o.schemaRefOrVal)(h,a.properties,"properties");r=(0,i.isOwnProperty)(t,e,n)}else r=p.length?(0,s.or)(...p.map((e=>s._`${n} === ${e}`))):s.nil;return m.length&&(r=(0,s.or)(r,...m.map((t=>s._`${(0,i.usePattern)(e,t)}.test(${n})`)))),(0,s.not)(r)}(n),(()=>g(n))):g(n)})),e.ok(s._`${c} === ${r.default.errors}`)}};t.default=a},68302:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20530),s={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const r=t.name("valid");n.forEach(((t,n)=>{if((0,i.alwaysValidSchema)(s,t))return;const o=e.subschema({keyword:"allOf",schemaProp:n},r);e.ok(r),e.mergeEvaluated(o)}))}};t.default=s},50120:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(57111).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=i},97458:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?i.str`must contain at least ${e} valid item(s)`:i.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?i._`{minContains: ${e}}`:i._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:a}=e;let l,c;const{minContains:h,maxContains:d}=r;a.opts.next?(l=void 0===h?1:h,c=d):l=1;const u=t.const("len",i._`${o}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,s.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,s.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,s.alwaysValidSchema)(a,n)){let t=i._`${u} >= ${l}`;return void 0!==c&&(t=i._`${t} && ${u} <= ${c}`),void e.pass(t)}a.items=!0;const p=t.name("valid");function m(){const e=t.name("_valid"),n=t.let("count",0);f(e,(()=>t.if(e,(()=>function(e){t.code(i._`${e}++`),void 0===c?t.if(i._`${e} >= ${l}`,(()=>t.assign(p,!0).break())):(t.if(i._`${e} > ${c}`,(()=>t.assign(p,!1).break())),1===l?t.assign(p,!0):t.if(i._`${e} >= ${l}`,(()=>t.assign(p,!0))))}(n)))))}function f(n,i){t.forRange("i",0,u,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:s.Type.Num,compositeRule:!0},n),i()}))}void 0===c&&1===l?f(p,(()=>t.if(p,(()=>t.break())))):(t.let(p,!1),0===l?t.if(i._`${o}.length > 0`,m,(()=>t.assign(p,!0))):m()),e.result(p,(()=>e.reset()))}};t.default=r},32790:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const i=n(56110),s=n(20530),r=n(57111);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const s=1===t?"property":"properties";return i.str`must have ${s} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:s}})=>i._`{property: ${e}, - missingProperty: ${s}, - depsCount: ${t}, - deps: ${n}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const i in e){if("__proto__"===i)continue;(Array.isArray(e[i])?t:n)[i]=e[i]}return[t,n]}(e);a(e,t),l(e,n)}};function a(e,t=e.schema){const{gen:n,data:s,it:o}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const h=(0,r.propertyInData)(n,s,l,o.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),o.allErrors?n.if(h,(()=>{for(const t of c)(0,r.checkReportMissingProp)(e,t)})):(n.if(i._`${h} && (${(0,r.checkMissingProp)(e,c,a)})`),(0,r.reportMissingProp)(e,a),n.else())}}function l(e,t=e.schema){const{gen:n,data:i,keyword:o,it:a}=e,l=n.name("valid");for(const c in t)(0,s.alwaysValidSchema)(a,t[c])||(n.if((0,r.propertyInData)(n,i,c,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:o,schemaProp:c},l);e.mergeValidEvaluated(t,l)}),(()=>n.var(l,!0))),e.ok(l))}t.validatePropertyDeps=a,t.validateSchemaDeps=l,t.default=o},17498:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>i.str`must match "${e.ifClause}" schema`,params:({params:e})=>i._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:r}=e;void 0===n.then&&void 0===n.else&&(0,s.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const a=o(r,"then"),l=o(r,"else");if(!a&&!l)return;const c=t.let("valid",!0),h=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);e.mergeEvaluated(t)}(),e.reset(),a&&l){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(h,d("then",n),d("else",n))}else a?t.if(h,d("then")):t.if((0,i.not)(h),d("else"));function d(n,s){return()=>{const r=e.subschema({keyword:n},h);t.assign(c,h),e.mergeValidEvaluated(r,c),s?t.assign(s,i._`${n}`):e.setParams({ifClause:n})}}e.pass(c,(()=>e.error(!0)))}};function o(e,t){const n=e.schema[t];return void 0!==n&&!(0,s.alwaysValidSchema)(e,n)}t.default=r},3698:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(81600),s=n(53609),r=n(38223),o=n(62490),a=n(97458),l=n(32790),c=n(13796),h=n(88183),d=n(11935),u=n(98289),p=n(62514),m=n(50120),f=n(16328),g=n(68302),v=n(17498),y=n(96105);t.default=function(e=!1){const t=[p.default,m.default,f.default,g.default,v.default,y.default,c.default,h.default,l.default,d.default,u.default];return e?t.push(s.default,o.default):t.push(i.default,r.default),t.push(a.default),t}},38223:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const i=n(56110),s=n(20530),r=n(57111),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,s.alwaysValidSchema)(n,t)||e.ok((0,r.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:r,parentSchema:o,data:a,keyword:l,it:c}=e;!function(e){const{opts:i,errSchemaPath:r}=c,o=n.length,a=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(i.strictTuples&&!a){const e=`"${l}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${r}"`;(0,s.checkStrictMode)(c,e,i.strictTuples)}}(o),c.opts.unevaluated&&n.length&&!0!==c.items&&(c.items=s.mergeEvaluated.items(r,n.length,c.items));const h=r.name("valid"),d=r.const("len",i._`${a}.length`);n.forEach(((t,n)=>{(0,s.alwaysValidSchema)(c,t)||(r.if(i._`${d} > ${n}`,(()=>e.subschema({keyword:l,schemaProp:n,dataProp:n},h))),e.ok(h))}))}t.validateTuple=a,t.default=o},62490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(57111),o=n(81600),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:i}=e,{prefixItems:a}=n;i.items=!0,(0,s.alwaysValidSchema)(i,t)||(a?(0,o.validateAdditionalItems)(e,a):e.ok((0,r.validateArray)(e)))}};t.default=a},62514:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20530),s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:s}=e;if((0,i.alwaysValidSchema)(s,n))return void e.fail();const r=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),e.failResult(r,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=s},16328:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>i._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;const a=n,l=t.let("valid",!1),c=t.let("passing",null),h=t.name("_valid");e.setParams({passing:c}),t.block((function(){a.forEach(((n,r)=>{let a;(0,s.alwaysValidSchema)(o,n)?t.var(h,!0):a=e.subschema({keyword:"oneOf",schemaProp:r,compositeRule:!0},h),r>0&&t.if(i._`${h} && ${l}`).assign(l,!1).assign(c,i._`[${c}, ${r}]`).else(),t.if(h,(()=>{t.assign(l,!0),t.assign(c,r),a&&e.mergeEvaluated(a,i.Name)}))}))})),e.result(l,(()=>e.reset()),(()=>e.error(!0)))}};t.default=r},98289:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r=n(20530),o=n(20530),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:l,it:c}=e,{opts:h}=c,d=(0,i.allSchemaProperties)(n),u=d.filter((e=>(0,r.alwaysValidSchema)(c,n[e])));if(0===d.length||u.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;const p=h.strictSchema&&!h.allowMatchingProperties&&l.properties,m=t.name("valid");!0===c.props||c.props instanceof s.Name||(c.props=(0,o.evaluatedPropsToName)(t,c.props));const{props:f}=c;function g(e){for(const t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(n){t.forIn("key",a,(r=>{t.if(s._`${(0,i.usePattern)(e,n)}.test(${r})`,(()=>{const i=u.includes(n);i||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:r,dataPropType:o.Type.Str},m),c.opts.unevaluated&&!0!==f?t.assign(s._`${f}[${r}]`,!0):i||c.allErrors||t.if((0,s.not)(m),(()=>t.break()))}))}))}!function(){for(const e of d)p&&g(e),c.allErrors?v(e):(t.var(m,!0),v(e),t.if(m))}()}};t.default=a},53609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(38223),s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,i.validateTuple)(e,"items")};t.default=s},11935:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(43750),s=n(57111),r=n(20530),o=n(88183),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===a.additionalProperties&&o.default.code(new i.KeywordCxt(c,o.default,"additionalProperties"));const h=(0,s.allSchemaProperties)(n);for(const e of h)c.definedProperties.add(e);c.opts.unevaluated&&h.length&&!0!==c.props&&(c.props=r.mergeEvaluated.props(t,(0,r.toHash)(h),c.props));const d=h.filter((e=>!(0,r.alwaysValidSchema)(c,n[e])));if(0===d.length)return;const u=t.name("valid");for(const n of d)p(n)?m(n):(t.if((0,s.propertyInData)(t,l,n,c.opts.ownProperties)),m(n),c.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(u);function p(e){return c.opts.useDefaults&&!c.compositeRule&&void 0!==n[e].default}function m(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},u)}}};t.default=a},13796:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>i._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:r,it:o}=e;if((0,s.alwaysValidSchema)(o,n))return;const a=t.name("valid");t.forIn("key",r,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,i.not)(a),(()=>{e.error(!0),o.allErrors||t.break()}))})),e.ok(a)}};t.default=r},96105:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20530),s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,i.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=s},57111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const i=n(56110),s=n(20530),r=n(17748);function o(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:i._`Object.prototype.hasOwnProperty`})}function a(e,t,n){return i._`${o(e)}.call(${t}, ${n})`}function l(e,t,n,s){const r=i._`${t}${(0,i.getProperty)(n)} === undefined`;return s?(0,i.or)(r,(0,i.not)(a(e,t,n))):r}function c(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:s,it:r}=e;n.if(l(n,s,t,r.opts.ownProperties),(()=>{e.setParams({missingProperty:i._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},s,r){return(0,i.or)(...s.map((s=>(0,i.and)(l(e,t,s,n.ownProperties),i._`${r} = ${s}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=o,t.isOwnProperty=a,t.propertyInData=function(e,t,n,s){const r=i._`${t}${(0,i.getProperty)(n)} !== undefined`;return s?i._`${r} && ${a(e,t,n)}`:r},t.noPropertyInData=l,t.allSchemaProperties=c,t.schemaProperties=function(e,t){return c(t).filter((n=>!(0,s.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:s,schemaPath:o,errorPath:a},it:l},c,h,d){const u=d?i._`${e}, ${t}, ${s}${o}`:t,p=[[r.default.instancePath,(0,i.strConcat)(r.default.instancePath,a)],[r.default.parentData,l.parentData],[r.default.parentDataProperty,l.parentDataProperty],[r.default.rootData,r.default.rootData]];l.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const m=i._`${u}, ${n.object(...p)}`;return h!==i.nil?i._`${c}.call(${h}, ${m})`:i._`${c}(${m})`},t.usePattern=function({gen:e,it:{opts:t}},n){const s=t.unicodeRegExp?"u":"";return e.scopeValue("pattern",{key:n,ref:new RegExp(n,s),code:i._`new RegExp(${n}, ${s})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:r,it:o}=e,a=t.name("valid");if(o.allErrors){const e=t.let("valid",!0);return l((()=>t.assign(e,!1))),e}return t.var(a,!0),l((()=>t.break())),a;function l(o){const l=t.const("len",i._`${n}.length`);t.forRange("i",0,l,(n=>{e.subschema({keyword:r,dataProp:n,dataPropType:s.Type.Num},a),t.if((0,i.not)(a),o)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,s.alwaysValidSchema)(o,e)))&&!o.opts.unevaluated)return;const a=t.let("valid",!1),l=t.name("_valid");t.block((()=>n.forEach(((n,s)=>{const o=e.subschema({keyword:r,schemaProp:s,compositeRule:!0},l);t.assign(a,i._`${a} || ${l}`);e.mergeValidEvaluated(o,l)||t.if((0,i.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},84874:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},59730:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(84874),s=n(45403),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",i.default,s.default];t.default=r},45403:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const i=n(33482),s=n(57111),r=n(56110),o=n(17748),a=n(59336),l=n(20530),c={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:s}=e,{baseId:o,schemaEnv:l,validateName:c,opts:u,self:p}=s,{root:m}=l;if(("#"===n||"#/"===n)&&o===m.baseId)return function(){if(l===m)return d(e,c,l,l.$async);const n=t.scopeValue("root",{ref:m});return d(e,r._`${n}.validate`,m,m.$async)}();const f=a.resolveRef.call(p,m,o,n);if(void 0===f)throw new i.default(o,n);return f instanceof a.SchemaEnv?function(t){const n=h(e,t);d(e,n,t,t.$async)}(f):function(i){const s=t.scopeValue("schema",!0===u.code.source?{ref:i,code:(0,r.stringify)(i)}:{ref:i}),o=t.name("valid"),a=e.subschema({schema:i,dataTypes:[],schemaPath:r.nil,topSchemaRef:s,errSchemaPath:n},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function h(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):r._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,i){const{gen:a,it:c}=e,{allErrors:h,schemaEnv:d,opts:u}=c,p=u.passContext?o.default.this:r.nil;function m(e){const t=r._`${e}.errors`;a.assign(o.default.vErrors,r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`),a.assign(o.default.errors,r._`${o.default.vErrors}.length`)}function f(e){var t;if(!c.opts.unevaluated)return;const i=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==c.props)if(i&&!i.dynamicProps)void 0!==i.props&&(c.props=l.mergeEvaluated.props(a,i.props,c.props));else{const t=a.var("props",r._`${e}.evaluated.props`);c.props=l.mergeEvaluated.props(a,t,c.props,r.Name)}if(!0!==c.items)if(i&&!i.dynamicItems)void 0!==i.items&&(c.items=l.mergeEvaluated.items(a,i.items,c.items));else{const t=a.var("items",r._`${e}.evaluated.items`);c.items=l.mergeEvaluated.items(a,t,c.items,r.Name)}}i?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(r._`await ${(0,s.callValidateCode)(e,t,p)}`),f(t),h||a.assign(n,!0)}),(e=>{a.if(r._`!(${e} instanceof ${c.ValidationError})`,(()=>a.throw(e))),m(e),h||a.assign(n,!1)})),e.ok(n)}():e.result((0,s.callValidateCode)(e,t,p),(()=>f(t)),(()=>m(t)))}t.getValidate=h,t.callRef=d,t.default=c},73348:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(2997),r={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>i._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:r,parentSchema:o,it:a}=e,{oneOf:l}=o;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const c=r.propertyName;if("string"!=typeof c)throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");const h=t.let("valid",!1),d=t.const("tag",i._`${n}${(0,i.getProperty)(c)}`);function u(n){const s=t.name("valid"),r=e.subschema({keyword:"oneOf",schemaProp:n},s);return e.mergeEvaluated(r,i.Name),s}t.if(i._`typeof ${d} == "string"`,(()=>function(){const n=function(){var e;const t={},n=s(o);let i=!0;for(let t=0;te.error(!1,{discrError:s.DiscrError.Tag,tag:d,tagName:c}))),e.ok(h)}};t.default=r},2997:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))},610:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(59730),s=n(86020),r=n(3698),o=n(45036),a=n(99275),l=[i.default,s.default,(0,r.default)(),o.default,a.metadataVocabulary,a.contentVocabulary];t.default=l},88997:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>i.str`must match format "${e}"`,params:({schemaCode:e})=>i._`{format: ${e}}`},code(e,t){const{gen:n,data:s,$data:r,schema:o,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:h,schemaEnv:d,self:u}=l;c.validateFormats&&(r?function(){const r=n.scopeValue("formats",{ref:u.formats,code:c.code.formats}),o=n.const("fDef",i._`${r}[${a}]`),l=n.let("fType"),h=n.let("format");n.if(i._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>n.assign(l,i._`${o}.type || "string"`).assign(h,i._`${o}.validate`)),(()=>n.assign(l,i._`"string"`).assign(h,o))),e.fail$data((0,i.or)(!1===c.strictSchema?i.nil:i._`${a} && !${h}`,function(){const e=d.$async?i._`(${o}.async ? await ${h}(${s}) : ${h}(${s}))`:i._`${h}(${s})`,n=i._`(typeof ${h} == "function" ? ${e} : ${h}.test(${s}))`;return i._`${h} && ${h} !== true && ${l} === ${t} && !${n}`}()))}():function(){const r=u.formats[o];if(!r)return void function(){if(!1===c.strictSchema)return void u.logger.warn(e());throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${h}"`}}();if(!0===r)return;const[a,l,p]=function(e){const t=e instanceof RegExp?(0,i.regexpCode)(e):c.code.formats?i._`${c.code.formats}${(0,i.getProperty)(o)}`:void 0,s=n.scopeValue("formats",{key:o,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,i._`${s}.validate`];return["string",e,s]}(r);a===t&&e.pass(function(){if("object"==typeof r&&!(r instanceof RegExp)&&r.async){if(!d.$async)throw new Error("async format in sync schema");return i._`await ${p}(${s})`}return"function"==typeof l?i._`${p}(${s})`:i._`${p}.test(${s})`}())}())}};t.default=s},45036:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=[n(88997).default];t.default=i},99275:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},33103:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(18062),o={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>i._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:o,schemaCode:a,schema:l}=e;o||l&&"object"==typeof l?e.fail$data(i._`!${(0,s.useFunc)(t,r.default)}(${n}, ${a})`):e.fail(i._`${l} !== ${n}`)}};t.default=o},13139:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(18062),o={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>i._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:o,schema:a,schemaCode:l,it:c}=e;if(!o&&0===a.length)throw new Error("enum must have non-empty array");const h=a.length>=c.opts.loopEnum,d=(0,s.useFunc)(t,r.default);let u;if(h||o)u=t.let("valid"),e.block$data(u,(function(){t.assign(u,!1),t.forOf("v",l,(e=>t.if(i._`${d}(${n}, ${e})`,(()=>t.assign(u,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",l);u=(0,i.or)(...a.map(((t,s)=>function(e,t){const s=a[t];return"object"==typeof s&&null!==s?i._`${d}(${n}, ${e}[${t}])`:i._`${n} === ${s}`}(e,s))))}e.pass(u)}};t.default=o},86020:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20897),s=n(75162),r=n(74905),o=n(22508),a=n(10082),l=n(86846),c=n(57569),h=n(55640),d=n(33103),u=n(13139),p=[i.default,s.default,r.default,o.default,a.default,l.default,c.default,h.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,u.default];t.default=p},57569:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return i.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>i._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s}=e,r="maxItems"===t?i.operators.GT:i.operators.LT;e.fail$data(i._`${n}.length ${r} ${s}`)}};t.default=s},74905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(75842),o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return i.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>i._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o,it:a}=e,l="maxLength"===t?i.operators.GT:i.operators.LT,c=!1===a.opts.unicode?i._`${n}.length`:i._`${(0,s.useFunc)(e.gen,r.default)}(${n})`;e.fail$data(i._`${c} ${l} ${o}`)}};t.default=o},20897:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=i.operators,r={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},o={message:({keyword:e,schemaCode:t})=>i.str`must be ${r[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>i._`{comparison: ${r[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:o,code(e){const{keyword:t,data:n,schemaCode:s}=e;e.fail$data(i._`${n} ${r[t].fail} ${s} || isNaN(${n})`)}};t.default=a},10082:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return i.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>i._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s}=e,r="maxProperties"===t?i.operators.GT:i.operators.LT;e.fail$data(i._`Object.keys(${n}).length ${r} ${s}`)}};t.default=s},75162:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>i.str`must be multiple of ${e}`,params:({schemaCode:e})=>i._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:s,it:r}=e,o=r.opts.multipleOfPrecision,a=t.let("res"),l=o?i._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:i._`${a} !== parseInt(${a})`;e.fail$data(i._`(${s} === 0 || (${a} = ${n}/${s}, ${l}))`)}};t.default=s},22508:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>s.str`must match pattern "${e}"`,params:({schemaCode:e})=>s._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:r,schemaCode:o,it:a}=e,l=a.opts.unicodeRegExp?"u":"",c=n?s._`(new RegExp(${o}, ${l}))`:(0,i.usePattern)(e,r);e.fail$data(s._`!${c}.test(${t})`)}};t.default=r},86846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r=n(20530),o={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>s.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>s._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:o,data:a,$data:l,it:c}=e,{opts:h}=c;if(!l&&0===n.length)return;const d=n.length>=h.loopRequired;if(c.allErrors?function(){if(d||l)e.block$data(s.nil,u);else for(const t of n)(0,i.checkReportMissingProp)(e,t)}():function(){const r=t.let("missing");if(d||l){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,r){e.setParams({missingProperty:n}),t.forOf(n,o,(()=>{t.assign(r,(0,i.propertyInData)(t,a,n,h.ownProperties)),t.if((0,s.not)(r),(()=>{e.error(),t.break()}))}),s.nil)}(r,n))),e.ok(n)}else t.if((0,i.checkMissingProp)(e,n,r)),(0,i.reportMissingProp)(e,r),t.else()}(),h.strictRequired){const t=e.parentSchema.properties,{definedProperties:i}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!i.has(e)){const t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(c,t,c.opts.strictRequired)}}function u(){t.forOf("prop",o,(n=>{e.setParams({missingProperty:n}),t.if((0,i.noPropertyInData)(t,a,n,h.ownProperties),(()=>e.error()))}))}}};t.default=o},55640:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(97349),s=n(56110),r=n(20530),o=n(18062),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>s.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>s._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:l,parentSchema:c,schemaCode:h,it:d}=e;if(!a&&!l)return;const u=t.let("valid"),p=c.items?(0,i.getSchemaTypes)(c.items):[];function m(r,o){const a=t.name("item"),l=(0,i.checkDataTypes)(p,a,d.opts.strictNumbers,i.DataType.Wrong),c=t.const("indices",s._`{}`);t.for(s._`;${r}--;`,(()=>{t.let(a,s._`${n}[${r}]`),t.if(l,s._`continue`),p.length>1&&t.if(s._`typeof ${a} == "string"`,s._`${a} += "_"`),t.if(s._`typeof ${c}[${a}] == "number"`,(()=>{t.assign(o,s._`${c}[${a}]`),e.error(),t.assign(u,!1).break()})).code(s._`${c}[${a}] = ${r}`)}))}function f(i,a){const l=(0,r.useFunc)(t,o.default),c=t.name("outer");t.label(c).for(s._`;${i}--;`,(()=>t.for(s._`${a} = ${i}; ${a}--;`,(()=>t.if(s._`${l}(${n}[${i}], ${n}[${a}])`,(()=>{e.error(),t.assign(u,!1).break(c)}))))))}e.block$data(u,(function(){const i=t.let("i",s._`${n}.length`),r=t.let("j");e.setParams({i,j:r}),t.assign(u,!0),t.if(s._`${i} > 1`,(()=>(p.length>0&&!p.some((e=>"object"===e||"array"===e))?m:f)(i,r)))}),s._`${h} === false`),e.ok(u)}};t.default=a},28926:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,s,r;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(s=i;0!=s--;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(r=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(s=i;0!=s--;)if(!Object.prototype.hasOwnProperty.call(n,r[s]))return!1;for(s=i;0!=s--;){var o=r[s];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n}},68125:e=>{"use strict";var t=e.exports=function(e,t,i){"function"==typeof t&&(i=t,t={}),n(t,"function"==typeof(i=t.cb||i)?i:i.pre||function(){},i.post||function(){},e,"",e)};function n(e,i,s,r,o,a,l,c,h,d){if(r&&"object"==typeof r&&!Array.isArray(r)){for(var u in i(r,o,a,l,c,h,d),r){var p=r[u];if(Array.isArray(p)){if(u in t.arrayKeywords)for(var m=0;m1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,s=1;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=p-m,T=Math.floor,C=String.fromCharCode;function A(e){throw new RangeError(M[e])}function P(e,t){for(var n=[],i=e.length;i--;)n[i]=t(e[i]);return n}function R(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),i+P((e=e.replace(S,".")).split("."),t).join(".")}function L(e){for(var t=[],n=0,i=e.length;n=55296&&s<=56319&&n>1,e+=T(e/t);e>E*f>>1;i+=p)e=T(e/E);return T(i+(E+1)*e/(e+g))},O=function(e){var t=[],n=e.length,i=0,s=b,r=y,o=e.lastIndexOf(_);o<0&&(o=0);for(var a=0;a=128&&A("not-basic"),t.push(e.charCodeAt(a));for(var l=o>0?o+1:0;l=n&&A("invalid-input");var g=N(e.charCodeAt(l++));(g>=p||g>T((u-i)/h))&&A("overflow"),i+=g*h;var v=d<=r?m:d>=r+f?f:d-r;if(gT(u/x)&&A("overflow"),h*=x}var w=t.length+1;r=I(i-c,w,0==c),T(i/w)>u-s&&A("overflow"),s+=T(i/w),i%=w,t.splice(i++,0,s)}return String.fromCodePoint.apply(String,t)},U=function(e){var t=[],n=(e=L(e)).length,i=b,s=0,r=y,o=!0,a=!1,l=void 0;try{for(var c,h=e[Symbol.iterator]();!(o=(c=h.next()).done);o=!0){var d=c.value;d<128&&t.push(C(d))}}catch(e){a=!0,l=e}finally{try{!o&&h.return&&h.return()}finally{if(a)throw l}}var g=t.length,v=g;for(g&&t.push(_);v=i&&RT((u-s)/N)&&A("overflow"),s+=(x-i)*N,i=x;var O=!0,U=!1,k=void 0;try{for(var V,z=e[Symbol.iterator]();!(O=(V=z.next()).done);O=!0){var F=V.value;if(Fu&&A("overflow"),F==i){for(var B=s,$=p;;$+=p){var j=$<=r?m:$>=r+f?f:$-r;if(B>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function $(e){for(var t="",n=0,i=e.length;n=194&&s<224){if(i-n>=6){var r=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&s)<<6|63&r)}else t+=e.substr(n,6);n+=6}else if(s>=224){if(i-n>=9){var o=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&o)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function j(e,t){function n(e){var n=$(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,B).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,B).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,B).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,B).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,B).replace(t.PCT_ENCODED,s)),e}function H(e){return e.replace(/^0*(.*)/,"$1")||"0"}function G(e,t){var n=e.match(t.IPV4ADDRESS)||[],i=h(n,2)[1];return i?i.split(".").map(H).join("."):e}function Z(e,t){var n=e.match(t.IPV6ADDRESS)||[],i=h(n,3),s=i[1],r=i[2];if(s){for(var o=s.toLowerCase().split("::").reverse(),a=h(o,2),l=a[0],c=a[1],d=c?c.split(":").map(H):[],u=l.split(":").map(H),p=t.IPV4ADDRESS.test(u[u.length-1]),m=p?7:8,f=u.length-m,g=Array(m),v=0;v1){var _=g.slice(0,y.index),x=g.slice(y.index+y.length);b=_.join(":")+"::"+x.join(":")}else b=g.join(":");return r&&(b+="%"+r),b}return e}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,q=void 0==="".match(/(){0}/)[1];function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},i=!1!==t.iri?c:l;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(W);if(s){q?(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5])):(n.scheme=s[1]||void 0,n.userinfo=-1!==e.indexOf("@")?s[3]:void 0,n.host=-1!==e.indexOf("//")?s[4]:void 0,n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=-1!==e.indexOf("?")?s[7]:void 0,n.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),n.host&&(n.host=Z(G(n.host,i),i)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var r=F[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||r&&r.unicodeSupport)j(n,i);else{if(n.host&&(t.domainHost||r&&r.domainHost))try{n.host=z.toASCII(n.host.replace(i.PCT_ENCODED,$).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}j(n,l)}r&&r.parse&&r.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}function Y(e,t){var n=!1!==t.iri?c:l,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push(Z(G(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(i.push(":"),i.push(String(e.port))),i.length?i.join(""):void 0}var K=/^\.\.?\//,J=/^\/\.(\/|$)/,Q=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(K))e=e.replace(K,"");else if(e.match(J))e=e.replace(J,"/");else if(e.match(Q))e=e.replace(Q,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(ee);if(!n)throw new Error("Unexpected dot segment condition");var i=n[0];e=e.slice(i.length),t.push(i)}return t.join("")}function ne(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?c:l,i=[],s=F[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?z.toUnicode(e.host):z.toASCII(e.host.replace(n.PCT_ENCODED,$).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}j(e,n),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var r=Y(e,t);if(void 0!==r&&("suffix"!==t.reference&&i.push("//"),i.push(r),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var o=e.path;t.absolutePath||s&&s.absolutePath||(o=te(o)),void 0===r&&(o=o.replace(/^\/\//,"/%2F")),i.push(o)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={};return arguments[3]||(e=X(ne(e,n),n),t=X(ne(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=te(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=te(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=te(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function se(e,t,n){var i=o({scheme:"null"},n);return ne(ie(X(e,i),X(t,i),i,!0),i)}function re(e,t){return"string"==typeof e?e=ne(X(e,t),t):"object"===i(e)&&(e=X(ne(e,t),t)),e}function oe(e,t,n){return"string"==typeof e?e=ne(X(e,n),n):"object"===i(e)&&(e=ne(e,n)),"string"==typeof t?t=ne(X(t,n),n):"object"===i(t)&&(t=ne(t,n)),e===t}function ae(e,t){return e&&e.toString().replace(t&&t.iri?c.ESCAPE:l.ESCAPE,B)}function le(e,t){return e&&e.toString().replace(t&&t.iri?c.PCT_ENCODED:l.PCT_ENCODED,$)}var ce={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},he={scheme:"https",domainHost:ce.domainHost,parse:ce.parse,serialize:ce.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var ue={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=de(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(de(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),i=h(n,2),s=i[0],r=i[1];e.path=s&&"/"!==s?s:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},pe={scheme:"wss",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize},me={},fe="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",ve=n(n("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+n("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+n("%"+ge+ge)),ye="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",be=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),_e="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",xe=new RegExp(fe,"g"),we=new RegExp(ve,"g"),Se=new RegExp(t("[^]",ye,"[\\.]",'[\\"]',be),"g"),Me=new RegExp(t("[^]",fe,_e),"g"),Ee=Me;function Te(e){var t=$(e);return t.match(xe)?t:e}var Ce={scheme:"mailto",parse:function(e,t){var n=e,i=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var s=!1,r={},o=n.query.split("&"),a=0,l=o.length;a{"use strict";n.d(t,{Z:()=>s});const i=function(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)},s={text:function(e,t){const n=window.URL.createObjectURL(new Blob([e],{type:"text/plain"}));i(n,t)},json:function(e,t){"object"==typeof e&&(e=JSON.stringify(e));const n=window.URL.createObjectURL(new Blob([e],{type:"text/json"}));i(n,t)},url:function(e,t){i(e,t)}}},56587:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={json:async function(e,t,n){n&&"string"!=typeof n&&(n=JSON.stringify(n));return fetch(e,{headers:{Accept:"application/json","Content-Type":"application/json"},method:t,credentials:"same-origin",body:n}).then((n=>{if(!n.ok){const i=`fetch.json (${t} at '${e}'), error: ${n.status} - ${n.statusText}`;throw console.warn(i),new Error(i)}return n.json()})).catch((n=>{throw console.warn(`fetch.json (${t} at '${e}'), error: ${n.message}`),n}))},text:async function(e,t,n){return fetch(e,{headers:{Accept:"text/plain, *","Content-Type":"text/plain"},method:t,credentials:"same-origin",body:n}).then((e=>{if(!e.ok)throw new Error(`status: ${e.status}`);return e.text()})).catch((n=>{throw console.warn(`fetch.text (${t} at '${e}'), error: ${n.message}`),n}))},file:async function(e,t,n,i=!0){const s={method:t,credentials:"include",body:n};return i||(s.headers={"Content-Type":"application/octet-stream"}),fetch(e,s).then((e=>{if(!e.ok)throw new Error(`status: ${e.status}`);return e})).catch((n=>{throw console.warn(`fetch.file (${t} at '${e}'), error: ${n.message}`),n}))},buffer:async function(e,t,n){return fetch(e,{headers:{Accept:"application/octet-stream","Content-Type":"application/octet-stream"},method:t,credentials:"include",body:n}).then((e=>{if(!e.ok)throw new Error(`status: ${e.status}`);return e.arrayBuffer()})).catch((n=>{throw console.warn(`fetch.buffer (${t} at '${e}'), error: ${n.message}`),n}))}}},31741:(e,t,n)=>{"use strict";function i(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");const n=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);if(n)return n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):""}n.d(t,{Z:()=>i})},47855:(e,t,n)=>{"use strict";n.d(t,{P:()=>s,ZP:()=>o});var i=n(96368);class s{constructor(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}static makeZeros(){return new s(0,0,0)}static makeOnes(){return new s(1,1,1)}static makeUnitX(){return new s(1,0,0)}static makeUnitY(){return new s(0,1,0)}static makeUnitZ(){return new s(0,0,1)}static makeCopy(e){return new s(e.x,e.y,e.z)}static makeFromScalar(e){return new s(e,e,e)}static makeFromArray(e){return new s(e[0],e[1],e[2])}static toString(e){return`[${e.x}, ${e.y}, ${e.z}]`}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}set(e,t,n){return this.x=e,this.y=t,this.z=n,this}setFromScalar(e){return this.x=e,this.y=e,this.z=e,this}setFromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}setZeros(){return this.x=0,this.y=0,this.z=0,this}setOnes(){return this.x=1,this.y=1,this.z=1,this}setUnitX(){return this.x=1,this.y=0,this.z=0,this}setUnitY(){return this.x=0,this.y=1,this.z=0,this}setUnitZ(){return this.x=0,this.y=0,this.z=1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}mul(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}div(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}mulScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}divScalar(e){return this.x/=e,this.y/=e,this.z/=e,this}translate(e,t,n){return this.x+=e,this.y+=t,this.z+=n,this}rotateX(e){const t=Math.cos(e),n=Math.sin(e),i=this.y,s=this.z;return this.y=t*i-n*s,this.z=n*i+t*s,this}rotateY(e){const t=Math.cos(e),n=Math.sin(e),i=this.x,s=this.z;return this.x=t*i+n*s,this.z=-n*i+t*s,this}rotateZ(e){const t=Math.cos(e),n=Math.sin(e),i=this.x,s=this.y;return this.x=t*i-n*s,this.y=n*i+t*s,this}scale(e,t,n){return this.x*=e,this.y*=t,this.z*=n,this}invert(){return this.x=1/this.x,this.y=1/this.y,this.z=1/this.z,this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}normalize(){const e=1/Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x*=e,this.y*=e,this.z*=e,this}homogenize(){return this.x/=this.z,this.y/=this.z,this.z=1,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){const t=this.y*e.z-this.z*e.y,n=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.x=t,this.y=n,this.z=i,this}length(){const e=this.x,t=this.y,n=this.z;return Math.sqrt(e*e+t*t+n*n)}lengthSquared(){const e=this.x,t=this.y,n=this.z;return e*e+t*t+n*n}distanceTo(e){const t=e.x-this.x,n=e.y-this.y,i=e.z-this.z;return Math.sqrt(t*t+n*n+i*i)}min(){return this.xthis.y?this.x>this.z?this.x:this.z:this.y>this.z?this.y:this.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}clone(){return new s(this.x,this.y,this.z)}toArray(e,t){return e?(void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e):[this.x,this.y,this.z]}toVector2(e){return e?(e.x=this.x,e.y=this.y,e):new i.Z(this.x,this.y)}toString(){return s.toString(this)}}s.zeros=new s(0,0,0),s.ones=new s(1,1,1),s.unitX=new s(1,0,0),s.unitY=new s(0,1,0),s.unitZ=new s(0,0,1);class r{constructor(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=i||0}static makeZeros(){return new r(0,0,0,0)}static makeOnes(){return new r(1,1,1,1)}static makeUnitX(){return new r(1,0,0,0)}static makeUnitY(){return new r(0,1,0,0)}static makeUnitZ(){return new r(0,0,1,0)}static makeUnitW(){return new r(0,0,0,1)}static makeCopy(e){return new r(e.x,e.y,e.z,e.w)}static makeFromScalar(e){return new r(e,e,e,e)}static makeFromArray(e){return new r(e[0],e[1],e[2],e[3])}static makeFromPosition(e){return new r(e.x,e.y,e.z,1)}static makeFromDirection(e){return new r(e.x,e.y,e.z,0)}static toString(e){return`[${e.x}, ${e.y}, ${e.z}, ${e.w}]`}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=void 0===i?1:i,this}setFromScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setFromArray(e,t=1){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}setPosition(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=1,this}setDirection(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=0,this}setZeros(){return this.x=0,this.y=0,this.z=0,this.w=0,this}setOnes(){return this.x=1,this.y=1,this.z=1,this.w=1,this}setUnitX(){return this.x=1,this.y=0,this.z=0,this.w=0,this}setUnitY(){return this.x=0,this.y=1,this.z=0,this.w=0,this}setUnitZ(){return this.x=0,this.y=0,this.z=1,this.w=0,this}setUnitW(){return this.x=0,this.y=0,this.z=0,this.w=1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}mul(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}div(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}normalize(){const e=1/Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}homogenize(){return this.x/=this.w,this.y/=this.w,this.z/=this.w,this.w=1,this}project(e){const t=this.dot(e)/this.lengthSquared();return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}length(){const e=this.x,t=this.y,n=this.z,i=this.w;return Math.sqrt(e*e+t*t+n*n+i*i)}lengthSquared(){const e=this.x,t=this.y,n=this.z,i=this.w;return e*e+t*t+n*n+i*i}isZero(){return 0===this.x&&0===this.y&&0===this.z&&0===this.w}clone(){return new r(this.x,this.y,this.z,this.w)}toArray(e,t){return e?(void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e):[this.x,this.y,this.z,this.w]}toVector3(e){return e?(e.x=this.x,e.y=this.y,e.z=this.z,e):new s(this.x,this.y,this.z)}toString(){return r.toString(this)}}r.zeros=new r(0,0,0,0),r.ones=new r(1,1,1,1),r.unitX=new r(1,0,0,0),r.unitY=new r(0,1,0,0),r.unitZ=new r(0,0,1,0),r.unitW=new r(0,0,0,1);class o{constructor(e=0,t=0,n=0,i=1){e instanceof o?(this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w):Array.isArray(e)?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0,this.w=void 0!==e[3]?e[3]:1):"string"==typeof e?this.setString(e):(this.x=e,this.y=t,this.z=n,this.w=i)}static fromString(e){return(new o).setString(e)}static fromArray(e){return new o(e)}get r(){return this.x}get g(){return this.y}get b(){return this.z}get a(){return this.w}set r(e){this.x=e}set g(e){this.y=e}set b(e){this.z=e}set a(e){this.w=e}get red(){return this.x}get green(){return this.y}get blue(){return this.z}get alpha(){return this.w}set red(e){this.x=e}set green(e){this.y=e}set blue(e){this.z=e}set alpha(e){this.w=e}get redByte(){return Math.floor(255*this.x)}get greenByte(){return Math.floor(255*this.y)}get blueByte(){return Math.floor(255*this.z)}get alphaByte(){return Math.floor(255*this.w)}set redByte(e){this.x=e/255}set greenByte(e){this.y=e/255}set blueByte(e){this.z=e/255}set alphaByte(e){this.w=e/255}inverseMultiply(e){return this.x=this.x*(1-e)+e,this.y=this.y*(1-e)+e,this.z=this.z*(1-e)+e,this}multiply(e){return this.x*=e,this.y*=e,this.z*=e,this}copy(e){this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w}clone(){return new o(this.x,this.y,this.z,this.w)}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=void 0===i?1:i,this}setBytes(e,t,n,i){return this.x=e/255,this.y=t/255,this.z=n/255,this.w=void 0===i?1:i/255,this}setUInt24RGB(e){return this.x=e>>16&255,this.y=e>>8&255,this.z=255&e,this.w=1,this}setUInt32RGBA(e){return this.x=e>>24&255,this.y=e>>16&255,this.z=e>>8&255,this.w=255&e,this.w=1,this}setRed(e){return this.x=e,this}setGreen(e){return this.y=e,this}setBlue(e){return this.z=e,this}setAlpha(e){return this.w=e,this}setRedByte(e){return this.x=e/255,this}setGreenByte(e){return this.y=e/255,this}setBlueByte(e){return this.z=e/255,this}setAlphaByte(e){return this.w=e/255,this}setHSV(e,t=1,n=1,i){"object"==typeof e&&(t=e.y,n=e.z,i=void 0!==e.w?e.w:i,e=e.x);const s=Math.floor(e/60),r=e/60-s,o=n*(1-t),a=n*(1-r*t),l=n*(1-(1-r)*t);let c,h,d;switch(s%6){case 0:c=n,h=l,d=o;break;case 1:c=a,h=n,d=o;break;case 2:c=o,h=n,d=l;break;case 3:c=o,h=a,d=n;break;case 4:c=l,h=o,d=n;break;case 5:c=n,h=o,d=a}return this.x=c,this.y=h,this.z=d,void 0!==i&&(this.w=i),this}setHSL(e,t=1,n=1,i){if("object"==typeof e&&(t=e.y,n=e.z,i=void 0!==e.w?e.w:i,e=e.x),0===t)this.x=this.y=this.z=n;else{function o(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}e/=360;var s=n<.5?n*(1+t):n+t-n*t,r=2*n-s;this.x=o(r,s,e+1/3),this.y=o(r,s,e),this.z=o(r,s,e-1/3)}return void 0!==i&&(this.w=i),this}fromArray(e){this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0,this.w=void 0!==e[3]?e[3]:1}setString(e,t=1,n=!0){e=e.trim().toLowerCase();let i=(e=o.presets[e]||e).match(/^#?([0-9a-f]{3})$/i);if(i){const e=i[1],n=1/15;return this.x=Number.parseInt(e.charAt(0),16)*n,this.y=Number.parseInt(e.charAt(1),16)*n,this.z=Number.parseInt(e.charAt(2),16)*n,this.w=t,this}if(i=e.match(/^#?([0-9a-f]{6})$/i),i){const e=i[1],n=1/255;return this.x=Number.parseInt(e.substr(0,2),16)*n,this.y=Number.parseInt(e.substr(2,2),16)*n,this.z=Number.parseInt(e.substr(4,2),16)*n,this.w=t,this}if(0===e.indexOf("rgb")){let n=e.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const e=1/255;return this.x=Number.parseInt(n[1])*e,this.y=Number.parseInt(n[2])*e,this.z=Number.parseInt(n[3])*e,this.w=t,this}if(n=e.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+.*\d*)\s*\)$/i),n){const e=1/255;return this.x=Number.parseInt(n[1])*e,this.y=Number.parseInt(n[2])*e,this.z=Number.parseInt(n[3])*e,this.w=Number.parseFloat(n[4]),this}}if(0===e.indexOf("hsl")){let n=e.match(/(\d+(\.\d+)?)/g);return n&&this.setHSL(Number.parseFloat(n[0]),.01*Number.parseFloat(n[1]),.01*Number.parseFloat(n[2]),void 0!==n[3]?Number.parseFloat(n[3]):t),this}if(n)throw new RangeError("failed to parse color from string: "+e);return this}toUInt24RGB(){return Math.floor(255*this.x)<<16+Math.floor(255*this.y)<<8+Math.floor(255*this.z)}toUInt32RGBA(){return Math.floor(255*this.x)<<24+Math.floor(255*this.y)<<16+Math.floor(255*this.z)<<8+Math.floor(255*this.w)}toVector3(e){return e?(e.x=this.r,e.y=this.g,e.z=this.b,e):new s(this.r,this.g,this.b)}toVector4(e){return e?(e.x=this.r,e.y=this.g,e.z=this.b,e.w=this.a,e):new r(this.r,this.g,this.b,this.a)}toHSV(e){let t=this.x,n=this.y,i=this.z,r=Math.min(t,n,i),o=Math.max(t,n,i),a=o-r,l=0,c=0===o?0:a/o,h=o;return 0!==a&&(l=60*(t===o?(n-i)/a+(n.5?a/(2-o-r):a/(o+r),l=60*(t===o?(n-i)/a+(n{"use strict";n.d(t,{Z:()=>r});var i=n(82942);class s{constructor(e,t){this._args=e,this._props=t,this._args=e,this._state=null}get name(){return this._props.name||this._props.do.name.replace(/([A-Z])/g," $1").replace(/^./,(e=>e.toUpperCase()))}do(){if(this._state)throw new Error("undo should be called before execute can be applied again");this._state=this._props.do.apply(this._props.target,this._args)}undo(){if(!this._props.undo)throw new Error("can't undo this command");if(!this._state)throw new Error("execute should be called before undo can be applied");this._props.undo.call(this._props.target,this._state),this._state=null}canDo(){return!this._props.canDo||this._props.canDo()}canUndo(){return!!this._props.undo}}class r extends i.Z{constructor(e){super(),this.addEvent("update"),this.stack=[],this.pointer=-1,this.capacity=void 0!==e?e:r.defaultCapacity}register(e){let t;t="function"==typeof e?e:t=>new s(t,e);return(...e)=>{const n=t(e);this.do(n)}}setCapacity(e){for(this.capacity=e;this.stack.length>e;)this.stack.shift(),this.pointer--;this.pointer<0&&(this.stack=[],this.pointer=-1)}do(e){console.log(`Commander.do - '${e.name}'`),e.do(),e.canUndo()&&(this.stack.splice(this.pointer+1),this.stack.push(e),this.stack.length>this.capacity&&this.stack.shift(),this.pointer=this.stack.length-1,this.emit("update"))}undo(){if(this.pointer>=0){this.stack[this.pointer].undo(),this.pointer--,this.emit("update")}}redo(){if(this.pointer0&&(this.stack=[],this.pointer=-1,this.emit("update"))}canUndo(){return this.pointer>=0}canRedo(){return this.pointer=0?"Undo "+this.stack[this.pointer].name:"Can't Undo"}getRedoText(){return this.pointer{"use strict";n.d(t,{Z:()=>r});var i=n(82942),s=n(84292);class r extends i.Z{constructor(e){super(),this.addEvents("update","dispose"),e?this.fromJSON(e):this._data=this.init()}static generateId(){return(0,s.Z)()}get id(){return this._data.id}get data(){return this._data}set(e,t){this._data[e]=t,this.update()}get(e){return this._data[e]}update(){this.emit({type:"update",document:this})}dispose(){this.emit({type:"dispose",document:this}),this._data=null}fromJSON(e){return this._data={},this.inflate(e,this._data),this.update(),this}toJSON(e){return e=e||{},this.deflate(this._data,e),e}init(){return{}}inflate(e,t){Object.assign(t,e)}deflate(e,t){t=t||{},Object.assign(t,this._data)}}},97444:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(82942);const s=[];class r extends i.Z{constructor(e){super({knownEvents:!1});const t=e.typeName;if(!t)throw new Error("root type must have a 'typeName' member");this._rootTypeName=t,this._objLists={[this._rootTypeName]:[]},this._objTags={},this._objDict={}}static getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e}add(e){const t=e.id;if("string"==typeof t){if(void 0!==this._objDict[t])throw new Error("object already registered");this._objDict[t]=e}let n,i=e;const s=this._rootTypeName,r={type:"",add:!0,remove:!1,object:e};do{i=Object.getPrototypeOf(i),n=i.constructor.typeName,n&&((this._objLists[n]||(this._objLists[n]=[])).push(e),r.type=n,this.emit(r))}while(n!==s)}remove(e){const t=e.id;if("string"==typeof t){if(this._objDict[t]!==e)throw new Error("object not registered");delete this._objDict[t]}let n,i=e;const s=this._rootTypeName,r={type:"",add:!1,remove:!0,object:e};do{if(i=Object.getPrototypeOf(i),n=i.constructor.typeName,n){r.type=n;const t=this._objLists[n];t.splice(t.indexOf(e),1),this.emit(r)}}while(n!==s)}addByTag(e,t){if(!e||"tag"===e)throw new Error("illegal tag name");(this._objTags[e]||(this._objTags[e]=[])).push(t);const n={type:"tag",add:!0,remove:!1,object:t,tag:e};this.emit(n),n.type=e,this.emit(n)}removeByTag(e,t){if(!e||"tag"===e)throw new Error("illegal tag name");const n=this._objTags[e];if(n){const i=n.indexOf(t);if(i>=0){const s={type:"tag",add:!1,remove:!0,object:t,tag:e};return this.emit(s),s.type=e,this.emit(s),n.splice(i,1),!0}}return!1}clear(){this.cloneArray().forEach((e=>this.remove(e)))}get length(){return this._objLists[this._rootTypeName].length}count(e){const t=this._objLists[this.getTypeName(e)];return t?t.length:0}has(e){if("function"==typeof e){const t=this._objLists[e.typeName];return!!t&&t.length>0}if("string"==typeof e){const t=this._objLists[e];return!!t&&t.length>0}const t=this._objLists[e.constructor.typeName];return t&&t.indexOf(e)>=0}contains(e){const t=e.id;if("string"==typeof t)return!!this._objDict[t];const n=this._objLists[e.constructor.typeName];return n&&n.indexOf(e)>=0}get(e,t=!1){const n=this.getTypeName(e),i=this._objLists[n],s=i?i[0]:void 0;if(!t&&!s)throw new Error(`no instances of class '${n}' in object registry`);return s}getArray(e){return this._objLists[this.getTypeName(e)]||s}cloneArray(e){return this.getArray(e).slice()}getById(e){return this._objDict[e]}getDictionary(){return this._objDict}getByTag(e){return this._objTags[e]||s}on(e,t,n){super.on(this.getTypeName(e),t,n)}once(e,t,n){super.once(this.getTypeName(e),t,n)}off(e,t,n){super.off(this.getTypeName(e),t,n)}getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e||this._rootTypeName}}},82942:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const i=Symbol("Publisher private data"),s=Symbol("Publisher strict option");class r{constructor(e){const t=!e||e.knownEvents;this[i]={[s]:t}}on(e,t,n){if(Array.isArray(e))return void e.forEach((e=>{this.on(e,t,n)}));if(!t)throw new Error("missing callback function");let r=this[i][e];if(!r){if(this[i][s])throw new Error(`can't subscribe; unknown event: '${e}'`);r=this[i][e]=[]}let o={callback:t,context:n};r.push(o)}addEventListener(e,t,n){this.on(e,t,n)}once(e,t,n){if(Array.isArray(e))return void e.forEach((e=>{this.once(e,t,n)}));const i=s=>{this.off(e,i,n),t.call(n,s)};i.cb=t,this.on(e,i,n)}off(e,t,n){if("object"==typeof e){if(Array.isArray(e))e.forEach((e=>{this.off(e,t,n)}));else{const t=this[i];for(let n=0,i=Object.keys(t).length;n{this[i][e]||(this[i][e]=[])}))}hasEvent(e){return!!this[i][e]}listEvents(){return Object.getOwnPropertyNames(this[i])}}},25976:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{constructor(e,t,n){this._type=e,this._callback=t,this._context=n,this._publishers=[]}on(...e){return e.forEach((e=>{this._publishers.push(e),e.on(this._type,this._callback,this._context)})),this}off(){return this._publishers.forEach((e=>e.off(this._type,this._callback,this._context))),this._publishers.length=0,this}}},26041:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(82942);class s extends i.Z{constructor(){super(),this._dict={},this.addEvent("type")}add(e){if(Array.isArray(e))return void e.forEach((e=>this.add(e)));const t=e.typeName;if(!t)throw new Error("type must have a 'typeName' member");if(this._dict[t])throw new Error(`type '${t}' already registered`);this._dict[t]=e,this.emit({type:"type",add:!0,remove:!1,classType:e})}remove(e){if(Array.isArray(e))return void e.forEach((e=>this.remove(e)));const t=e.typeName;if(!t)throw new Error("type must have a 'typeName' member");if(!this._dict[t])throw new Error(`type '${t}' not registered`);delete this._dict[t],this.emit({type:"type",add:!1,remove:!0,classType:e})}getType(e){let t=e;return"function"==typeof e?t=e.typeName:"object"==typeof e&&(t=e.constructor.typeName),this._dict[t]}createInstance(e,...t){const n=this.getType(e);if(!n)throw new Error(`type '${e}' not registered`);return new n(...t)}}},96368:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{constructor(e,t){this.x=e||0,this.y=t||0}static makeZeros(){return new i(0,0)}static makeOnes(){return new i(1,1)}static makeUnitX(){return new i(1,0)}static makeUnitY(){return new i(0,1)}static makeCopy(e){return new i(e.x,e.y)}static makeFromScalar(e){return new i(e,e)}static makeFromArray(e){return new i(e[0],e[1])}static toString(e){return`[${e.x}, ${e.y}]`}copy(e){return this.x=e.x,this.y=e.y,this}set(e,t){return this.x=e,this.y=t,this}setFromScalar(e){return this.x=e,this.y=e,this}setFromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}setZeros(){return this.x=0,this.y=0,this}setOnes(){return this.x=1,this.y=1,this}setUnitX(){return this.x=1,this.y=0,this}setUnitY(){return this.x=0,this.y=1,this}add(e){return this.x+=e.x,this.y+=e.y,this}sub(e){return this.x-=e.x,this.y-=e.y,this}mul(e){return this.x*=e.x,this.y*=e.y,this}div(e){return this.x/=e.x,this.y/=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}subScalar(e){return this.x-=e,this.y-=e,this}mulScalar(e){return this.x*=e,this.y*=e,this}divScalar(e){return this.x/=e,this.y/=e,this}translate(e,t){return this.x+=e,this.y+=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),i=this.x,s=this.y;return this.x=t*i-n*s,this.y=n*i+t*s,this}scale(e,t){return this.x*=e,this.y*=t,this}invert(){return this.x=1/this.x,this.y=1/this.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){const e=1/Math.sqrt(this.x*this.x+this.y*this.y);return this.x*=e,this.y*=e,this}dot(e){return this.x*e.x+this.y*e.y}length(){const e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}lengthSquared(){const e=this.x,t=this.y;return e*e+t*t}distanceTo(e){const t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)}angle(){return Math.atan2(this.y,this.x)}angleTo(e){const t=this.x,n=this.y,i=e.x,s=e.y;return Math.acos((t*i+n*s)/(Math.sqrt(t*t+n*n)+Math.sqrt(i*i+s*s)))}min(){return this.xthis.y?this.x:this.y}isZero(){return 0===this.x&&0===this.y}clone(){return new i(this.x,this.y)}toArray(e,t){return e?(void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e):[this.x,this.y]}toString(){return i.toString(this)}}i.zeros=new i(0,0),i.ones=new i(1,1),i.unitX=new i(1,0),i.unitY=new i(0,1)},28581:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});const i={PI:3.141592653589793,DOUBLE_PI:6.283185307179586,HALF_PI:1.5707963267948966,QUARTER_PI:.7853981633974483,DEG2RAD:.017453292519943295,RAD2DEG:57.29577951308232,limit:(e,t,n)=>en?n:e,limitInt:function(e,t,n){return(e=Math.trunc(e))n?n:e},normalize:(e,t,n)=>(e-t)/(n-t),normalizeLimit:(e,t,n)=>(e=(e-t)/(n-t))<0?0:e>1?1:e,denormalize:(e,t,n)=>(t+e)*(n-t),scale:(e,t,n,i,s)=>i+(e-t)/(n-t)*(s-i),scaleLimit:(e,t,n,i,s)=>i+((e=en?n:e)-t)/(n-t)*(s-i),deg2rad:function(e){return.017453292519943295*e},rad2deg:function(e){return 57.29577951308232*e},deltaRadians:function(e,t){return e=(e%=i.DOUBLE_PI)<0?e+i.DOUBLE_PI:e,(t=(t%=i.DOUBLE_PI)<0?t+i.DOUBLE_PI:t)-e>i.PI&&(e+=i.DOUBLE_PI),t-e},deltaDegrees:function(e,t){return e=(e%=i.DOUBLE_PI)<0?e+i.DOUBLE_PI:e,(t=(t%=i.DOUBLE_PI)<0?t+i.DOUBLE_PI:t)-e>i.PI&&(e+=i.DOUBLE_PI),t-e},curves:{linear:e=>e,easeIn:e=>Math.sin(e*i.HALF_PI),easeOut:e=>Math.cos(e*i.HALF_PI-i.PI)+1,ease:e=>.5*Math.cos(e*i.PI-i.PI)+.5,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e}},s=i},82507:(e,t,n)=>{"use strict";n.d(t,{q:()=>i});const i=function(e){return Object.keys(e).filter((e=>isNaN(Number(e))))}},84292:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});function i(e,t){let n;e&&"number"==typeof e||(e=12);do{n="";for(let t=0;t{"use strict";n.d(t,{ZP:()=>c,V5:()=>s.V5});var i=n(82942),s=n(31181),r=n(84292);class o extends i.Z{constructor(e){super(),this.addEvent("property"),this.linkable=e,this.properties=[]}get customProperties(){return this.properties.filter((e=>e.custom))}dispose(){this.unlinkAllProperties()}isInputGroup(){return this===this.linkable.ins}isOutputGroup(){return this===this.linkable.outs}createProperties(e,t){return Object.keys(e).forEach(((n,i)=>{const s=void 0===t?void 0:t+i,r=e[n];this.createProperty(r.path,r.schema,n,s)})),this}createProperty(e,t,n,i){const r=new s.ZP(e,t);return this.addProperty(r,n,i),r}createCustomProperty(e,t,n){const i=new s.ZP(e,t,!0);return this.addCustomProperty(i,n),i}addCustomProperty(e,t){const n=(0,r.Z)(5);this.addProperty(e,n,t)}addProperty(e,t,n){if(e.group)throw new Error("can't add, property already part of a group");if(this[t])throw new Error(`key '${t}' already exists in group`);e._group=this,e._key=t,void 0===n?this.properties.push(e):this.properties.splice(n,0,e),this[t]=e,this.emit({type:"property",add:!0,remove:!1,property:e})}removeProperty(e){if(e.group!==this)throw new Error("can't remove, property not in this group");if(e.hasLinks())throw new Error("can't remove, property has links");if(this[e.key]!==e)throw new Error(`property key '${e.key}' not found in group`);this.properties.slice(this.properties.indexOf(e),1),delete this[e.key],e._group=null,e._key="",this.emit({type:"property",add:!1,remove:!0,property:e})}getProperty(e){const t=this[e];if(!t)throw new Error(`no property found with key '${e}'`);return t}getKeys(e=!1){const t=[];return this.properties.forEach((n=>{(e||"object"!==n.type)&&t.push(n.key)})),t}getValues(e=!1){const t=[];return this.properties.map((n=>{(e||"object"!==n.type)&&t.push(n.value)})),t}cloneValues(e=!1){const t=[];return this.properties.map((n=>{(e||"object"!==n.type)&&t.push(n.cloneValue())})),t}setValues(e){Object.keys(e).forEach((t=>this.getProperty(t).value=e[t]))}copyValues(e){Object.keys(e).forEach((t=>this.getProperty(t).copyValue(e[t])))}unlinkAllProperties(){this.properties.forEach((e=>e.unlink()))}toJSON(){let e=null;return this.properties.forEach((t=>{const n=t.toJSON();n&&(e=e||{},e[t.key]=n)})),e}fromJSON(e){Object.keys(e).forEach((t=>{const n=e[t];if(n.schema){const e=new s.ZP(n.path,n.schema,!0);this.addProperty(e,t)}}))}linksFromJSON(e,t){Object.keys(e).forEach((n=>{this[n].fromJSON(e[n],t)}))}}var a=n(52226);class l{constructor(e,t){this._typeName=t?c.getTypeName(t):null,this._id=t instanceof c?t.id:void 0,this._system=e}get component(){return this._id&&this._system.components.getById(this._id)||null}set component(e){if(e&&this._typeName&&!(e instanceof this._system.registry.getType(this._typeName)))throw new Error(`can't assign component of class '${e.constructor.name||"unknown"}' to link of class '${this._typeName}'`);this._id=e?e.id:void 0}}n(90199);class c extends i.Z{constructor(e,t){super({knownEvents:!1}),this.ins=new o(this),this.outs=new o(this),this.changed=!0,this.updated=!1,this._name="",this._tags=new Set,this._trackers=[],this.node=e,this.id=t}static getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e||c.typeName}create(){this.node._addComponent(this),this.graph.isActive&&this.activate&&this.activate()}dispose(){this.graph.isActive&&this.deactivate&&this.deactivate(),this.emit({type:"dispose",component:this}),this.ins.dispose(),this.outs.dispose(),this._trackers.forEach((e=>e.dispose())),this.node&&(this.node._removeComponent(this),this.node=null)}get isNodeSingleton(){return this.constructor.isNodeSingleton}get isGraphSingleton(){return this.constructor.isGraphSingleton}get isSystemSingleton(){return this.constructor.isSystemSingleton}get typeName(){return this.constructor.typeName}get displayTypeName(){const e=this.typeName;return"Component"===e?e:e.substr(1)}get text(){return this.constructor.text}get icon(){return this.constructor.icon}get name(){return this._name}get displayName(){return this._name||this.text||this.displayTypeName}set name(e){this._name=e,this.emit({type:"change",component:this,what:"name"})}get tags(){return this._tags}addTag(e){this._tags.has(e)||(this._tags.add(e),this.node._addComponentTag(e,this))}removeTag(e){this._tags.has(e)&&(this._tags.delete(e),this.node._removeComponentTag(e,this))}get graph(){return this.node.graph}get system(){return this.node.system}get components(){return this.node.components}get isActive(){return this.graph.isActive}getComponent(e,t=!1){return this.node.components.get(e,t)}getComponents(e){return this.node.components.getArray(e)}getComponentsByTag(e){return this.node.components.getByTag(e)}createComponent(e){return this.node.createComponent(e)}getOrCreateComponent(e){return this.node.components.get(e,!0)||this.node.createComponent(e)}hasComponent(e){return this.node.components.has(e)}getGraphComponent(e,t=!1){return this.node.graph.components.get(e,t)}getGraphComponents(e){return this.node.graph.components.getArray(e)}getGraphComponentsByTag(e){return this.node.graph.components.getByTag(e)}hasGraphComponent(e){return this.node.graph.components.has(e)}getMainComponent(e,t=!1){return this.node.system.graph.components.get(e,t)}getMainComponents(e){return this.node.system.graph.components.getArray(e)}getMainComponentsByTag(e){return this.node.system.graph.components.getByTag(e)}hasMainComponent(e){return this.node.system.graph.components.has(e)}getSystemComponent(e,t=!1){return this.node.system.components.get(e,t)}getSystemComponents(e){return this.node.system.components.getArray(e)}getSystemComponentsByTag(e){return this.node.system.components.getByTag(e)}hasSystemComponent(e){return this.node.system.components.has(e)}getComponentById(e){return this.node.system.components.getById(e)}getNode(e,t=!1){return this.node.graph.nodes.get(e,t)}getNodes(e){return this.node.graph.nodes.getArray(e)}getNodesByTag(e){return this.node.graph.nodes.getByTag(e)}hasNode(e){return this.node.graph.nodes.has(e)}getMainNode(e,t=!1){return this.node.system.graph.nodes.get(e,t)}getMainNodes(e){return this.node.system.graph.nodes.getArray(e)}getMainNodesByTag(e){return this.node.system.graph.nodes.getByTag(e)}hasMainNode(e){return this.node.system.graph.nodes.has(e)}getSystemNode(e,t=!1){return this.node.system.nodes.get(e,t)}getSystemNodes(e){return this.node.system.nodes.getArray(e)}getSystemNodesByTag(e){return this.node.system.nodes.getByTag(e)}hasSystemNode(e){return this.node.system.nodes.has(e)}getNodeById(e){return this.node.system.nodes.getById(e)}activate(){}update(e){throw new Error("this should never be called")}tick(e){throw new Error("this should never be called")}tock(e){throw new Error("this should never be called")}deactivate(){}requestSort(){this.graph.requestSort()}is(e){const t=c.getTypeName(e);let n=this;do{if(n=Object.getPrototypeOf(n),n.constructor.typeName===t)return!0}while(n.constructor.typeName!==c.typeName);return!1}unlinkAllProperties(){this.ins.unlinkAllProperties(),this.outs.unlinkAllProperties()}resetChanged(){this.changed=!1;const e=this.ins.properties;for(let t=0,n=e.length;tt.dump(e+" IN "))),this.outs.properties.forEach((t=>t.dump(e+" OUT ")))}toJSON(){let e={};const t=this.ins.toJSON();t&&(e.ins=t);const n=this.outs.toJSON();return n&&(e.outs=n),e}fromJSON(e){e.ins&&this.ins.fromJSON(e.ins),e.outs&&this.outs.fromJSON(e.outs)}referencesFromJSON(e){const t=this.system.components.getDictionary();e.ins&&this.ins.linksFromJSON(e.ins,t),e.outs&&this.outs.linksFromJSON(e.outs,t)}addCustomInput(e,t,n){return this.changed=!0,this.ins.createCustomProperty(e,t,n)}allowCustomInput(e){return!1}addCustomOutput(e,t,n){return this.outs.createCustomProperty(e,t,n)}allowCustomOutput(e){return!1}addInputs(e,t){return this.ins.createProperties(e,t)}addOutputs(e,t){return this.outs.createProperties(e,t)}}c.typeName="Component",c.text="",c.icon="",c.isNodeSingleton=!0,c.isGraphSingleton=!1,c.isSystemSingleton=!1,c.prototype.activate=null,c.prototype.update=null,c.prototype.tick=null,c.prototype.tock=null,c.prototype.deactivate=null},52226:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s{constructor(e,t,n,s){this.typeName=i.ZP.getTypeName(t),this.didAdd=n,this.willRemove=s,this._registry=e,e.on(this.typeName,this.onComponent,this),this.component=e.get(t,!0),this.component&&n&&n(this.component)}dispose(){this._registry.off(this.typeName,this.onComponent,this),this.component=null,this.didAdd=null,this.willRemove=null}onComponent(e){e.add?(this.component=e.object,this.didAdd&&this.didAdd(e.object)):e.remove&&(this.willRemove&&this.willRemove(e.object),this.component=null)}}},83275:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(84292),s=n(82942);class r{constructor(){this.visited={},this.visiting={},this.sorted=[]}sort(e){for(let t=0,n=e.length;t0)throw new Error("graph not empty")}requestSort(){this._sortRequested=!0}sort(){this._sortedList=this._sorter.sort(this.components.getArray());this.parent&&(this.parent.name||this.parent.typeName)}createCustomNode(e,t,n){const s=this.system.registry.getType(e);if(!s)throw new Error(`node type '${a.Z.getTypeName(e)}' not registered`);const r=new s(this,n||(0,i.Z)(12,this.system.nodes.getDictionary()));return r.create(),t&&(r.name=t),n||(r.createComponents(),r.unlock()),r}createNode(e,t){const n=new a.Z(this,t||(0,i.Z)(12,this.system.nodes.getDictionary()));return n.create(),e&&(n.name=e),n.unlock(),n}findNodeByName(e,t){const n=this.nodes.getArray(t);for(let t=0,i=n.length;te.toString(!0))).join("\n"):i}dump(e=""){console.log(e+"%cGraph","color: red");this.findRootNodes().forEach((t=>t.dump(e+" ")))}toJSON(){const e={},t=[],n=this.nodes.getArray();for(let e=0,i=n.length;e0&&(e.nodes=t),e}fromJSON(e){e.nodes&&(e.nodes.forEach((e=>{this.createCustomNode(e.type,e.name,e.id).fromJSON(e)})),e.nodes.forEach((e=>{this.nodes.getById(e.id).referencesFromJSON(e)})))}nodeToJSON(e){return e.toJSON()}_addNode(e){this.nodes.add(e),this.system._addNode(e)}_removeNode(e){this.system._removeNode(e),this.nodes.remove(e)}_addNodeTag(e,t){this.nodes.addByTag(e,t),this.system._addNodeTag(e,t)}_removeNodeTag(e,t){this.system._removeNodeTag(e,t),this.nodes.removeByTag(e,t)}_addComponent(e){if(e.isGraphSingleton&&this.components.has(e))throw new Error(`only one component of type '${e.typeName}' allowed per graph`);this.components.add(e),this.system._addComponent(e),e.tock&&this._tockList.push(e),this._sortRequested=!0}_removeComponent(e){this.system._removeComponent(e),this.components.remove(e),e.tock&&this._tockList.splice(this._tockList.indexOf(e),1),this._sortRequested=!0}_addComponentTag(e,t){this.components.addByTag(e,t),this.system._addComponentTag(e,t)}_removeComponentTag(e,t){this.system._removeComponentTag(e,t),this.components.removeByTag(e,t)}_addRoot(e){this.roots.push(e),this.parent&&this.parent.onAddInnerRoot(e)}_removeRoot(e){this.parent&&this.parent.onRemoveInnerRoot(e),this.roots.splice(this.roots.indexOf(e),1)}}},90199:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(84292),s=n(82942),r=n(97444),o=n(80038);class a extends s.Z{constructor(e,t){super({knownEvents:!1}),this.graph=null,this.components=new r.Z(o.ZP),this._name="",this._tags=new Set,this._isLocked=void 0,this.graph=e,this.id=t}static getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e||a.typeName}get typeName(){return this.constructor.typeName}get displayTypeName(){const e=this.typeName;return"Node"===e?e:e.substr(1)}get isLocked(){return this._isLocked}get text(){return this.constructor.text}get icon(){return this.constructor.icon}get name(){return this._name}get displayName(){return this._name||this.text||this.displayTypeName}set name(e){this._name=e,this.emit({type:"change",what:"name",node:this})}get tags(){return this._tags}addTag(e){this._tags.has(e)||(this._tags.add(e),this.graph._addNodeTag(e,this))}removeTag(e){this._tags.has(e)&&(this._tags.delete(e),this.graph._removeNodeTag(e,this))}get system(){return this.graph.system}getComponent(e,t=!1){return this.components.get(e,t)}getComponents(e){return this.components.getArray(e)}getComponentsByTag(e){return this.components.getByTag(e)}getOrCreateComponent(e){return this.components.get(e,!0)||this.createComponent(e)}hasComponent(e){return this.components.has(e)}getGraphComponent(e,t=!1){return this.graph.components.get(e,t)}getGraphComponents(e){return this.graph.components.getArray(e)}getGraphComponentsByTag(e){return this.graph.components.getByTag(e)}hasGraphComponent(e){return this.graph.components.has(e)}getMainComponent(e,t=!1){return this.graph.system.graph.components.get(e,t)}getMainComponents(e){return this.graph.system.graph.components.getArray(e)}getMainComponentsByTag(e){return this.graph.system.graph.components.getByTag(e)}hasMainComponent(e){return this.graph.system.graph.components.has(e)}getSystemComponent(e,t=!1){return this.graph.system.components.get(e,t)}getSystemComponents(e){return this.graph.system.components.getArray(e)}getSystemComponentsByTag(e){return this.graph.system.components.getByTag(e)}hasSystemComponent(e){return this.graph.system.components.has(e)}getComponentById(e){return this.graph.system.components.getById(e)}getNode(e,t=!1){return this.graph.nodes.get(e,t)}getNodes(e){return this.graph.nodes.getArray(e)}getNodesByTag(e){return this.graph.nodes.getByTag(e)}hasNode(e){return this.graph.nodes.has(e)}getMainNode(e,t=!1){return this.graph.system.graph.nodes.get(e,t)}getMainNodes(e){return this.graph.system.graph.nodes.getArray(e)}getMainNodesByTag(e){return this.graph.system.graph.nodes.getByTag(e)}hasMainNode(e){return this.graph.system.graph.nodes.has(e)}getSystemNode(e,t=!1){return this.graph.system.nodes.get(e,t)}getSystemNodes(e){return this.graph.system.nodes.getArray(e)}getSystemNodesByTag(e){return this.graph.system.nodes.getByTag(e)}hasSystemNode(e){return this.graph.system.nodes.has(e)}getNodeById(e){return this.graph.system.nodes.getById(e)}lock(){if(!1===this._isLocked)throw new Error("can't lock an unlocked node again");this._isLocked=!0}unlock(){this._isLocked=!1}create(){this.graph._addNode(this)}createComponents(){}clear(){this.components.getArray().slice().forEach((e=>e.dispose()))}dispose(){this.components.cloneArray().reverse().forEach((e=>e.dispose())),this.emit({type:"dispose",node:this}),this.graph&&(this.graph._removeNode(this),this.graph=null)}createComponent(e,t,n){if(!0===this._isLocked)throw new Error("node is locked, can't create component");const s=this.system.registry.getType(e);if(!s)throw new Error(`component type '${o.ZP.getTypeName(e)}' not registered`);const r=new s(this,n||(0,i.Z)(12,this.system.components.getDictionary()));return r.create(),t&&(r.name=t),r}is(e){const t=a.getTypeName(e);let n=this;do{if(n=Object.getPrototypeOf(n),n.constructor.typeName===t)return!0}while(n.constructor.typeName!==a.typeName);return!1}toString(e=!1){const t=this.components.getArray(),n=`Node '${this.name}' - ${t.length} components`;return e?n+"\n"+t.map((e=>" "+e.toString())).join("\n"):n}dump(e=""){console.log(e+`%cNode '${this.typeName}' (${this.displayName})`,"color: blue"),this.components.getArray().forEach((t=>t.dump(e+" ")))}toJSON(){const e={},t=[];this._isLocked&&(e.locked=!0);const n=this.components.getArray();for(let e=0,i=n.length;e0&&(e.components=t),e}fromJSON(e){this._isLocked=!!e.locked,e.components&&e.components.forEach((e=>this.componentFromJSON(e)))}componentFromJSON(e){this.createComponent(e.type,e.name,e.id).fromJSON(e)}referencesFromJSON(e){e.components&&e.components.forEach((e=>{this.components.getById(e.id).referencesFromJSON(e)}))}componentToJSON(e){return e.toJSON()}_addComponent(e){if(e.isNodeSingleton&&this.components.has(e))throw new Error(`only one component of type '${e.typeName}' allowed per node`);this.components.add(e),this.graph._addComponent(e)}_removeComponent(e){this.graph._removeComponent(e),this.components.remove(e)}_addComponentTag(e,t){this.components.addByTag(e,t),this.graph._addComponentTag(e,t)}_removeComponentTag(e,t){this.graph._removeComponentTag(e,t),this.components.removeByTag(e,t)}}a.typeName="Node",a.text="",a.icon=""},31181:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p,V5:()=>u.V5});var i=n(82942);const s=[function(e){return e},function(e,t){for(let n=0,i=t.length;n=0)throw new Error("non-array source property; can't link to element");if(1===t.elementCount&&i>=0)throw new Error("non-array destination property; can't link to element");this.source=e,this.destination=t,this.sourceIndex=n,this.destinationIndex=i;const s=void 0===n?-1:n,r=void 0===i?-1:i,o=e.elementCount>1&&s<0&&r<0;this.fnConvert=function(e,t,n){const i=n?1:0;return l[e][t][i]}(e.type,t.type,o);const a=function(e,t,n){return-1===e&&-1===t?n:e<=3&&t<=3?h[e+1][t+1]:function(n,i,s){return i[t]=s(n[e]),i}}(s,r,this.fnConvert);var c,d,u;this.fnCopy=(c=e.isMulti(),d=t.isMulti(),u=a,!1===c?!1===d?u:function(e,t,n){for(let n=0,i=t.length;n0&&(t=u(e[0],t)),t}:function(e,t,n){for(let n=0,i=e.length,s=t.length;n=0&&this.setValue(i,t,n)}copyValue(e,t){Array.isArray(e)&&(e=e.slice()),this.setValue(e,t)}set(e){e||(this.changed=!0,this.isInput()&&(this._group.linkable.changed=!0)),this.emit("value",this.value);const t=this.outLinks;for(let e=0,n=t.length;ei.source===e&&i.sourceIndex===t&&i.destinationIndex===n));return!!i&&(e.removeOutLink(i),this.removeInLink(i),!0)}unlink(){this.inLinks.slice().forEach((e=>{e.source.removeOutLink(e),this.removeInLink(e)}));if(this.outLinks.slice().forEach((e=>{this.removeOutLink(e),e.destination.removeInLink(e)})),0!==this.inLinks.length||0!==this.outLinks.length)throw new Error("fatal: leftover links")}addInLink(e){if(e.destination!==this)throw new Error("input link's destination must equal this");this.inLinks.push(e),this.requestSort(),this.emit({type:"link",add:!0,remove:!1,link:e})}addOutLink(e){if(e.source!==this)throw new Error("output link's source must equal this");this.outLinks.push(e),this.requestSort(),e.push()}removeInLink(e){const t=this.inLinks.indexOf(e);if(t<0)throw new Error("input link not found");this.inLinks.splice(t,1),this.requestSort(),0===this.inLinks.length&&"object"===this.type&&this.reset(),this.emit({type:"link",add:!1,remove:!0,link:e})}removeOutLink(e){const t=this.outLinks.indexOf(e);if(t<0)throw new Error("output link not found");this.outLinks.splice(t,1),this.requestSort()}canLinkTo(e,t,n){return e.canLinkFrom(this,t,n)}canLinkFrom(e,t,n){if(this.isOutput())return!1;const i=t>=0,s=n>=0;if(!e.isArray()&&i)throw new Error("non-array source property; can't link to element");if(!this.isArray()&&s)throw new Error("non-array destination property; can't link to element");const r=e.isArray()&&!i;return r===(this.isArray()&&!s)&&((!r||e.elementCount===this.elementCount)&&(!("object"===e.type&&"object"===this.type&&!function(e,t){if(!e||!t)return!1;let n=e.prototype;for(;n;){if(n===t.prototype)return!0;n=n.prototype}return!1}(e.schema.objectType,this.schema.objectType))&&(o=e.type,a=this.type,c[o][a])));var o,a}reset(){let e;if(this.isMulti()){let t=this.value;t?t.length=1:e=t=[],t[0]=this.clonePreset()}else e=this.clonePreset();this.setValue(e)}setMultiChannelCount(e){if(!this.isMulti())throw new Error("can't set multi channel count on non-multi property");const t=this.value,n=t.length;t.length=e;for(let i=n;i=e.length?0:t]||""}}isInput(){return this._group&&this._group===this._group.linkable.ins}isOutput(){return this._group&&this._group===this._group.linkable.outs}isArray(){return Array.isArray(this.schema.preset)}isMulti(){return!!this.schema.multi}isDefault(){const e=this.schema.multi?this.value[0]:this.value,t=this.schema.preset,n=Array.isArray(e)?e.length:-1;if(n!==(Array.isArray(t)?t.length:-1))return!1;if(n>=0){for(let i=0;i0||this.outLinks.length>0}hasInLinks(e){const t=this.inLinks;if(!(e>=0))return t.length>0;for(let n=0,i=t.length;n=0))return!0;return!1}hasOutLinks(e){const t=this.outLinks;if(!(e>=0))return t.length>0;for(let n=0,i=t.length;n0&&(e=e||{},e.links=this.outLinks.map((e=>{const t={id:e.destination._group.linkable.id,key:e.destination.key};return e.sourceIndex>=0&&(t.srcIndex=e.sourceIndex),e.destinationIndex>=0&&(t.dstIndex=e.destinationIndex),t}))),e}fromJSON(e,t){void 0!==e.value&&(this.value=e.value),void 0!==e.links&&e.links.forEach((e=>{t[e.id].ins[e.key].linkFrom(this,e.srcIndex,e.dstIndex)}))}toString(){const e=this.schema,t=e.event?"event":e.options?"enum":this.type;return`${this.path} [${t}]`}dump(e=""){console.log(e+`Property '${this.path}', key: ${this.key}, value: ${this.value}`)}validateValue(e){const t=this.schema;if(t.enum){const n=Math.trunc(e);return t.enum[n]?n:0}if(t.options){const n=Math.trunc(e);return n<0||n>=t.options.length?0:n}return"number"===this.type?(e=t.min?Math.max(t.min,e):e,e=t.max?Math.min(t.max,e):e):e}clonePreset(){const e=this.schema.preset;return Array.isArray(e)?e.slice():e}}},56166:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(82942),s=n(97444),r=n(26041),o=n(80038),a=n(90199),l=n(83275);class c extends i.Z{constructor(e){super({knownEvents:!1}),this.nodes=new s.Z(a.Z),this.components=new s.Z(o.ZP),this.registry=e||new r.Z,this.graph=new l.Z(this,null),this.graph.activate()}getComponent(e,t=!1){return this.components.get(e,t)}getComponents(e){return this.components.getArray(e)}getComponentsByTag(e){return this.components.getByTag(e)}hasComponents(e){return this.components.has(e)}getMainComponent(e,t=!1){return this.graph.components.get(e,t)}getMainComponents(e){return this.graph.components.getArray(e)}getMainComponentsByTag(e){return this.graph.components.getByTag(e)}hasMainComponents(e){return this.graph.components.has(e)}getNode(e,t=!1){return this.nodes.get(e,t)}getNodes(e){return this.nodes.getArray(e)}getNodesByTag(e){return this.nodes.getByTag(e)}hasNodes(e){return this.nodes.has(e)}getMainNode(e,t=!1){return this.graph.nodes.get(e,t)}getMainNodes(e){return this.graph.nodes.getArray(e)}getMainNodesByTag(e){return this.graph.nodes.getByTag(e)}hasMainNodes(e){return this.graph.nodes.has(e)}findNodeByName(e,t){const n=this.nodes.getArray(t);for(let t=0,i=n.length;te.toString(!0))).join("\n"):i}_addNode(e){this.nodes.add(e)}_removeNode(e){this.nodes.remove(e)}_addNodeTag(e,t){this.nodes.addByTag(e,t)}_removeNodeTag(e,t){this.nodes.removeByTag(e,t)}_addComponent(e){if(e.isSystemSingleton&&this.components.has(e))throw new Error(`only one component of type '${e.typeName}' allowed per system`);this.components.add(e)}_removeComponent(e){this.components.remove(e)}_addComponentTag(e,t){this.components.addByTag(e,t)}_removeComponentTag(e,t){this.components.removeByTag(e,t)}}},63833:(e,t,n)=>{"use strict";n.d(t,{$:()=>i,Z:()=>a});var i,s=n(80038),r=n(90199),o=n(67171);!function(e){e[e.Node=0]="Node",e[e.Graph=1]="Graph",e[e.Main=2]="Main",e[e.System=3]="System"}(i||(i={}));class a extends s.ZP{constructor(){super(...arguments),this._scope=i.Node,this._scopedNode=null,this._scopedGraph=null,this._activeComponent=null}get componentType(){return this.constructor.componentType}get followComponentSelection(){return this.constructor.followComponentSelection}get followNodeSelection(){return this.constructor.followNodeSelection}get retainSelection(){return this.constructor.retainSelection}get scope(){return this._scope}set scope(e){this._scope=e,this._activeComponent&&!this.isComponentInScope(this._activeComponent)&&(this.activeComponent=null)}get scopedNode(){return this._scopedNode}set scopedNode(e){e!==this._scopedNode&&(this._scopedNode=e,this._activeComponent&&!this.isComponentInScope(this._activeComponent)&&(this.activeComponent=null),this.onScopedComponents(),this.emit({type:"scoped-components"}))}get scopedGraph(){return this._scopedGraph}set scopedGraph(e){e!==this._scopedGraph&&(this._scopedGraph=e,this._activeComponent&&!this.isComponentInScope(this._activeComponent)&&(this.activeComponent=null),this.onScopedComponents(),this.emit({type:"scoped-components"}))}get scopedComponents(){switch(this._scope){case i.Node:return(this._scopedNode||this.node).getComponents(this.componentType);case i.Graph:return(this._scopedGraph?this._scopedGraph.innerGraph:this.graph).getComponents(this.componentType);case i.Main:return this.getMainComponents(this.componentType);case i.System:return this.getSystemComponents(this.componentType)}}get activeComponent(){return this._activeComponent}set activeComponent(e){const t=this.activeComponent;if(e!==t){if(t&&this.deactivateComponent(t),e){if(!this.isComponentInScope(e))throw new Error("can't activate, component out of scope");this.activateComponent(e)}this._activeComponent=e,this.onActiveComponent(t,e),this.emit({type:"active-component",previous:t,next:e})}}get selection(){return this.getSystemComponent(o.Z)}create(){super.create(),this.system.components.on(s.ZP,this.onComponent,this),this.followComponentSelection&&this.selection.selectedComponents.on(this.componentType,this.onSelectComponent,this),this.followNodeSelection&&this.selection.selectedNodes.on(r.Z,this.onSelectNode,this)}dispose(){this.activeComponent&&(this.activeComponent=null),this.system.components.off(s.ZP,this.onComponent,this),this.followComponentSelection&&this.selection.selectedComponents.off(this.componentType,this.onSelectComponent,this),this.followNodeSelection&&this.selection.selectedNodes.off(r.Z,this.onSelectNode,this),super.dispose()}activateComponent(e){}deactivateComponent(e){}onActiveComponent(e,t){}onScopedComponents(){}onComponent(e){e.remove&&e.object===this.activeComponent&&(this.activeComponent=null),this.isComponentInScope(e.object)&&(this.onScopedComponents(),this.emit({type:"scoped-components"}))}onSelectComponent(e){const t=e.object;this.isComponentInScope(t)&&(e.add?this.activeComponent=t:e.remove&&!this.retainSelection&&t===this.activeComponent&&(this.activeComponent=null))}onSelectNode(e){const t=e.object;if(this.isNodeInScope(t)){const n=t.getComponent(this.componentType);n&&this.onSelectComponent({type:n.typeName,object:n,add:e.add,remove:e.remove})}}isComponentInScope(e){if(!e.is(this.componentType))return!1;switch(this._scope){case i.Node:const t=this._scopedNode||this.node;return e.node===t;case i.Graph:const n=this._scopedGraph?this._scopedGraph.innerGraph:this.graph;return e.graph===n;case i.Main:return e.graph===this.system.graph;case i.System:return!0}return!1}isNodeInScope(e){switch(this._scope){case i.Node:return e===(this._scopedNode||this.node);case i.Graph:const t=this._scopedGraph?this._scopedGraph.innerGraph:this.graph;return e.graph===t;case i.Main:return e.graph===this.system.graph;case i.System:return!0}}}a.typeName="CComponentProvider",a.componentType=s.ZP,a.followComponentSelection=!0,a.followNodeSelection=!1,a.retainSelection=!0},18894:(e,t,n)=>{"use strict";n.d(t,{V5:()=>i.V5,ZP:()=>r});var i=n(80038),s=n(83275);n(90199);class r extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(r.graphIns),this._innerGraph=null,this._innerRoot=null,this._innerGraph=new s.Z(this.system,this)}get innerGraph(){return this._innerGraph}get innerNodes(){return this._innerGraph.nodes}get innerComponents(){return this._innerGraph.components}get innerRoots(){return this._innerGraph.roots}getInnerComponent(e,t=!1){return this._innerGraph.components.get(e,t)}getInnerComponents(e){return this._innerGraph.components.getArray(e)}hasInnerComponent(e){return this._innerGraph.components.has(e)}getInnerNode(e,t=!1){return this._innerGraph.nodes.get(e,t)}getInnerNodes(e){return this._innerGraph.nodes.getArray(e)}hasInnerNode(e){return this._innerGraph.nodes.has(e)}isEmpty(){return 0===this._innerGraph.nodes.count()}update(e){const t=this.ins;if(t.active.changed){const e=t.active.value;e!==this._innerGraph.isActive&&(e?this.activateInnerGraph():this.deactivateInnerGraph())}return!0}tick(e){return this._innerGraph.tick(e)}tock(e){return this._innerGraph.tock(e)}dispose(){this._innerGraph.clear(),this._innerGraph=null,this._innerRoot=null,super.dispose()}clearInnerGraph(){this._innerGraph.clear()}fromJSON(e){super.fromJSON(e),this._innerGraph.clear(),this._innerGraph.fromJSON(e.graph)}toJSON(){const e=super.toJSON();return e.graph=this._innerGraph.toJSON(),e}dump(e=""){super.dump(e),this.innerGraph.dump(e+" ")}onAddInnerRoot(e){}onRemoveInnerRoot(e){}activateInnerGraph(){this._innerGraph.activate()}deactivateInnerGraph(){this._innerGraph.deactivate()}}r.typeName="CGraph",r.graphIns={active:i.V5.Boolean("Graph.Active",!0)}},3474:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(80038),s=(n(90199),n(18894));const r=(e,t,n)=>{let i;const s=e.children;for(let e=0,n=s.length;e{let i;const s=e.children;for(let e=0,n=s.length;e{let i=[];const s=e.children;for(let e=0,n=s.length;ee.node.dispose())),this._parent&&this._parent.removeChild(this),this.graph._removeRoot(this),super.dispose()}getRootComponent(e){let t=this;for(;t._parent;)t=t._parent;return t?t.node.components.get(e):null}getParentComponent(e,t){let n=this;for(;;){if(n=n._parent,!n){const e=this.graph.parent;n=e?e.components.get(l):void 0}if(!n)return;const i=n.node.components.get(e,!0);if(i)return i;if(!t)return}}getParentNode(e,t){let n=this;for(;;){if(n=n._parent,!n){const e=this.graph.parent;n=e?e.components.get(l):void 0}if(!n)return;const i=n.node;if(i.is(e))return i;if(!t)return}}getSiblingNode(e){return this.getSiblingNodes(e)[0]}getSiblingNodes(e){const t=this._parent;return this.graph.nodes.getArray(e).filter((e=>{const n=e.components.get(l);return(n?n._parent:null)==t}))}hasChildComponents(e,t){return r(this,e,t)}getChildComponent(e,t){return o(this,e,t)}getChildComponents(e,t){return a(this,e,t)}traverseUp(e,t,n,i){if(e)if(t){const e=this.node.components.getArray();for(let t=0,n=e.length;t(e.emit(n),n.stopPropagation)))}propagateDown(e,t,n){this.traverseDown(!0,e,t,(e=>(e.emit(n),n.stopPropagation)))}addChild(e){if(e===this)throw new Error("can't add self as child");if(e._parent)throw new Error("can't add child, component has a parent");if(e.graph!==this.graph)throw new Error("can't add child, component in different graph");e._parent=this,this._children.push(e),this.graph._removeRoot(e);const t={type:"hierarchy",add:!0,remove:!1,parent:this,child:e};this.traverseUp(!0,!1,!0,(e=>e.emit(t))),this.traverseDown(!1,!1,!0,(e=>e.emit(t))),this.system.emit(t)}removeChild(e){if(e._parent!==this)throw new Error("component not a child of this");const t={type:"hierarchy",add:!1,remove:!0,parent:this,child:e};this.traverseUp(!0,!1,!0,(e=>e.emit(t))),this.traverseDown(!1,!1,!0,(e=>e.emit(t))),this.system.emit(t);const n=this._children.indexOf(e);this._children.splice(n,1),e._parent=null,this.graph._addRoot(e)}onComponent(e){if(e.object===this)return;const t={type:"child",add:e.add,remove:e.remove,component:e.object};this.traverseUp(!0,!1,!0,(e=>e.emit(t)))}toJSON(){const e=super.toJSON();return this._children.length>0&&(e.children=this._children.map((e=>e.id))),e}referencesFromJSON(e){super.referencesFromJSON(e);const t=this.system.components.getDictionary();e.children&&e.children.forEach((e=>{const n=t[e];this.addChild(n)}))}toString(){return super.toString()+` - children: ${this.children.length}`}dump(e=""){super.dump(e),this.children.length>0&&(console.log(e+"%cChildren","color: purple"),this.children.forEach((t=>t.node.dump(e+" "))))}}l.typeName="CHierarchy"},92989:(e,t,n)=>{"use strict";n.d(t,{F:()=>i,Z:()=>a});var i,s=n(80038),r=n(90199),o=n(67171);!function(e){e[e.Graph=0]="Graph",e[e.Main=1]="Main",e[e.System=2]="System"}(i||(i={}));class a extends s.ZP{constructor(){super(...arguments),this._scope=i.Graph,this._scopedGraph=null,this._activeNode=null}get nodeType(){return this.constructor.nodeType}get followNodeSelection(){return this.constructor.followNodeSelection}get followComponentSelection(){return this.constructor.followComponentSelection}get retainSelection(){return this.constructor.retainSelection}get scope(){return this._scope}set scope(e){this._scope=e,this._activeNode&&!this.isNodeInScope(this._activeNode)&&(this.activeNode=null)}get scopedGraph(){return this._scopedGraph}set scopedGraph(e){e!==this._scopedGraph&&(this._scopedGraph=e,this._activeNode&&!this.isNodeInScope(this._activeNode)&&(this.activeNode=null),this.onScopedNodes(),this.emit({type:"scoped-nodes"}))}get scopedNodes(){switch(this._scope){case i.Graph:return(this._scopedGraph?this._scopedGraph.innerGraph:this.graph).getNodes(this.nodeType);case i.Main:return this.getMainNodes(this.nodeType);case i.System:return this.getSystemNodes(this.nodeType)}}get activeNode(){return this._activeNode}set activeNode(e){const t=this.activeNode;if(e!==t){if(t&&this.deactivateNode(t),e){if(!this.isNodeInScope(e))throw new Error("can't activate, node out of scope");this.activateNode(e)}this._activeNode=e,this.onActiveNode(t,e),this.emit({type:"active-node",previous:t,next:e})}}get selection(){return this.getSystemComponent(o.Z)}create(){super.create(),this.system.nodes.on(r.Z,this.onNode,this),this.followNodeSelection&&this.selection.selectedNodes.on(this.nodeType,this.onSelectNode,this),this.followComponentSelection&&this.selection.selectedComponents.on(s.ZP,this.onSelectComponent,this)}dispose(){this.activeNode&&(this.activeNode=null),this.system.nodes.off(r.Z,this.onNode,this),this.followNodeSelection&&this.selection.selectedNodes.off(this.nodeType,this.onSelectNode,this),this.followComponentSelection&&this.selection.selectedComponents.off(s.ZP,this.onSelectComponent,this),super.dispose()}activateNode(e){}deactivateNode(e){}onActiveNode(e,t){}onScopedNodes(){}onNode(e){e.remove&&e.object===this.activeNode&&(this.activeNode=null),this.isNodeInScope(e.object)&&(this.onScopedNodes(),this.emit({type:"scoped-nodes"}))}onSelectNode(e){const t=e.object;this.isNodeInScope(t)&&(e.add?this.activeNode=t:e.remove&&!this.retainSelection&&t===this.activeNode&&(this.activeNode=null))}onSelectComponent(e){const t=e.object.node;t.is(this.nodeType)&&this.onSelectNode({type:t.typeName,object:t,add:e.add,remove:e.remove})}isNodeInScope(e){if(!e.is(this.nodeType))return!1;switch(this._scope){case i.Graph:const t=this._scopedGraph?this._scopedGraph.innerGraph:this.graph;return e.graph===t;case i.Main:return e.graph===this.system.graph;case i.System:return!0}return!1}}a.typeName="CNodeProvider",a.nodeType=r.Z,a.followNodeSelection=!0,a.followComponentSelection=!1,a.retainSelection=!0},26220:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s extends i.ZP{constructor(e,t){super(e,t),this.outs=this.addOutputs(s.pulseOuts),this._tockUpdated=!1,this.addEvent("pulse"),this.onAnimationFrame=this.onAnimationFrame.bind(this),this.context={time:new Date,secondsElapsed:0,secondsDelta:0,frameNumber:0},this._secondsStarted=.001*Date.now(),this._secondsStopped=this._secondsStarted,this._animHandler=0,this._pulseEvent={type:"pulse",context:this.context,systemUpdated:!1}}start(){0===this._animHandler&&(this._secondsStopped>0&&(this._secondsStarted+=.001*Date.now()-this._secondsStopped,this._secondsStopped=0),this._animHandler=window.requestAnimationFrame(this.onAnimationFrame))}stop(){0!==this._animHandler&&(0===this._secondsStopped&&(this._secondsStopped=.001*Date.now()),window.cancelAnimationFrame(this._animHandler),this._animHandler=0)}pulse(e){const{outs:t,context:n,_pulseEvent:i}=this;n.time.setTime(e);const s=.001*e-this._secondsStarted;n.secondsDelta=s-n.secondsElapsed,n.secondsElapsed=s,n.frameNumber++,t.time.setValue(n.secondsElapsed),t.frame.setValue(n.frameNumber);const r=this.system.graph.tick(n);i.systemUpdated=r||this._tockUpdated,this.emit(i),this._tockUpdated=this.system.graph.tock(n)}onAnimationFrame(){this.pulse(Date.now()),this._animHandler=window.requestAnimationFrame(this.onAnimationFrame)}}s.typeName="CPulse",s.isSystemSingleton=!0,s.pulseOuts={time:i.V5.Number("Pulse.Time"),frame:i.V5.Integer("Pulse.Frame")}},67171:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(97444),s=n(89809),r=n(80038),o=n(90199),a=n(18894);n(96561);class l extends r.ZP{createActions(e){return{}}}l.typeName="CController",l.isSystemSingleton=!0;class c extends l{constructor(e,t){super(e,t),this.outs=this.addOutputs(c.selOuts),this.multiSelect=!1,this.exclusiveSelect=!0,this.selectedNodes=new i.Z(o.Z),this.selectedComponents=new i.Z(r.ZP),this._activeGraph=null,this.addEvents("select-node","select-component","active-graph","update"),this.selectedNodes.on(o.Z,(e=>this.onSelectNode(e.object,e.add))),this.selectedComponents.on(r.ZP,(e=>this.onSelectComponent(e.object,e.add))),this._activeGraph=this.system.graph}getSelectedNode(e){return this.selectedNodes.get(e,!0)}getSelectedNodes(e){return this.selectedNodes.getArray(e)}getSelectedComponent(e){return this.selectedComponents.get(e,!0)}getSelectedComponents(e){return this.selectedComponents.getArray(e)}get activeGraph(){return this._activeGraph}set activeGraph(e){if(e!==this.activeGraph){this.clearSelection();const t=this._activeGraph;this._activeGraph=e,this.onActiveGraph(e),this.emit({type:"active-graph",previous:t,next:e})}}hasParentGraph(){return this._activeGraph&&this._activeGraph.parent}activateParentGraph(){this._activeGraph&&this._activeGraph.parent.graph&&(this.activeGraph=this._activeGraph.parent.graph)}hasChildGraph(){return this.selectedComponents.has(a.ZP)}activateChildGraph(){const e=this.selectedComponents.get(a.ZP,!0);e&&(this.activeGraph=e.innerGraph)}create(){super.create(),this.system.nodes.on(o.Z,this.onSystemNode,this),this.system.components.on(r.ZP,this.onSystemComponent,this)}dispose(){this.system.nodes.off(o.Z,this.onSystemNode,this),this.system.components.off(r.ZP,this.onSystemComponent,this),super.dispose()}createActions(e){return{selectNode:e.register({name:"Select Node",do:this.selectNode,target:this}),selectComponent:e.register({name:"Select Component",do:this.selectComponent,target:this}),clearSelection:e.register({name:"Clear Selection",do:this.clearSelection,target:this})}}nodeContainsSelectedComponent(e){const t=e.components.getArray();for(let e=0,n=t.length;e{"use strict";n.d(t,{P:()=>r,Z:()=>c});const i=Math.PI,s=.5*i;var r;!function(e){e[e.Linear=0]="Linear",e[e.EaseQuad=1]="EaseQuad",e[e.EaseInQuad=2]="EaseInQuad",e[e.EaseOutQuad=3]="EaseOutQuad",e[e.EaseCubic=4]="EaseCubic",e[e.EaseInCubic=5]="EaseInCubic",e[e.EaseOutCubic=6]="EaseOutCubic",e[e.EaseQuart=7]="EaseQuart",e[e.EaseInQuart=8]="EaseInQuart",e[e.EaseOutQuart=9]="EaseOutQuart",e[e.EaseQuint=10]="EaseQuint",e[e.EaseInQuint=11]="EaseInQuint",e[e.EaseOutQuint=12]="EaseOutQuint",e[e.EaseSine=13]="EaseSine",e[e.EaseInSine=14]="EaseInSine",e[e.EaseOutSine=15]="EaseOutSine"}(r||(r={}));const o={Linear:function(e){return e},EaseQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},EaseInQuad:function(e){return e*e},EaseOutQuad:function(e){return e*(2-e)},EaseCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},EaseInCubic:function(e){return e*e*e},EaseOutCubic:function(e){return--e*e*e+1},EaseQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},EaseInQuart:function(e){return e*e*e*e},EaseOutQuart:function(e){return 1- --e*e*e*e},EaseQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},EaseInQuint:function(e){return e*e*e*e*e},EaseOutQuint:function(e){return 1+--e*e*e*e*e},EaseSine:function(e){return-.5*(Math.cos(e*i)-1)},EaseInSine:function(e){return 1-Math.cos(e*s)},EaseOutSine:function(e){return Math.sin(e*s)}};var a=n(80038),l=n(84292);class c extends a.ZP{constructor(){super(...arguments),this.ins=this.addInputs(c.ins),this.outs=this.addOutputs(c.outs),this.targets=[],this.states={},this._currentValues=null,this._targetState=null,this._startTime=0,this._easingFunction=null}getState(e){return this.states[e]}setState(e){return e.id=e.id||(0,l.Z)(6),this.states[e.id]=e,e.id}deleteState(e){delete this.states[e]}clear(){this.targets.forEach((e=>e.property.off("dispose",this.onPropertyDispose,this))),this.targets.length=0,this.states={},this._currentValues=null,this._targetState=null,this._startTime=0,this._easingFunction=null}dispose(){this.clear(),super.dispose()}tweenTo(e,t){const n=this.states[e],i=this.outs;if(n)return this._targetState=n,this._currentValues=this.getCurrentValues(),this._startTime=t,this._easingFunction=(s=n.curve,o[r[s]]),i.switched.setValue(!1),i.tweening.setValue(!0),i.start.set(),!0;var s}update(e){const t=this.ins,n=this.states,i=t.id.value,s=n[i];if(s){if((t.tween.changed||t.recall.changed)&&(t.curve.setValue(s.curve),t.duration.setValue(s.duration),t.threshold.setValue(s.threshold)),t.tween.changed)return this.tweenTo(i,e.secondsElapsed),!0;if(t.recall.changed)return this.setValues(s.values),!0;(t.curve.changed||t.duration.changed||t.threshold.changed)&&(s.curve=t.curve.value,s.duration=t.duration.value,s.threshold=t.threshold.value),t.store.changed&&(s.values=this.getCurrentValues()),t.delete.changed&&delete n[i]}else if(i&&t.store.changed){const e={id:this.ins.id.value,curve:this.ins.curve.getValidatedValue(),duration:this.ins.duration.value,threshold:this.ins.threshold.value,values:this.getCurrentValues()};n[e.id]=e}return!0}tick(e){const t=this._targetState;if(!t)return!1;const n=this.outs,i=this._currentValues,s=this._startTime,r=e.secondsElapsed-s,o=r/t.duration;if(o<1){const e=this._easingFunction(o),s=o>=t.threshold&&!n.switched.value;this.setValues(i,t.values,e,s),n.time.setValue(r),n.completed.setValue(o),s&&(n.switched.setValue(!0),n.switch.set())}else this.setValues(i,t.values,1,!n.switched.value),n.tweening.setValue(!1),n.time.setValue(t.duration),n.completed.setValue(1),n.end.set(),n.switched.value||n.switched.setValue(!0),this._currentValues=null,this._targetState=null,this._startTime=0,this._easingFunction=null;return!0}addTargetProperty(e){if("object"===e.type||e.schema.event)throw new Error("can't add object or event properties");if(this.getTarget(e))throw new Error("can't add, target already exists");e.on("dispose",this.onPropertyDispose,this);const t="number"===e.type&&!e.schema.options,n=e.isArray();this.targets.push({property:e,isNumber:t,isArray:n});const i=this.states,s=Object.keys(i);for(let t=0,n=s.length;t{const t=this.getProperty(e.id,e.key);return{property:t,isNumber:!!t&&"number"===t.type&&!t.schema.options,isArray:!!t&&t.isArray()}}))),e.states&&e.states.forEach((e=>this.states[e.id]=e)),this._startTime=0}toJSON(){const e=super.toJSON(),t=this.stateToJSON();return t&&(e.state=t),e}stateToJSON(){const e={},t=this.targets;t.length>0&&(e.targets=t.map((e=>({id:e.property.group.linkable.id,key:e.property.key}))));const n=Object.keys(this.states);return n.length>0&&(e.states=n.map((e=>this.states[e]))),e}getTargetProperties(){return this.targets.map((e=>e.property))}onPropertyDispose(e){e.property.off("dispose",this.onPropertyDispose,this);const t=this.getTarget(e.property);this.removeTarget(t)}removeTarget(e){const t=this.targets.indexOf(e);this.targets.splice(t,1),this.removeChannel(t)}removeChannel(e){const t=this.states,n=Object.keys(t);for(let i=0,s=n.length;it.property===e))}getProperty(e,t){const n=this.system.components.getById(e);return n?n.ins[t]:null}setValues(e,t,n,i){const s=this.targets;for(let r=0,o=s.length;r{"use strict";n.d(t,{V5:()=>l});var i=n(82507);const s={xyzw:["X","Y","Z","W"],rgba:["R","G","B","A"]},r=function(e){return void 0===e||"object"==typeof e&&!Array.isArray(e)?e:{preset:e}},o=function(e,t,n){return{path:t,schema:(n=r(n))?Object.assign({},e,n):e}},a={Number:{preset:0},Integer:{preset:0,step:1,speed:.34,precision:0},Natural:{preset:0,step:1,speed:.34,precision:0,min:0},Unit:{preset:0,min:0,max:1,bar:!0},Percent:{preset:0,min:0,max:1,bar:!0,percent:!0},Vector2:{preset:[0,0]},Vector3:{preset:[0,0,0]},Vector4:{preset:[0,0,0,0]},Matrix2:{preset:[1,0,0,1]},Matrix3:{preset:[1,0,0,0,1,0,0,0,1]},Matrix4:{preset:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Scale:{preset:1},Scale2:{preset:[1,1]},Scale3:{preset:[1,1,1]},IntVec2:{preset:[0,0],step:1,speed:.34,precision:0},IntVec3:{preset:[0,0,0],step:1,speed:.34,precision:0},ColorRGB:{preset:[1,1,1],semantic:"color",labels:s.rgba,min:0,max:1,bar:!0},ColorRGBA:{preset:[1,1,1,1],semantic:"color",labels:s.rgba,min:0,max:1,bar:!0},Boolean:{preset:!1},String:{preset:""},AssetPath:{preset:"",semantic:"asset-path"},Object:{preset:null,objectType:Object},Event:{preset:0,event:!0}},l={Property:(e,t)=>o(void 0,e,t),Number:(e,t)=>o(a.Number,e,t),Integer:(e,t)=>o(a.Integer,e,t),Natural:(e,t)=>o(a.Natural,e,t),Unit:(e,t)=>o(a.Unit,e,t),Percent:(e,t)=>o(a.Percent,e,t),Vector2:(e,t)=>o(a.Vector2,e,t),Vector3:(e,t)=>o(a.Vector3,e,t),Vector4:(e,t)=>o(a.Vector4,e,t),IntVec2:(e,t)=>o(a.IntVec2,e,t),IntVec3:(e,t)=>o(a.IntVec3,e,t),Matrix2:(e,t)=>o(a.Matrix2,e,t),Matrix3:(e,t)=>o(a.Matrix3,e,t),Matrix4:(e,t)=>o(a.Matrix4,e,t),Scale:(e,t)=>o(a.Scale,e,t),Scale2:(e,t)=>o(a.Scale2,e,t),Scale3:(e,t)=>o(a.Scale3,e,t),ColorRGB:(e,t)=>o(a.ColorRGB,e,t),ColorRGBA:(e,t)=>o(a.ColorRGBA,e,t),Boolean:(e,t)=>o(a.Boolean,e,t),String:(e,t)=>o(a.String,e,t),AssetPath:(e,t)=>o(a.AssetPath,e,t),Enum:(e,t,n)=>function(e,t,n){n=r(n);const s={enum:e,options:(0,i.q)(e),preset:0};return{path:t,schema:n?Object.assign({},s,n):s}}(t,e,n),Option:(e,t,n)=>function(e,t,n){const i={options:e,preset:0};return{path:t,schema:(n=r(n))?Object.assign({},i,n):i}}(t,e,n),Object:(e,t,n)=>function(e,t,n){const i={preset:null,objectType:e};return{path:t,schema:(n=r(n))?Object.assign({},i,n):i}}(t,e,n),Event:(e,t)=>o(a.Event,e,t)}},87156:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o,t:()=>i});var i,s=n(26775),r=n(73130);!function(e){e[e.Single=0]="Single",e[e.HorizontalSplit=1]="HorizontalSplit",e[e.VerticalSplit=2]="VerticalSplit",e[e.Quad=3]="Quad"}(i||(i={}));class o extends r.Z{constructor(e,t,n){super(e,t,n),this._layout=i.Quad,this._horizontalSplit=.5,this._verticalSplit=.5,this.addEvent("layout"),this.layout=i.Single}set layout(e){if(e===this._layout)return;this._layout=e;const t=this.viewports;switch(this._layout){case i.Single:this.setViewportCount(1);break;case i.HorizontalSplit:case i.VerticalSplit:this.setViewportCount(2);break;case i.Quad:this.setViewportCount(4)}this.updateSplitPositions(),t[1]&&(t[1].setBuiltInCamera(s.mP.Orthographic,s.LY.Top),t[1].enableCameraControl(!0).orientationEnabled=!1),t[2]&&(t[2].setBuiltInCamera(s.mP.Orthographic,s.LY.Left),t[2].enableCameraControl(!0).orientationEnabled=!1),t[3]&&(t[3].setBuiltInCamera(s.mP.Orthographic,s.LY.Front),t[3].enableCameraControl(!0).orientationEnabled=!1),this.emit({type:"layout",layout:e})}get layout(){return this._layout}set horizontalSplit(e){this._horizontalSplit=e,this.updateSplitPositions()}get horizontalSplit(){return this._horizontalSplit}set verticalSplit(e){this._verticalSplit=e,this.updateSplitPositions()}get verticalSplit(){return this._verticalSplit}updateSplitPositions(){const e=this._horizontalSplit,t=this._verticalSplit;switch(this._layout){case i.Single:this.viewports[0].setSize(0,0,1,1);break;case i.HorizontalSplit:this.viewports[0].setSize(0,0,e,1),this.viewports[1].setSize(e,0,1-e,1);break;case i.VerticalSplit:this.viewports[0].setSize(0,1-t,1,t),this.viewports[1].setSize(0,0,1,1-t);break;case i.Quad:this.viewports[0].setSize(0,1-t,e,t),this.viewports[1].setSize(e,1-t,1-e,t),this.viewports[2].setSize(0,0,e,1-t),this.viewports[3].setSize(e,0,1-e,1-t)}}}},73130:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var i=n(64702),s=n(7177),r=n(75544),o=n(82942),a=n(3474),l=n(73902),c=n(12197),h=n(26060),d=n(15271),u=n(26775);class p extends o.Z{constructor(e,t,n){super(),this.viewports=[],this.rendererComponent=null,this.targetViewport=null,this.targetObject3D=null,this.targetComponent=null,this.targetScene=null,this.targetCamera=null,this.defaultScene=new i.x,this.defaultCamera=new u.ZP,this.system=e,this.canvas=t,this.overlay=n,this.renderer=new s.C({canvas:t,antialias:!0}),this.renderer.autoClear=!1,this.renderer.outputColorSpace=r.KI_,this.picker=new h.Z(this.renderer)}dispose(){this.renderer.dispose(),this.viewports.forEach((e=>e.dispose()))}get canvasWidth(){return this.canvas.width}get canvasHeight(){return this.canvas.height}attach(){const e=this.canvasWidth,t=this.canvasHeight;this.viewports.forEach((n=>n.setCanvasSize(e,t))),this.renderer.setSize(e,t,!1),this.rendererComponent=this.system.getComponent(d.Z,!0),this.rendererComponent.attachView(this)}detach(){this.rendererComponent=this.system.getComponent(d.Z,!0),this.rendererComponent.detachView(this),this.rendererComponent=null}renderImage(e,t,n,i){const s=this.canvas.width,r=this.canvas.height;this.setRenderSize(e,t),this.render();const o=this.canvas.toDataURL(n,i);return this.setRenderSize(s,r),o}render(){const e=this.rendererComponent.activeSceneComponent;if(!e)return;let t=e.scene,n=e.activeCamera;t&&n||(t=this.defaultScene,n=this.defaultCamera);const i=this.renderer;i.clear(),i.__view=this;const s=this.viewports;for(let e=0,r=s.length;en.setCanvasSize(e,t))),this.renderer.xr.isPresenting||this.renderer.setSize(e,t,!1)}resize(){this.setRenderSize(this.canvas.clientWidth,this.canvas.clientHeight),this.renderer.xr.isPresenting||this.render()}setViewportCount(e){const t=this.viewports;for(let n=e;n{"use strict";n.d(t,{u:()=>h,Z:()=>g});var i=n(2837),s=n(8035),r=n(75809),o=n(56963),a=n(31599),l=n(44428);class c extends l.j{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}var h,d=n(19588),u=n(93113);!function(e){e[e.Solid=0]="Solid",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient"}(h||(h={}));class p extends s.K{constructor(){super(new m,new f),this.frustumCulled=!1,this.renderOrder=-1/0,this.matrixAutoUpdate=!1}dispose(){this.geometry.dispose(),this.material.dispose()}updateMatrixWorld(e){}}class m extends r.u{constructor(){super();const e=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),t=new o.v(e,5);this.setIndex([0,1,2,0,2,3]),this.setAttribute("position",new a.k(t,3,0,!1)),this.setAttribute("uv",new a.k(t,2,3,!1))}}class f extends c{constructor(){super(...arguments),this.depthTest=!1,this.depthWrite=!1,this.transparent=!1,this.uniforms={style:{value:h.LinearGradient},color0:{value:new d.P(.15,.2,.25)},color1:{value:new d.P(0,0,0)},noise:{value:.02}},this.vertexShader=["precision highp float;","attribute vec3 position;","attribute vec2 uv;","varying vec2 ndc;","void main() {"," ndc = position.xy;"," gl_Position = vec4(position, 1.0);","}"].join("\n"),this.fragmentShader=["precision highp float;","uniform vec3 color0;","uniform vec3 color1;","uniform float noise;","uniform int style;","varying vec2 ndc;","float rand(vec2 co) {","float dt = dot(co.xy ,vec2(12.9898, 78.233));","float sn = mod(dt, 3.14);","return fract(sin(sn) * 43758.5453);","}","void main() {"," float f = style == 0 ? 0.0 : (style == 1 ? ndc.y * 0.5 + 0.5 : length(ndc) * 0.707);"," gl_FragColor = vec4(mix(color0, color1, f) + noise * rand(ndc), 1.0);","}"].join("\n")}set style(e){this.uniforms.style.value=e}get style(){return this.uniforms.style.value}set color0(e){if(e instanceof u.I){const t=this.uniforms.color0.value;t.x=e.r,t.y=e.g,t.z=e.b}else this.uniforms.color0.value.copy(e)}get color0(){return this.uniforms.color0.value}set color1(e){if(e instanceof u.I){const t=this.uniforms.color1.value;t.x=e.r,t.y=e.g,t.z=e.b}else this.uniforms.color1.value.copy(e)}get color1(){return this.uniforms.color1.value}set noise(e){this.uniforms.noise.value=e}get noise(){return this.uniforms.noise.value}}class g extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(g.backgroundIns),this.object3D=new p}get background(){return this.object3D}update(e){super.update(e);const t=this.ins,n=this.background.material;return t.style.changed&&(n.style=t.style.getValidatedValue()),t.color0.changed&&n.color0.fromArray(t.color0.value),t.color1.changed&&n.color1.fromArray(t.color1.value),t.noise.changed&&(n.noise=t.noise.value),!0}dispose(){this.background.dispose(),super.dispose()}}g.typeName="CBackground",g.backgroundIns={style:i.V5.Enum("Background.Style",h,h.RadialGradient),color0:i.V5.ColorRGB("Background.Color0",[.2,.25,.3]),color1:i.V5.ColorRGB("Background.Color1",[.01,.03,.05]),noise:i.V5.Number("Background.Noise",{min:0,max:1,bar:!0,preset:.02})}},76288:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(77656),s=n(80038),r=n(16967);class o extends r.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(o.dirLightIns),this.object3D=new i.O,this.light.target.matrixAutoUpdate=!1}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;if((n.color.changed||n.intensity.changed)&&(t.intensity=n.intensity.value*Math.PI),(n.position.changed||n.target.changed)&&(t.position.fromArray(n.position.value),t.target.position.fromArray(n.target.value),t.updateMatrix(),t.target.updateMatrix()),n.shadowSize.changed){const e=t.shadow.camera,i=.5*n.shadowSize.value;e.left=e.bottom=-i,e.right=e.top=i,e.near=.05*n.shadowSize.value,e.far=50*n.shadowSize.value,e.updateProjectionMatrix()}return!0}onAddToParent(e){super.onAddToParent(e),e.add(this.light.target)}onRemoveFromParent(e){super.onRemoveFromParent(e),e.remove(this.light.target)}}o.typeName="CDirectionalLight",o.dirLightIns={position:s.V5.Vector3("Light.Position"),target:s.V5.Vector3("Light.Target",[0,-1,0]),shadowSize:s.V5.Number("Shadow.Size",100)}},38080:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(s.ins),this.outs=this.addOutputs(s.outs),this._fullscreenElement=null,this.onFullscreenChange=this.onFullscreenChange.bind(this);const n=document.documentElement,i=n.requestFullscreen||n.mozRequestFullScreen||n.webkitRequestFullscreen;this.outs.fullscreenAvailable.setValue(!!i),this.ins.toggle.on("value",this.toggle,this)}get fullscreenElement(){return this._fullscreenElement}set fullscreenElement(e){e!==this._fullscreenElement&&(this._fullscreenElement&&this._fullscreenElement.removeEventListener("fullscreenchange",this.onFullscreenChange),this._fullscreenElement=e,e&&e.addEventListener("fullscreenchange",this.onFullscreenChange))}update(e){return!0}toggle(){const e=this.outs,t=this._fullscreenElement;if(t){const n=e.fullscreenActive.value;if(!n&&e.fullscreenAvailable.value)t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else if(n){const e=document;e.exitFullscreen?e.exitFullscreen():e.cancelFullScreen?e.cancelFullScreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen()}}}onFullscreenChange(e){const t=document,n=t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement;this.outs.fullscreenActive.setValue(!!n)}}s.typeName="CFullscreen",s.ins={toggle:i.V5.Event("Fullscreen.Toggle")},s.outs={fullscreenAvailable:i.V5.Boolean("Fullscreen.Available",!1),fullscreenActive:i.V5.Boolean("Fullscreen.Active",!1)}},16967:(e,t,n)=>{"use strict";n.d(t,{B:()=>i,Z:()=>a});var i,s=n(80038),r=n(2837);!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High"}(i||(i={}));const o={[i.Low]:512,[i.Medium]:1024,[i.High]:2048};class a extends r.ZP{constructor(){super(...arguments),this.ins=this.addInputs(a.lightIns)}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;if((n.color.changed||n.intensity.changed)&&(t.color.fromArray(n.color.value),t.intensity=n.intensity.value),"shadow"in t&&(n.shadowEnabled.changed&&(t.castShadow=n.shadowEnabled.value),n.shadowBlur.changed&&(t.shadow.radius=n.shadowBlur.value),n.shadowResolution.changed)){const e=o[n.shadowResolution.getValidatedValue()];t.shadow.mapSize.set(e,e),t.shadow.map=null}return!0}}a.typeName="CLight",a.lightIns={color:s.V5.ColorRGB("Light.Color"),intensity:s.V5.Number("Light.Intensity",1),shadowEnabled:s.V5.Boolean("Shadow.Enabled"),shadowResolution:s.V5.Enum("Shadow.Resolution",i,i.Medium),shadowBlur:s.V5.Number("Shadow.Blur",1)}},2837:(e,t,n)=>{"use strict";n.d(t,{V5:()=>r.V5,VZ:()=>l.VZ,ZP:()=>h});var i=n(19588),s=n(71050),r=n(80038),o=n(26060),a=n(36283),l=n(92642);const c=new i.P;class h extends r.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(h.object3DIns),this.outs=this.addOutputs(h.object3DOuts),this._object3D=null,this._isPickable=!1,this.addEvent("object"),this.node.components.on(this.parentComponentClass,this._onParent,this)}get parentComponentClass(){return this.constructor.parentComponentClass}get parentComponent(){return this.node.components.get(this.parentComponentClass,!0)}get transform(){return this.node.components.get(l.ZP,!0)}get scene(){const e=this.transform;return e?e.getParentComponent(a.Z,!0):void 0}get object3D(){return this._object3D}set object3D(e){const t=this._object3D;if(t&&(t.userData.component=null,this.unregisterPickableObject3D(t,!0),t.parent&&this.onRemoveFromParent(t.parent)),this.emit({type:"object",current:t,next:e}),this._object3D=e,e){e.userData.component=this,e.matrixAutoUpdate=!1,e.visible=this.ins.visible.value,this.registerPickableObject3D(e,!0);const t=this.parentComponent;t&&this.onAddToParent(t.object3D)}}update(e){const{visible:t,pickable:n}=this.ins;return t.changed&&this._object3D&&(this._object3D.visible=t.value),n.changed&&n.value!==this._isPickable&&(this._isPickable=n.value,n.value?this.enablePointerEvents():this.disablePointerEvents()),!0}dispose(){this.object3D=null,this.ins.pickable.value&&this.disablePointerEvents(),this.node.components.off(this.parentComponentClass,this._onParent,this),super.dispose()}preRender(e){}postRender(e){}toString(){return super.toString()+(this._object3D?` - type: ${this._object3D.type}`:" - (null)")}onPointer(e){const t=this.outs;"pointer-down"===e.type?(t.pointerDown.set(),t.pointerActive.setValue(!0)):"pointer-up"===e.type&&(t.pointerUp.set(),t.pointerActive.setValue(!1)),e.stopPropagation=!0}enablePointerEvents(){this.on("pointer-down",this.onPointer,this),this.on("pointer-up",this.onPointer,this)}disablePointerEvents(){this.off("pointer-down",this.onPointer,this),this.off("pointer-up",this.onPointer,this);const e=this.outs;e.pointerActive.value&&(e.pointerUp.set(),e.pointerActive.setValue(!1))}updateTransform(){const e=this._object3D;if(!e)return;const{position:t,rotation:n,order:i,scale:r}=this.ins;if(t.changed||n.changed||i.changed||r.changed){e.position.fromArray(t.value),c.fromArray(n.value).multiplyScalar(s.M8.DEG2RAD);const o=i.getOptionText();e.rotation.setFromVector3(c,o),e.scale.fromArray(r.value),e.updateMatrix()}return!0}onAddToParent(e){e.add(this._object3D)}onRemoveFromParent(e){e.remove(this._object3D)}addObject3D(e){this._object3D.add(e),this.registerPickableObject3D(e,!0)}removeObject3D(e){this.unregisterPickableObject3D(e,!0),this._object3D.remove(e)}registerPickableObject3D(e,t){o.Z.add(e,t)}unregisterPickableObject3D(e,t){o.Z.remove(e,t)}_onParent(e){this._object3D&&!this._object3D.parent&&e.add&&this.onAddToParent(e.object.object3D)}}h.typeName="CObject3D",h.parentComponentClass=l.ZP,h.object3DIns={visible:r.V5.Boolean("Object.Visible",!0),pickable:r.V5.Boolean("Object.Pickable")},h.object3DOuts={pointerDown:r.V5.Event("Pointer.Down"),pointerUp:r.V5.Event("Pointer.Up"),pointerActive:r.V5.Boolean("Pointer.Active")},h.transformIns=l.ZP.transformIns,h.prototype.preRender=null,h.prototype.postRender=null},18345:(e,t,n)=>{"use strict";n.d(t,{Z:()=>W});var i=n(80038),s=n(52226),r=n(67171),o=n(19588),a=n(82587),l=n(28092),c=n(37840),h=n(75809),d=n(35322),u=n(64026),p=n(93113),m=n(79961);const f=new o.P,g=new a.y;class v extends l.e{constructor(e,t){t=Object.assign({},v.defaultProps,t);const n=new c.Z;n.makeEmpty(),(0,m.sN)(e,n);const i=t.length,s=[n.min.x,n.min.y,n.min.z],r=[n.max.x,n.max.y,n.max.z],o=[(r[0]-s[0])*i,(r[1]-s[1])*i,(r[2]-s[2])*i];let a;a=isFinite(o[0])&&isFinite(o[1])&&isFinite(o[2])?[s[0],s[1],s[2],s[0]+o[0],s[1],s[2],s[0],s[1],s[2],s[0],s[1]+o[1],s[2],s[0],s[1],s[2],s[0],s[1],s[2]+o[2],r[0],s[1],s[2],r[0]-o[0],s[1],s[2],r[0],s[1],s[2],r[0],s[1]+o[1],s[2],r[0],s[1],s[2],r[0],s[1],s[2]+o[2],s[0],r[1],s[2],s[0]+o[0],r[1],s[2],s[0],r[1],s[2],s[0],r[1]-o[1],s[2],s[0],r[1],s[2],s[0],r[1],s[2]+o[2],s[0],s[1],r[2],s[0]+o[0],s[1],r[2],s[0],s[1],r[2],s[0],s[1]+o[1],r[2],s[0],s[1],r[2],s[0],s[1],r[2]-o[2],s[0],r[1],r[2],s[0]+o[0],r[1],r[2],s[0],r[1],r[2],s[0],r[1]-o[1],r[2],s[0],r[1],r[2],s[0],r[1],r[2]-o[2],r[0],s[1],r[2],r[0]-o[0],s[1],r[2],r[0],s[1],r[2],r[0],s[1]+o[1],r[2],r[0],s[1],r[2],r[0],s[1],r[2]-o[2],r[0],r[1],s[2],r[0]-o[0],r[1],s[2],r[0],r[1],s[2],r[0],r[1]-o[1],s[2],r[0],r[1],s[2],r[0],r[1],s[2]+o[2],r[0],r[1],r[2],r[0]-o[0],r[1],r[2],r[0],r[1],r[2],r[0],r[1]-o[1],r[2],r[0],r[1],r[2],r[0],r[1],r[2]-o[2]]:[-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1,0,0,1];const l=new h.u;l.setAttribute("position",new d.a$(a,3));super(l,new u.n({color:t.color,depthTest:!1})),this.renderOrder=1,this.onBeforeRender=()=>{e.updateMatrixWorld(!1),this.matrixWorld.copy(e.matrixWorld)}}dispose(){this.parent&&this.parent.remove(this),this.geometry.dispose()}static expandBoundingBox(e,t,n){const i=e.geometry;if(void 0!==i){let s=e;for(g.identity();s&&s!==t;)g.premultiply(s.matrix),s=s.parent;if(i.isGeometry){const e=i.vertices;for(let t=0,i=e.length;t0)&&m.push(t,s,a),(e!==n-1||l.9&&o<.1&&(t<.2&&(r[e+0]+=1),n<.2&&(r[e+2]+=1),i<.2&&(r[e+4]+=1))}}()}(),this.setAttribute("position",new d.a$(s,3)),this.setAttribute("normal",new d.a$(s.slice(),3)),this.setAttribute("uv",new d.a$(r,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new k(e.vertices,e.indices,e.radius,e.details)}}class V extends k{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new V(e.radius,e.detail)}}const z=new o.P,F=new p.I,B=new p.I;class $ extends x.T{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const i=new V(t);i.rotateY(.5*Math.PI),this.material=new P.v({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),r=new Float32Array(3*s.count);i.setAttribute("color",new d.Tl(r,3)),this.add(new A.K(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");F.copy(this.light.color),B.copy(this.light.groundColor);for(let e=0,n=t.count;e{e.on("after-render",this.onSceneAfterRender,this)}),(e=>{e.off("after-render",this.onSceneAfterRender,this)}))}dispose(){this._sceneTracker.dispose(),this.system.off("pointer-up",this.onPointerUp,this),this._sceneTracker.dispose(),super.dispose()}update(){return!0}onSelectNode(e,t){super.onSelectNode(e,t);const n=e.getComponent(b.ZP,!0);n&&this.updateBracket(n,t)}onSelectComponent(e,t){super.onSelectComponent(e,t),(e instanceof y.ZP||e instanceof b.ZP)&&this.updateBracket(e,t)}onPointerUp(e){this.ins.viewportPicking.value&&e.isPrimary&&!e.isDragging&&(e.component?this.selectComponent(e.component,e.ctrlKey):e.ctrlKey||this.clearSelection())}onSceneAfterRender(e){if(!this.ins.viewportBrackets.value)return;const t=e.context.renderer,n=e.context.camera;for(let e of this._brackets.values())G.some((([t])=>e instanceof t))&&(e.update(),e.updateWorldMatrix(!0,!1)),t.render(e,n)}updateBracket(e,t){if(e){if(t){const t=e.object3D;if(t){let n;for(let[e,i]of G)t.children[0]instanceof i&&(n=new e(t.children[0],1),n.updateWorldMatrix(!0,!1));n||(n=new v(e.object3D)),this._brackets.set(e,n)}}else{const t=this._brackets.get(e);t&&(this._brackets.delete(e),t.dispose())}this.changed=!0}}}W.typeName="CPickSelection"},15271:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i,s=n(75544),r=n(80038),o=n(26220);!function(e){e[e.Basic=0]="Basic",e[e.PCF=1]="PCF",e[e.PCFSoft=2]="PCFSoft"}(i||(i={}));const a={[i.Basic]:s._MY,[i.PCF]:s._iA,[i.PCFSoft]:s.ntZ};class l extends r.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(l.ins),this.outs=this.addOutputs(l.outs),this.views=[],this._activeSceneComponent=null,this._forceRender=!1,this.addEvents("active-scene","active-camera")}get activeSceneComponent(){return this._activeSceneComponent}set activeSceneComponent(e){if(e!==this._activeSceneComponent){const t=this._activeSceneComponent,n=this.activeCameraComponent;t&&t.off("active-camera",this.onActiveCamera,this),e&&e.on("active-camera",this.onActiveCamera,this),this._activeSceneComponent=e;const i=this.activeCameraComponent,s={type:"active-scene",previous:t,next:e};this.emit(s);const r={type:"active-camera",previous:n,next:i};this.emit(r)}}get activeSceneGraph(){return this._activeSceneComponent?this._activeSceneComponent.graph:null}get activeScene(){return this._activeSceneComponent?this._activeSceneComponent.scene:null}get activeCameraComponent(){return this._activeSceneComponent?this._activeSceneComponent.activeCameraComponent:null}get activeCamera(){const e=this._activeSceneComponent?this._activeSceneComponent.activeCameraComponent:null;return e?e.camera:null}forceRender(){this._forceRender=!0}create(){super.create(),this.trackComponent(o.Z,(e=>{e.on("pulse",this.onPulse,this)}),(e=>{e.off("pulse",this.onPulse,this)}))}update(){const e=this.ins;return e.exposure.changed&&this.views.forEach((t=>t.renderer.toneMappingExposure=e.exposure.value)),e.gamma.changed,e.shadowsEnabled.changed&&this.views.forEach((t=>t.renderer.shadowMap.enabled=e.shadowsEnabled.value)),e.shadowMapType.changed&&this.views.forEach((t=>t.renderer.shadowMap.type=a[e.shadowMapType.getValidatedValue()])),!0}attachView(e){if(0===this.views.length){const t=e.renderer,n=this.outs;n.maxTextureSize.setValue(t.capabilities.maxTextureSize),n.maxCubemapSize.setValue(t.capabilities.maxCubemapSize)}this.views.push(e)}detachView(e){const t=this.views.indexOf(e);if(t<0)throw new Error("render view not registered");this.views.splice(t,1)}logInfo(){this.views.forEach((e=>{console.log(e.renderer.info)}))}onPulse(e){(e.systemUpdated||this._forceRender)&&(this.views.forEach((e=>{e.renderer.xr.isPresenting||e.render()})),this._forceRender=!1)}onActiveCamera(e){this.emit(e)}}l.typeName="CRenderer",l.isSystemSingleton=!0,l.ins={exposure:r.V5.Number("Shading.Exposure",1),gamma:r.V5.Number("Shading.Gamma",2),shadowsEnabled:r.V5.Boolean("Shadows.Enabled",!0),shadowMapType:r.V5.Enum("Shadows.MapType",i,i.PCF)},l.outs={maxTextureSize:r.V5.Integer("Caps.MaxTextureSize"),maxCubemapSize:r.V5.Integer("Caps.MaxCubemapSize")}},36283:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var i=n(64702),s=n(80038),r=n(15271),o=n(92642);const a={view:null,viewport:null,renderer:null,scene:null,camera:null},l={type:"before-render",component:null,context:a},c={type:"after-render",component:null,context:a},h={activate:s.V5.Event("Scene.Activate")};class d extends o.ZP{constructor(e,t){super(e,t),this._activeCameraComponent=null,this._preRenderList=[],this._postRenderList=[],this._renderListsNeedUpdate=!0,this.ins=this.addInputs(h,0),this.addEvents("before-render","after-render","active-camera")}get scene(){return this.object3D}get activeCameraComponent(){return this._activeCameraComponent}set activeCameraComponent(e){if(e!==this._activeCameraComponent){const t=this._activeCameraComponent;this._activeCameraComponent=e;const n={type:"active-camera",previous:t,next:e};this.emit(n)}}get activeCamera(){return this._activeCameraComponent?this._activeCameraComponent.camera:null}get renderer(){return this.getMainComponent(r.Z)}create(){super.create(),this.on("hierarchy",this.shouldUpdateRenderLists,this),this.on("child",this.shouldUpdateRenderLists,this);const e=this.renderer;e&&!e.activeSceneComponent&&(e.activeSceneComponent=this)}update(e){if(super.update(e),this.ins.activate.changed){const e=this.renderer;e&&(e.activeSceneComponent=this)}return!0}tick(e){return this._renderListsNeedUpdate&&(this.updateRenderLists(),this._renderListsNeedUpdate=!1),!1}dispose(){const e=this.renderer;e&&e.activeSceneComponent===this&&(e.activeSceneComponent=null),this.off("hierarchy",this.shouldUpdateRenderLists,this),this.off("child",this.shouldUpdateRenderLists,this),super.dispose()}preRender(e){const t=this._preRenderList;for(let n=0,i=t.length;n(e.preRender&&this._preRenderList.push(e),e.postRender&&this._postRenderList.push(e),!1))),this.changed=!0}_onBeforeRender(e,t,n){a.view=e.__view,a.viewport=e.__viewport,a.renderer=e,a.scene=t,a.camera=n,this.preRender(a),l.component=this,this.emit(l)}_onAfterRender(e,t,n){a.view=e.__view,a.viewport=e.__viewport,a.renderer=e,a.scene=t,a.camera=n,this.postRender(a),c.component=this,this.emit(c)}}d.typeName="CScene",d.isGraphSingleton=!0},92642:(e,t,n)=>{"use strict";n.d(t,{VZ:()=>m,ZP:()=>f});var i=n(19588),s=n(78943),r=n(82954),o=n(25499),a=n(28581),l=n(80038),c=n(3474);const h=new i.P,d=new i.P,u=new s._,p=new r.U;var m;!function(e){e[e.XYZ=0]="XYZ",e[e.YZX=1]="YZX",e[e.ZXY=2]="ZXY",e[e.XZY=3]="XZY",e[e.YXZ=4]="YXZ",e[e.ZYX=5]="ZYX"}(m||(m={}));class f extends c.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(f.transformIns),this.outs=this.addOutputs(f.transformOuts),this._object3D=this.createObject3D(),this._object3D.matrixAutoUpdate=!1}get transform(){return this}get object3D(){return this._object3D}get children(){return this._children||[]}get matrix(){return this._object3D.matrix}update(e){const t=this._object3D,{position:n,rotation:i,order:s,scale:r}=this.ins,{matrix:o}=this.outs;t.position.fromArray(n.value),h.fromArray(i.value).multiplyScalar(a.Z.DEG2RAD);const l=s.getOptionText();return t.rotation.setFromVector3(h,l),t.scale.fromArray(r.value),t.updateMatrix(),t.matrix.toArray(o.value),o.set(),!0}dispose(){this._object3D&&(this._object3D.children.slice().forEach((e=>this._object3D.remove(e))),this._object3D.parent&&this._object3D.parent.remove(this._object3D)),super.dispose()}setPropertiesFromMatrix(e){const t=!e;e=e||this._object3D.matrix;const{position:n,rotation:i,order:s,scale:r}=this.ins;e.decompose(h,u,d),h.toArray(n.value);const o=s.getOptionText();p.setFromQuaternion(u,o),h.setFromEuler(p),h.multiplyScalar(a.Z.RAD2DEG).toArray(i.value),d.toArray(r.value),n.set(t),i.set(t),r.set(t)}addChild(e){super.addChild(e),this._object3D.add(e._object3D)}removeChild(e){this._object3D.remove(e._object3D),super.removeChild(e)}createObject3D(){return new o.T}}f.typeName="CTransform",f.transformIns={position:l.V5.Vector3("Transform.Position"),rotation:l.V5.Vector3("Transform.Rotation"),order:l.V5.Enum("Transform.Order",m),scale:l.V5.Scale3("Transform.Scale")},f.transformOuts={matrix:l.V5.Matrix4("Transform.Matrix")}},67695:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>i.Mo,ZP:()=>r,dy:()=>i.dy});n(56166);var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class r extends i.ZP{constructor(e){super(),this.system=e}}s([(0,i.Cb)({attribute:!1})],r.prototype,"system",void 0)},28097:(e,t,n)=>{"use strict";n.d(t,{Z:()=>M});var i=n(82587),s=n(37840),r=n(19588),o=n(28581),a=n(84538),l=n(82954),c=n(78943);const h=new a.L,d=(new a.L,new r.P),u=new r.P,p=new i.y,m=new l.U,f=new c._,g={PI:3.141592653589793,DOUBLE_PI:6.283185307179586,HALF_PI:1.5707963267948966,QUARTER_PI:.7853981633974483,DEG2RAD:.017453292519943295,RAD2DEG:57.29577951308232,composeOrbitMatrix:function(e,t,n){const s=e.x,r=e.y,o=e.z,a=t.x,l=t.y,c=t.z,h=Math.sin(s),d=Math.cos(s),u=Math.sin(r),p=Math.cos(r),m=Math.sin(o),f=Math.cos(o),g=p*f,v=f*u*h-m*d,y=f*u*d+m*h,b=p*m,_=h*u*m+f*d,x=m*u*d-f*h,w=-u,S=p*h,M=p*d,E=(n=n||new i.y).elements;return E[0]=g,E[1]=b,E[2]=w,E[3]=0,E[4]=v,E[5]=_,E[6]=S,E[7]=0,E[8]=y,E[9]=x,E[10]=M,E[11]=0,E[12]=a*g+l*v+c*y,E[13]=a*b+l*_+c*x,E[14]=a*w+l*S+c*M,E[15]=1,n},decomposeOrbitMatrix:function(e,t,n){m.setFromRotationMatrix(e,"ZYX"),t.setFromEuler(m),p.copy(e).invert(),h.set(0,0,0,1),h.applyMatrix4(p),n.x=-h.x,n.y=-h.y,n.z=-h.z},isMatrix4Identity:function(e){const t=e.elements;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]},decomposeTransformMatrix:function(e,t,n,i){p.fromArray(e),p.decompose(d,f,u),m.setFromQuaternion(f,"XYZ"),d.toArray(t),u.toArray(i),d.setFromEuler(m),h.multiplyScalar(o.Z.RAD2DEG),d.toArray(n)}},v=new i.y,y=new s.Z,b=new r.P,_=new r.P;var x,w,S;!function(e){e[e.Orbit=0]="Orbit",e[e.FirstPerson=1]="FirstPerson"}(x||(x={})),function(e){e[e.Off=0]="Off",e[e.Pan=1]="Pan",e[e.Orbit=2]="Orbit",e[e.Dolly=3]="Dolly",e[e.Zoom=4]="Zoom",e[e.PanDolly=5]="PanDolly",e[e.Roll=6]="Roll"}(w||(w={})),function(e){e[e.Off=0]="Off",e[e.Active=1]="Active",e[e.Release=2]="Release"}(S||(S={}));class M{constructor(e){this.orbit=new r.P(0,0,0),this.offset=new r.P(0,0,50),this.minOrbit=new r.P(-90,-1/0,-1/0),this.maxOrbit=new r.P(90,1/0,1/0),this.minOffset=new r.P(-1/0,-1/0,.1),this.maxOffset=new r.P(1/0,1/0,1e3),this.orientationEnabled=!0,this.offsetEnabled=!0,this.mode=w.Off,this.phase=S.Off,this.prevPinchDist=0,this.deltaX=0,this.deltaY=0,this.deltaPinch=0,this.deltaWheel=0,this.viewportWidth=100,this.viewportHeight=100,this.camera=e}onPointer(e){if(e.isPrimary)if("pointer-down"===e.type)this.phase=S.Active;else if("pointer-up"===e.type)return this.phase=S.Release,!0;"pointer-down"===e.type&&(this.mode=this.getModeFromEvent(e));if(this.deltaX+=1*e.movementX,this.deltaY+=1*e.movementY,2===e.pointerCount){const t=e.activePositions,n=t[1].clientX-t[0].clientX,i=t[1].clientY-t[0].clientY,s=Math.sqrt(n*n+i*i),r=this.prevPinchDist||s;this.deltaPinch*=r>0?s/r:1,this.prevPinchDist=s}else this.deltaPinch=1,this.prevPinchDist=0;return!0}onTrigger(e){return"wheel"===e.type&&(this.deltaWheel+=o.Z.limit(e.wheel,-1,1),!0)}onKeypress(e){if("ArrowUp"===e.key||"ArrowDown"===e.key){const t="ArrowUp"===e.key?-1:1;return this.deltaY=20*t,this.mode=e.shiftKey?w.Pan:e.ctrlKey?w.Dolly:w.Orbit,!0}if("ArrowLeft"===e.key||"ArrowRight"===e.key){const t="ArrowLeft"===e.key?-1:1;return this.deltaX=20*t,this.mode=e.shiftKey?w.Pan:w.Orbit,!0}return!1}setViewportSize(e,t){this.viewportWidth=e,this.viewportHeight=t}updateController(e,t){const n=this.camera;e=e||n;const i=this.orbit,s=this.offset;g.decomposeOrbitMatrix(e.matrix,i,s),this.orbit.multiplyScalar(g.RAD2DEG),t&&(this.minOffset.min(s),this.maxOffset.max(s))}zoomExtents(e){const t=this.camera,n=this.offset;if(!t)return void console.warn("CameraController.zoomExtents - camera not set");b.copy(this.orbit).multiplyScalar(o.Z.DEG2RAD),_.setScalar(0),g.composeOrbitMatrix(b,_,v),y.copy(e).applyMatrix4(v.transpose()),y.getSize(b),y.getCenter(_),n.x=_.x,n.y=_.y;const i=Math.max(b.x/t.aspect,b.y);if(t.isOrthographicCamera)n.z=1.1*i;else{const e=1/(2*Math.tan(t.fov*o.Z.DEG2RAD*.5));n.z=_.z+i*e+.25*b.z}n.z>this.maxOffset.z&&(this.maxOffset.z=2*n.length())}updateCamera(e,t){const n=this.camera;return e=e||n,!(!this.update()&&!t)&&(b.copy(this.orbit).multiplyScalar(o.Z.DEG2RAD),_.copy(this.offset),n.isOrthographicCamera&&(_.z=this.maxOffset.z,n.size=this.offset.z,n.far=2*this.maxOffset.z,n.updateProjectionMatrix()),g.composeOrbitMatrix(b,_,e.matrix),e.matrixWorldNeedsUpdate=!0,!0)}update(){if(this.phase===S.Off&&0===this.deltaWheel&&0===this.deltaX&&0===this.deltaY)return!1;if(0!==this.deltaWheel)return this.updatePose(0,0,.07*this.deltaWheel+1,0,0,0),this.deltaWheel=0,!0;if(this.phase===S.Active)return(0!==this.deltaX||0!==this.deltaY||1!==this.deltaPinch)&&(this.updateByMode(),this.deltaX=0,this.deltaY=0,this.deltaPinch=1,!0);if(this.phase===S.Release){this.deltaX*=.85,this.deltaY*=.85,this.deltaPinch=1,this.updateByMode();return Math.abs(this.deltaX)+Math.abs(this.deltaY)<.1&&(this.mode=w.Off,this.phase=S.Off),!0}return(0!==this.deltaX||0!==this.deltaY)&&(this.updateByMode(),this.deltaX=0,this.deltaY=0,this.mode=w.Off,!0)}updateByMode(){switch(this.mode){case w.Orbit:this.updatePose(0,0,1,this.deltaY,this.deltaX,0);break;case w.Pan:this.updatePose(this.deltaX,this.deltaY,1,0,0,0);break;case w.Roll:this.updatePose(0,0,1,0,0,this.deltaX);break;case w.Dolly:this.updatePose(0,0,.0075*this.deltaY+1,0,0,0);break;case w.PanDolly:const e=.42*(this.deltaPinch-1)+1;this.updatePose(.75*this.deltaX,.75*this.deltaY,1/e,0,0,0)}}updatePose(e,t,n,i,s,r){const{orbit:a,minOrbit:l,maxOrbit:c,offset:h,minOffset:d,maxOffset:u}=this;if(this.orientationEnabled&&(a.x+=-1*i*220/this.viewportHeight,a.y+=-1*s*220/this.viewportHeight,a.z+=-1*r*220/this.viewportHeight,a.x=o.Z.limit(a.x,l.x,c.x),a.y=o.Z.limit(a.y,l.y,c.y),a.z=o.Z.limit(a.z,l.z,c.z)),this.offsetEnabled){const i=h.z=n*h.z;h.x+=e*i*-1/this.viewportHeight,h.y-=t*i*-1/this.viewportHeight,h.x=o.Z.limit(h.x,d.x,u.x),h.y=o.Z.limit(h.y,d.y,u.y),h.z=o.Z.limit(h.z,d.z,u.z)}}getModeFromEvent(e){if("mouse"===e.source){const t=e.originalEvent.button;if(0===t)return e.ctrlKey?w.Pan:e.altKey?w.Dolly:w.Orbit;if(2===t)return e.altKey?w.Roll:w.Pan;if(1===t)return w.Dolly}else if("touch"===e.source){const t=e.pointerCount;return 1===t?w.Orbit:2===t?w.PanDolly:w.Pan}}}},26060:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var i=n(19588),s=n(93113),r=n(37840),o=n(46953),a=n(44428);class l extends a.j{constructor(){super(...arguments),this.isIndexShader=!0,this.uniformsNeedUpdate=!1,this.lights=!1,this.uniforms={index:{value:[0,0,0]}},this.vertexShader=["void main() {"," #include "," #include ","}"].join("\n"),this.fragmentShader=["uniform vec3 index;","void main() {"," gl_FragColor = vec4(index, 1.0);","}"].join("\n")}static indexFromPixel(e){return e[0]+e[1]<<8+e[2]<<16}static zoneFromPixel(e){return e[3]}setIndex(e){const t=e>>16,n=(e>>8)-(t<<8),i=e-(t<<16)-(n<<8),s=this.uniforms.index.value;s[0]=i/255,s[1]=n/255,s[2]=t/255,this.uniformsNeedUpdate=!0}}class c extends a.j{constructor(){super(...arguments),this.isPositionShader=!0,this.uniforms={index:{value:0},range:{value:[-1,1]}},this.vertexShader=["varying vec3 vLocalPosition;","void main() {"," #include "," #include "," vLocalPosition = vec3(position);","}"].join("\n"),this.fragmentShader=["uniform float index;","uniform vec2 range;","varying vec3 vLocalPosition;","vec4 toVec4(float v) {"," float vn = (v - range.x) / (range.y - range.x);"," float b0 = floor(vn * 255.0) / 255.0; vn = (vn - b0) * 256.0;"," float b1 = floor(vn * 255.0) / 255.0; vn = (vn - b1) * 256.0;"," float b2 = floor(vn * 255.0) / 255.0; vn = (vn - b2) * 256.0;"," float b3 = floor(vn * 255.0) / 255.0;"," return vec4(clamp(b0, 0.0, 1.0), clamp(b1, 0.0, 1.0), clamp(b2, 0.0, 1.0), clamp(b3, 0.0, 1.0));","}","void main() {"," gl_FragColor = (index == 0.0 ? toVec4(vLocalPosition.x)"," : (index == 1.0 ? toVec4(vLocalPosition.y) : toVec4(vLocalPosition.z)));","}"].join("\n")}}class h extends a.j{constructor(){super(...arguments),this.isNormalShader=!0,this.uniforms={index:{value:0}},this.vertexShader=["varying vec3 vLocalNormal;","void main() {"," #include "," #include "," #include "," vLocalNormal = vec3(normal);","}"].join("\n"),this.fragmentShader=["uniform vec3 index;","varying vec3 vLocalNormal;","void main() {"," vec3 normal = normalize(vLocalNormal);"," gl_FragColor = vec4(normal * 0.5 + 0.5, 1.0);","}"].join("\n")}}const d=new i.P,u=new s.I,p=1e4,m=new r.Z(new i.P(-1e4,-1e4,-1e4),new i.P(p,p,p));class f{constructor(e){this.renderer=e,this.pickTextures=[];for(let e=0;e<3;++e)this.pickTextures[e]=new o.d(1,1,{stencilBuffer:!1});this.pickBuffer=new Uint8Array(4),this.indexShader=new l,this.positionShader=new c,this.normalShader=new h}static add(e,t){const n=e=>{e.material&&(e.onBeforeRender=function(t,n,i,s,r){r.isIndexShader&&r.setIndex(e.id)},e.onAfterRender=function(e,t,n,i,s){s.isIndexShader&&s.setIndex(0)})};t?e.traverse((e=>n(e))):n(e)}static remove(e,t){const n=e=>{e.material&&(e.onBeforeRender=null,e.onAfterRender=null)};t?e.traverse((e=>n(e))):n(e)}pickObject(e,t,n){const i=this.pickIndex(e,t,n);if(i>0)return e.getObjectById(i)}pickIndex(e,t,n){const i=n.viewport;(t=i.updateCamera(t)).layers.disable(1);const s=e.overrideMaterial;e.overrideMaterial=this.indexShader;const r=this.renderer,o=this.pickTextures[0];r.getClearColor(u),i.applyPickViewport(o,n),r.setRenderTarget(o),r.setClearColor(0);const a=r.xr.enabled;r.xr.enabled=!1,r.clear(),r.render(e,t),r.xr.enabled=a,r.setRenderTarget(null),r.setClearColor(u),e.overrideMaterial=s,t.layers.enable(1);const l=this.pickBuffer;return r.readRenderTargetPixels(o,0,0,1,1,l),l[0]+256*l[1]+65536*l[2]}pickPosition(e,t,n,s,r){s=s||m,r=r||new i.P;const o=n.viewport;(t=o.updateCamera(t)).layers.disable(1);const a=e.overrideMaterial,l=e.overrideMaterial=this.positionShader,c=this.renderer,h=this.pickTextures;c.getClearColor(u),c.setClearColor(0);for(let i=0;i<3;++i)l.uniforms.index.value=i,l.uniforms.range.value[0]=s.min.getComponent(i),l.uniforms.range.value[1]=s.max.getComponent(i),o.applyPickViewport(h[i],n),c.setRenderTarget(h[i]),c.clear(),c.render(e,t);c.setRenderTarget(null),c.setClearColor(u),e.overrideMaterial=a,t.layers.enable(1);const p=this.pickBuffer;for(let e=0;e<3;++e)c.readRenderTargetPixels(h[e],0,0,1,1,p),r.setComponent(e,2.337437050015319e-10*p[3]+5.983838848039216e-8*p[2]+1531862745098039e-20*p[1]+.003921568627451*p[0]);return s.getSize(d),r.multiply(d).add(s.min)}pickNormal(e,t,n,s){s=s||new i.P;const r=n.viewport;(t=r.updateCamera(t)).layers.disable(1);const o=e.overrideMaterial;e.overrideMaterial=this.normalShader;const a=this.renderer,l=this.pickTextures[0];a.getClearColor(u),r.applyPickViewport(l,n),a.setRenderTarget(l),a.setClearColor(0),a.clear(),a.render(e,t),a.setRenderTarget(null),a.setClearColor(u),e.overrideMaterial=o,t.layers.enable(1);const c=this.pickBuffer;return a.readRenderTargetPixels(l,0,0,1,1,c),s.set(c[0]/255*2-1,c[1]/255*2-1,c[2]/255*2-1).normalize()}}},94608:(e,t,n)=>{"use strict";n.d(t,{KB:()=>g,ZP:()=>f,hf:()=>m});var i=n(19588),s=n(40693),r=n(25499),o=n(51120),a=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const l=new i.P,c=new i.P,h=new i.P,d=new i.P,u=new s.F,p=new s.F;var m;!function(e){e[e.TopRight=0]="TopRight",e[e.TopLeft=1]="TopLeft",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight"}(m||(m={}));class f extends r.T{constructor(){super(),this.isHTMLSprite=!0,this.viewAngle=0,this.orientationAngle=0,this.orientationQuadrant=m.TopLeft,this._elements=new Map,this._visible=!0,this.frustumCulled=!1}getVisible(){return this._visible}setVisible(e){e!==this._visible&&this._elements&&(this._visible=e,this._elements.forEach((t=>{t&&t.setVisible(e)})))}dispose(){this._elements.forEach(((e,t)=>{e&&t.removeChild(e)})),this._elements.clear()}disposeHTMLElement(e){const t=this._elements.get(e);t&&(this._elements.delete(e),e.removeChild(t))}update(){this._elements.forEach((e=>{e&&this.updateHTMLElement(e)}))}renderHTMLElement(e,t,n,i,s){i=i||this,l.set(0,0,0),l.applyMatrix4(i.modelViewMatrix),s?c.copy(s):c.set(0,1,0),c.applyMatrix4(i.modelViewMatrix),h.copy(c).sub(l).normalize(),d.set(0,0,1),this.viewAngle=h.angleTo(d),l.applyMatrix4(n.projectionMatrix),c.applyMatrix4(n.projectionMatrix),p.set(c.x,c.y),u.set(l.x,l.y),p.sub(u);const r=.5*(c.x+1)*t.clientWidth,o=.5*(1-c.y)*t.clientHeight;e.setPosition(r,o);const a=this.orientationAngle=p.angle();this.orientationQuadrant=Math.floor(2*a/Math.PI)}getHTMLElement(e){let t=this._elements.get(e);return t||(t=this.createHTMLElement(),t&&(t.setVisible(this._visible),e.appendChild(t),this._elements.set(e,t))),t}createHTMLElement(){return null}updateHTMLElement(e){e.requestUpdate()}}let g=class extends o.ZP{setVisible(e){this.style.display=e?"block":"none"}setOpacity(e){this.style.opacity=e.toString(),this.style.visibility=e>0?"visible":"hidden"}setPosition(e,t){this.style.left=e.toString()+"px",this.style.top=t.toString()+"px"}};g=a([(0,o.Mo)("ff-sprite-element")],g)},28110:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(25499);n(94608);class s extends i.T{constructor(){super(...arguments),this.isHTMLSpriteGroup=!0,this._visible=!0}getVisible(){return this._visible}setVisible(e){if(e!==this._visible){this._visible=e;const t=this.children;for(let n=0,i=t.length;n{"use strict";n.d(t,{LY:()=>b,ZP:()=>_,mP:()=>y});var i=n(37840),s=n(19588),r=n(82587),o=n(68347),a=n(71050),l=n(67440),c=n(62257),h=n(28581);const d=.5*Math.PI,u=new i.Z,p=new s.P,m=new s.P,f=new s.P,g=new r.y,v=(new r.y,[new s.P(0,-d,0),new s.P(0,d,0),new s.P(-d,0,0),new s.P(d,0,0),new s.P(0,0,0),new s.P(0,Math.PI,0)]);var y,b;!function(e){e[e.Perspective=0]="Perspective",e[e.Orthographic=1]="Orthographic"}(y||(y={})),function(e){e[e.None=-1]="None",e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Top=2]="Top",e[e.Bottom=3]="Bottom",e[e.Front=4]="Front",e[e.Back=5]="Back"}(b||(b={}));class _ extends o.V{constructor(e){super(),this.isUniversalCamera=!0,this.fov=50,this.size=20,this.aspect=1,this.distance=20,this.zoom=1,this.near=.1,this.far=2e3,this.focus=10,this.filmGauge=35,this.filmOffset=0,this.view=null,this.setProjection(e)}setProjection(e){e===y.Orthographic?(this.type="OrthographicCamera",this.isPerspectiveCamera=!1,this.isOrthographicCamera=!0):(this.type="PerspectiveCamera",this.isPerspectiveCamera=!0,this.isOrthographicCamera=!1),this.updateProjectionMatrix()}getProjection(){return this.isOrthographicCamera?y.Orthographic:y.Perspective}setPreset(e){e!==b.None?(this.rotation.setFromVector3(v[e],"XYZ"),this.position.set(0,0,this.distance).applyQuaternion(this.quaternion)):(this.rotation.set(0,0,0),this.position.set(0,0,0)),this.updateMatrix()}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*a.M8.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*a.M8.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*a.M8.RAD2DEG*Math.atan(Math.tan(.5*a.M8.DEG2RAD*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,r){this.isPerspectiveCamera?l.c.prototype.setViewOffset.call(this,e,t,n,i,s,r):c.i.prototype.setViewOffset.call(this,e,t,n,i,s,r)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}zoomToView(){}moveToView(e){this.updateMatrixWorld(!1),u.copy(e),g.extractRotation(this.matrixWorldInverse),u.applyMatrix4(g),u.getSize(p),u.getCenter(m);const t=Math.max(p.x/this.aspect,p.y);f.set(-m.x,-m.y,0),this.isPerspectiveCamera?f.z=p.z/(2*Math.tan(this.fov*h.Z.DEG2RAD*.5)):(this.size=.5*t,f.z=2*p.z,this.far=Math.max(this.far,2*f.z)),g.extractRotation(this.matrixWorld),f.applyMatrix4(g),this.matrix.decompose(this.position,this.quaternion,this.scale),this.position.copy(f),this.updateMatrix()}updateProjectionMatrix(){const e=this.near,t=this.far,n=this.aspect,i=this.zoom,s=this.view;if(this.isOrthographicCamera){const r=this.size,o=r/(2*i),a=o*n;let l=-a,c=a,h=o,d=-o;if(s&&s.enabled){const e=i/(s.width/s.fullWidth),t=i/(s.height/s.fullHeight),o=r*n/s.width,a=r/s.height;l+=o*(s.offsetX/e),c=l+o*(s.width/e),h-=a*(s.offsetY/t),d=h-a*(s.height/t)}this.projectionMatrix.makeOrthographic(l,c,h,d,e,t)}else{let o=e*Math.tan(.5*a.M8.DEG2RAD*this.fov)/i,l=2*o,c=n*l,h=-.5*c;s&&s.enabled&&(h+=s.offsetX*c/s.fullWidth,o-=s.offsetY*l/s.fullHeight,c*=s.width/s.fullWidth,l*=s.height/s.fullHeight);var r=this.filmOffset;0!==r&&(h+=e*r/this.getFilmWidth()),this.projectionMatrix.makePerspective(h,h+c,o,o-l,e,t)}this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}copy(e,t){return super.copy(e,t),this.type=e.type,this.isOrthographicCamera=e.isOrthographicCamera,this.isPerspectiveCamera=e.isPerspectiveCamera,this.fov=e.fov,this.size=e.size,this.aspect=e.aspect,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.view=e.view?Object.assign({},e.view):null,this}clone(){return(new this.constructor).copy(this)}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.size=this.size,t.object.aspect=this.aspect,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}},73902:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(40693),s=n(82942),r=n(26775),o=n(12197),a=n(28097);class l extends s.Z{constructor(e){super(),this.next=null,this._canvasWidth=1,this._canvasHeight=1,this._overlay=null,this._camera=null,this._controller=null,this.addEvent("dispose"),this.next=null,e=e||{},this._relRect={x:e.x||0,y:e.y||0,width:e.width||1,height:e.height||1},this._absRect={x:0,y:0,width:1,height:1},e.overlay&&(this._overlay=e.overlay)}get x(){return this._absRect.x}get y(){return this._absRect.y}get width(){return this._absRect.width}get height(){return this._absRect.height}get canvasWidth(){return this._canvasWidth}get canvasHeight(){return this._canvasHeight}get camera(){return this._camera}get controller(){return this._controller}get overlay(){return this._overlay}set overlay(e){this._overlay=e,this.updateGeometry()}dispose(){this.emit({type:"dispose",viewport:this}),this._overlay&&(this._overlay.remove(),this._overlay=null)}setSize(e,t,n,i){const s=this._relRect;s.x=e,s.y=t,s.width=n,s.height=i,this.updateGeometry()}setCanvasSize(e,t){this._canvasWidth=e,this._canvasHeight=t,this.updateGeometry(),this._controller&&this._controller.setViewportSize(e,t)}setBuiltInCamera(e,t){this._camera?this._camera.setProjection(e):(this._camera=new r.ZP(e),this._camera.matrixAutoUpdate=!1),void 0!==t&&(this._camera.setPreset(t),this.overlay.setLabel(o.x.TopRight,"view",r.LY[t],"ff-label-box"))}unsetBuiltInCamera(){this._camera=null,this._controller=null,this.overlay.unsetLabel(o.x.TopRight,"view")}enableCameraControl(e){return!e&&this._controller?this._controller=null:e&&this._camera&&(this._controller||(this._controller=new a.Z(this._camera),this._controller.setViewportSize(this.width,this.height),this._controller.updateController())),this._controller}zoomExtents(e){const t=this._camera,n=this._controller;t&&n&&(n.zoomExtents(e),n.updateCamera(null,!0))}isInside(e){return this.isPointInside(e.localX,e.localY)}isPointInside(e,t){const n=this._absRect;return t=this.canvasHeight-t,e>=n.x&&e=n.y&&t{"use strict";n.d(t,{D7:()=>p,MO:()=>u,jU:()=>d,sN:()=>m});var i=n(19588),s=n(82587),r=n(82954),o=n(78943),a=n(71050);const l=new i.P,c=new s.y,h=new r.U;new o._;function d(e,t,n){const i=n||new o._;return l.fromArray(e).multiplyScalar(a.M8.DEG2RAD),h.setFromVector3(l,t),i.setFromEuler(h),i}function u(e,t,n){const i=n||[0,0,0];return h.setFromQuaternion(e,t),l.setFromEuler(h),l.multiplyScalar(a.M8.RAD2DEG).toArray(i),i}function p(e){const t=new Map,n=new Map,i=new Map;e.traverse((e=>{const s=e;if(s.isMesh){const e=s.geometry;e&&t.set(e.uuid,e);const r=s.material;if(r){n.set(r.uuid,r);for(let e in r){const t=r[e];t&&t.isTexture&&i.set(t.uuid,t)}}}}));for(let e of i)e[1].dispose();for(let e of n)e[1].dispose();for(let e of t)e[1].dispose()}function m(e,t,n){n||(n=e);const i=e.geometry;if(i&&e.visible){let s=e;for(c.identity();s&&s!==n;)c.premultiply(s.matrix),s=s.parent;if(i.isGeometry){const e=i.vertices;for(let n=0,i=e.length;n{"use strict";n.d(t,{Z:()=>a,x:()=>i});var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};!function(e){e[e.TopLeft=0]="TopLeft",e[e.TopCenter=1]="TopCenter",e[e.TopRight=2]="TopRight",e[e.BottomLeft=3]="BottomLeft",e[e.BottomCenter=4]="BottomCenter",e[e.BottomRight=5]="BottomRight"}(i||(i={}));let o=class extends s.ZP{constructor(){super(),this.labels=[],this.labels.push({},{},{},{},{},{})}setLabel(e,t,n,i){this.labels[e][t]={text:n,className:i},this.requestUpdate()}unsetLabel(e,t){delete this.labels[e][t],this.requestUpdate()}firstConnected(){this.classList.add("ff-container","ff-viewport-overlay")}render(){const e=this.labels;return s.dy`
-
${Object.keys(e[i.TopLeft]).map((t=>{const n=e[i.TopLeft][t];return s.dy`
${n.text}
`}))}
-
${Object.keys(e[i.TopCenter]).map((t=>{const n=e[i.TopCenter][t];return s.dy`
${n.text}
`}))}
-
${Object.keys(e[i.TopRight]).map((t=>{const n=e[i.TopRight][t];return s.dy`
${n.text}
`}))}
-
-
${Object.keys(e[i.BottomLeft]).map((t=>{const n=e[i.BottomLeft][t];return s.dy`
${n.text}
`}))}
-
${Object.keys(e[i.BottomCenter]).map((t=>{const n=e[i.BottomCenter][t];return s.dy`
${n.text}
`}))}
-
${Object.keys(e[i.BottomRight]).map((t=>{const n=e[i.BottomRight][t];return s.dy`
${n.text}
`}))}
-
`}};o=r([(0,s.Mo)("ff-viewport-overlay")],o);const a=o},98595:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});n(1239);var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let r=class extends i.ZP{constructor(){super(),this.name="",this.index=0,this.selectedIndex=-1,this.tabbingIndex=0,this.selected=!1,this.selectable=!1,this.disabled=!1,this.icon="",this.role="button",this.caret=!1,this.inline=!1,this.transparent=!1,this.addEventListener("click",(e=>this.onClick(e))),this.addEventListener("keydown",(e=>this.onKeyDown(e)))}firstConnected(){this.tabIndex=this.tabbingIndex,this.setAttribute("role",this.role),this.classList.add("ff-button")}shouldUpdate(e){return(e.has("selectedIndex")||e.has("index"))&&this.selectedIndex>=0&&(this.selected=this.index===this.selectedIndex),e.has("disabled")&&this.setClass("ff-disabled",this.disabled),!0}update(e){this.classList.remove("ff-inline","ff-transparent","ff-control"),this.inline?this.classList.add("ff-inline"):this.transparent?this.classList.add("ff-transparent"):this.classList.add("ff-control"),super.update(e)}render(){return i.dy`${this.renderIcon()}${this.renderText()}${this.renderCaret()}`}renderIcon(){return this.icon?i.dy``:null}renderText(){return this.text?i.dy`
${this.text}
`:null}renderCaret(){return this.caret?i.dy`
`:null}onClick(e){this.selectable&&(this.selected=!this.selected)}onKeyDown(e){(document.activeElement.shadowRoot?document.activeElement.shadowRoot.activeElement:document.activeElement)!==this||"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),this.dispatchEvent(new MouseEvent("click",{bubbles:!0})))}};s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"index",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"selectedIndex",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"tabbingIndex",void 0),s([(0,i.Cb)({type:Boolean,reflect:!0})],r.prototype,"selected",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"selectable",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"disabled",void 0),s([(0,i.Cb)()],r.prototype,"text",void 0),s([(0,i.Cb)()],r.prototype,"icon",void 0),s([(0,i.Cb)()],r.prototype,"role",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"caret",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"inline",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"transparent",void 0),r=s([(0,i.Mo)("ff-button")],r);const o=r},34834:(e,t,n)=>{"use strict";var i=n(28581),s=n(47855),r=(n(45716),n(61497)),o=n(96368),a=n(51120),l=n(69551),c=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let h=class extends a.ZP{constructor(){super(),this.value=new o.Z,this._offsetX=0,this._offsetY=0,this._knob=(new a.ZP).addClass("ff-knob").setStyle({display:"block",position:"relative "}),new l.Z(this)}setXY(e,t){this.value.set(e,t),this.requestUpdate()}dragStart(e){const t=this._knob,n=this.getBoundingClientRect();e.target===this._knob?(this._offsetX=e.clientX-t.offsetLeft+.5*(t.clientWidth-t.offsetWidth),this._offsetY=e.clientY-t.offsetTop+.5*(t.clientHeight-t.offsetHeight)):(this._offsetX=n.left+.8*t.clientWidth,this._offsetY=n.top+.8*t.clientHeight),this.dragMove(e)}dragMove(e){const t=this._knob,n=e.clientX-this._offsetX,s=e.clientY-this._offsetY;let r=n/(this.clientWidth-t.clientWidth);r=i.Z.limit(r,0,1);let o=1-s/(this.clientHeight-t.clientHeight);o=i.Z.limit(o,0,1),r===this.value.x&&o===this.value.y||(this.value=this.value.set(r,o),this.emitChangeEvent(!0))}dragEnd(){this.emitChangeEvent(!1)}firstConnected(){this.setStyle({position:"relative",touchAction:"none"}),this.setAttribute("touch-action","none"),this.setAttribute("tabindex","0"),this.classList.add("ff-control","ff-vector-slider"),this.appendChild(this._knob)}update(e){const t=100*this.value.x,n=100*(1-this.value.y);this._knob.style.left=`${t.toFixed(3)}%`,this._knob.style.top=`${n.toFixed(3)}%`,super.update(e)}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,isDragging:e},bubbles:!0}))}};c([(0,a.Cb)({attribute:!1})],h.prototype,"value",void 0),h=c([(0,a.Mo)("ff-vector-slider")],h);const d=h;var u=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const p=new s.ZP;let m=class extends a.ZP{constructor(){super(),this.color=new s.ZP,this.alpha=!1,this.numeric=!1,this.onLumSatChange=this.onLumSatChange.bind(this),this.onHueChange=this.onHueChange.bind(this),this.onAlphaChange=this.onAlphaChange.bind(this),this.addEventListener("click",(e=>e.stopPropagation())),this._hsv=new s.P,this._lumSatSlider=(new d).on("change",this.onLumSatChange),this._hueSlider=(new r.Z).addClass("ff-hue-slider").on("change",this.onHueChange),this._hueSlider.direction="vertical"}firstConnected(){this.classList.add("ff-flex-column","ff-control","ff-color-edit")}update(e){e.has("color")&&this.color.toHSV(this._hsv),e.has("alpha")&&(this.alpha&&!this._alphaSlider?(this._alphaSlider=(new r.Z).addClass("ff-alpha-slider").on("change",this.onAlphaChange),this._alphaSlider.direction="vertical"):!this.alpha&&this._alphaSlider&&this._alphaSlider.remove()),super.update(e)}render(){let e=null;if(this.numeric){const t=this.color,n=t.toString(!1).substr(1),i=this.alpha?a.dy` -
A
- `:null;e=a.dy`
-
R
-
G
-
B
- ${i} -
#
-
`}return a.dy`
- ${this._lumSatSlider}${this._hueSlider}${this._alphaSlider} -
${e}`}updated(){this._hueSlider.value=1-this._hsv.x/360;const e=`linear-gradient(to bottom, transparent, black), linear-gradient(to right, white, ${p.setHSV(this._hsv.x).toString(!1)})`;if(this._lumSatSlider.style.backgroundImage=e,this._lumSatSlider.setXY(this._hsv.y,this._hsv.z),this.alpha){const e=this.color.toString(!1),t=getComputedStyle(this._alphaSlider).color,n=`linear-gradient(to top, transparent, ${e}), repeating-linear-gradient(-45deg, transparent, transparent 8px, ${t} 8px, ${t} 16px)`;this._alphaSlider.style.backgroundImage=n,this._alphaSlider.value=this.color.alpha}}onLumSatChange(e){e.stopPropagation();const t=e.detail.value;this._hsv.y=t.x,this._hsv.z=t.y,this.color.setHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(e.detail.isDragging)}onHueChange(e){e.stopPropagation(),this._hsv.x=360*(1-e.target.value),this.color.setHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(e.detail.isDragging)}onAlphaChange(e){e.stopPropagation(),this.color.alpha=e.target.value,this.requestUpdate(),this.emitChangeEvent(e.detail.isDragging)}onNumericEdit(e){e.stopPropagation();const t=e.target.name;if("string"===t)this.color.setString(e.detail.text,1,!1);else{let n=parseInt(e.detail.text);if(!isFinite(n))return;this.color[t]=i.Z.limit(n,0,255)}this.color.toHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(e.detail.isEditing)}onKeyDown(e){const t="ArrowRight"===e.code||"ArrowUp"===e.code,n="PageUp"===e.code,s="ArrowLeft"===e.code||"ArrowDown"===e.code,r="PageDown"===e.code;if(t||n||s||r)if(e.target===this._hueSlider||e.target===this._alphaSlider){const r=t||n?-1:1,o=t||s?.01:.1;e.target===this._hueSlider?(this._hsv.x=i.Z.limit(this._hsv.x+360*o*r,0,360),this.color.setHSV(this._hsv)):this.color.alpha=i.Z.limit(this.color.alpha+o*r,0,1),this.requestUpdate(),this.emitChangeEvent(!1)}else if(e.target===this._lumSatSlider&&(t||s)){const n=t?1:-1,s=e.shiftKey?.1:.01;"ArrowRight"===e.code||"ArrowLeft"===e.code?this._hsv.y=i.Z.limit(this._hsv.y+s*n,0,1):this._hsv.z=i.Z.limit(this._hsv.z+s*n,0,1),this.color.setHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(!1)}}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{detail:{color:this.color,isDragging:e},bubbles:!0}))}};u([(0,a.Cb)({attribute:!1})],m.prototype,"color",void 0),u([(0,a.Cb)({type:Boolean})],m.prototype,"alpha",void 0),u([(0,a.Cb)({type:Boolean})],m.prototype,"numeric",void 0),m=u([(0,a.Mo)("ff-color-edit")],m)},51120:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>$,ZP:()=>B,dy:()=>d.dy,Cb:()=>M,sY:()=>d.sY});var i=n(93909),s=n(14056);function r(e,t){const{element:{content:n},parts:i}=e,s=document.createTreeWalker(n,133,null,!1);let r=a(i),o=i[r],l=-1,c=0;const h=[];let d=null;for(;s.nextNode();){l++;const e=s.currentNode;for(e.previousSibling===d&&(d=null),t.has(e)&&(h.push(e),null===d&&(d=e)),null!==d&&c++;void 0!==o&&o.index===l;)o.index=null!==d?-1:o.index-c,r=a(i,r),o=i[r]}h.forEach((e=>e.parentNode.removeChild(e)))}const o=e=>{let t=11===e.nodeType?0:1;const n=document.createTreeWalker(e,133,null,!1);for(;n.nextNode();)t++;return t},a=(e,t=-1)=>{for(let n=t+1;n`${e}--${t}`;let p=!0;void 0===window.ShadyCSS?p=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),p=!1);const m=e=>t=>{const n=u(t.type,e);let i=c.r.get(n);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},c.r.set(n,i));let r=i.stringsArray.get(t.strings);if(void 0!==r)return r;const o=t.strings.join(s.Jw);if(r=i.keyString.get(o),void 0===r){const n=t.getTemplateElement();p&&window.ShadyCSS.prepareTemplateDom(n,e),r=new s.YS(t,n),i.keyString.set(o,r)}return i.stringsArray.set(t.strings,r),r},f=["html","svg"],g=new Set,v=(e,t,n)=>{g.add(e);const i=n?n.element:document.createElement("template"),s=t.querySelectorAll("style"),{length:l}=s;if(0===l)return void window.ShadyCSS.prepareTemplateStyles(i,e);const h=document.createElement("style");for(let e=0;e{f.forEach((t=>{const n=c.r.get(u(t,e));void 0!==n&&n.keyString.forEach((e=>{const{element:{content:t}}=e,n=new Set;Array.from(t.querySelectorAll("style")).forEach((e=>{n.add(e)})),r(e,n)}))}))})(e);const d=i.content;n?function(e,t,n=null){const{element:{content:i},parts:s}=e;if(null==n)return void i.appendChild(t);const r=document.createTreeWalker(i,133,null,!1);let l=a(s),c=0,h=-1;for(;r.nextNode();)for(h++,r.currentNode===n&&(c=o(t),n.parentNode.insertBefore(t,n));-1!==l&&s[l].index===h;){if(c>0){for(;-1!==l;)s[l].index+=c,l=a(s,l);return}l=a(s,l)}}(n,h,d.firstChild):d.insertBefore(h,d.firstChild),window.ShadyCSS.prepareTemplateStyles(i,e);const p=d.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==p)t.insertBefore(p.cloneNode(!0),t.firstChild);else if(n){d.insertBefore(h,d.firstChild);const e=new Set;e.add(h),r(n,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const y={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},b=(e,t)=>t!==e&&(t==t||e==e),_={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:b},x="finalized";class w extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach(((t,n)=>{const i=this._attributeNameForProperty(n,t);void 0!==i&&(this._attributeToPropertyMap.set(i,n),e.push(i))})),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach(((e,t)=>this._classProperties.set(t,e)))}}static createProperty(e,t=_){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n="symbol"==typeof e?Symbol():`__${e}`,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const s=this[e];this[t]=i,this.requestUpdateInternal(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||_}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty(x)||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const n of t)this.createProperty(n,e[n])}}static _attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,n=b){return n(e,t)}static _propertyValueFromAttribute(e,t){const n=t.type,i=t.converter||y,s="function"==typeof i?i:i.fromAttribute;return s?s(e,n):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const n=t.type,i=t.converter;return(i&&i.toAttribute||y.toAttribute)(e,n)}initialize(){this._updateState=0,this._updatePromise=new Promise((e=>this._enableUpdatingResolver=e)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((e,t)=>this[t]=e)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,n){t!==n&&this._attributeToProperty(e,n)}_propertyToAttribute(e,t,n=_){const i=this.constructor,s=i._attributeNameForProperty(e,n);if(void 0!==s){const e=i._propertyValueToAttribute(t,n);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(s):this.setAttribute(s,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const n=this.constructor,i=n._attributeToPropertyMap.get(e);if(void 0!==i){const e=n.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=n._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,n){let i=!0;if(void 0!==e){const s=this.constructor;n=n||s.getPropertyOptions(e),s._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((e,t)=>this._propertyToAttribute(t,this[t],e))),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}w.finalized=!0;const S=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}};function M(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):S(e,t)}const E=Element.prototype;E.msMatchesSelector||E.webkitMatchesSelector;const T=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,C=Symbol();class A{constructor(e,t){if(t!==C)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(T?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const P={};class R extends w{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,n)=>e.reduceRight(((e,n)=>Array.isArray(n)?t(n,e):(e.add(n),e)),n),n=t(e,new Set),i=[];n.forEach((e=>i.unshift(e))),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map((e=>{if(e instanceof CSSStyleSheet&&!T){const t=Array.prototype.slice.call(e.cssRules).reduce(((e,t)=>e+t.cssText),"");return new A(String(t),C)}return e}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?T?this.renderRoot.adoptedStyleSheets=e.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map((e=>e.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==P&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)})))}render(){return P}}R.finalized=!0,R.render=(e,t,n)=>{if(!n||"object"!=typeof n||!n.scopeName)throw new Error("The `scopeName` option is required.");const s=n.scopeName,r=l.L.has(t),o=p&&11===t.nodeType&&!!t.host,a=o&&!g.has(s),c=a?document.createDocumentFragment():t;if((0,l.s)(e,c,Object.assign({templateFactory:m(s)},n)),a){const e=l.L.get(c);l.L.delete(c);const n=e.value instanceof h.R?e.value.template:void 0;v(s,c,n),(0,i.r4)(t,t.firstChild),t.appendChild(c),l.L.set(t,e)}!r&&o&&window.ShadyCSS.styleElement(t.host)},R.shadowRootOptions={mode:"open"};const L=(e,t)=>{const n=e.startNode.parentNode,i=void 0===t?e.endNode:t.startNode,s=n.insertBefore((0,d.IW)(),i);n.insertBefore((0,d.IW)(),i);const r=new d.nt(e.options);return r.insertAfterNode(s),r},N=(e,t)=>(e.setValue(t),e.commit(),e),D=(e,t,n)=>{const i=e.startNode.parentNode,s=n?n.startNode:e.endNode,r=t.endNode.nextSibling;r!==s&&(0,d.V)(i,t.startNode,r,s)},I=e=>{(0,d.r4)(e.startNode.parentNode,e.startNode,e.endNode.nextSibling)},O=(e,t,n)=>{const i=new Map;for(let s=t;s<=n;s++)i.set(e[s],s);return i},U=new WeakMap,k=new WeakMap;(0,d.XM)(((e,t,n)=>{let i;return void 0===n?n=t:void 0!==t&&(i=t),t=>{if(!(t instanceof d.nt))throw new Error("repeat can only be used in text bindings");const s=U.get(t)||[],r=k.get(t)||[],o=[],a=[],l=[];let c,h,u=0;for(const t of e)l[u]=i?i(t,u):u,a[u]=n(t,u),u++;let p=0,m=s.length-1,f=0,g=a.length-1;for(;p<=m&&f<=g;)if(null===s[p])p++;else if(null===s[m])m--;else if(r[p]===l[f])o[f]=N(s[p],a[f]),p++,f++;else if(r[m]===l[g])o[g]=N(s[m],a[g]),m--,g--;else if(r[p]===l[g])o[g]=N(s[p],a[g]),D(t,s[p],o[g+1]),p++,g--;else if(r[m]===l[f])o[f]=N(s[m],a[f]),D(t,s[m],s[p]),m--,f++;else if(void 0===c&&(c=O(l,f,g),h=O(r,p,m)),c.has(r[p]))if(c.has(r[m])){const e=h.get(l[f]),n=void 0!==e?s[e]:null;if(null===n){const e=L(t,s[p]);N(e,a[f]),o[f]=e}else o[f]=N(n,a[f]),D(t,n,s[p]),s[e]=null;f++}else I(s[m]),m--;else I(s[p]),p++;for(;f<=g;){const e=L(t,o[g+1]);N(e,a[f]),o[f++]=e}for(;p<=m;){const e=s[p++];null!==e&&I(e)}U.set(t,o),k.set(t,l)}}));var V,z=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let F=V=class extends R{constructor(){super(...arguments),this._isFirstConnected=!1}static setStyle(e,t){Object.assign(e.style,t)}static setAttribs(e,t){for(let n in t)e.setAttribute(n,t[n])}get shady(){return this.constructor.shady}appendTo(e){return e.appendChild(this),this}removeChildren(){for(;this.firstChild;)this.removeChild(this.firstChild)}getChildrenArray(){return Array.from(this.children)}appendElement(e,t){return this.createElement(e,t,this)}createElement(e,t,n){let i;return i="string"==typeof e?document.createElement(e):e instanceof HTMLElement?e:new e,t&&Object.assign(i.style,t),n&&n.appendChild(i),i}setStyle(e){return V.setStyle(this,e),this}setAttribute(e,t){return super.setAttribute(e,t),this}setAttributes(e){return V.setAttribs(this,e),this}addClass(...e){return e.forEach((e=>this.classList.add(e))),this}removeClass(...e){return e.forEach((e=>this.classList.remove(e))),this}setClass(e,t){return t?this.classList.add(e):this.classList.remove(e),this}hasFocus(){return document.activeElement===this}on(e,t,n){return this.addEventListener(e,t,n),this}off(e,t,n){return this.removeEventListener(e,t,n),this}connectedCallback(){this._isFirstConnected||(this._isFirstConnected=!0,this.firstConnected()),this.connected(),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.disconnected()}createRenderRoot(){return this.shady?super.createRenderRoot():this}firstConnected(){}connected(){}disconnected(){}onUpdate(){this.requestUpdate()}};F.tagName="ff-custom-element",F.shady=!1,F=V=z([$("ff-custom-element")],F);const B=F;function $(e){return t=>(t.tagName=e,customElements.define(t.tagName,t),t)}},69551:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{constructor(e){this.isEnabled=!0,this._isDragging=!1,this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this.target=e,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp)}get isDragging(){return this._isDragging}get startX(){return this._startX}get startY(){return this._startY}onPointerDown(e){e.isPrimary&&this.isEnabled&&(this._isDragging=!0,this._startX=this._lastX=e.clientX,this._startY=this._lastY=e.clientY,this.target.setPointerCapture(e.pointerId),this.target.dragStart(e)),e.stopPropagation(),e.preventDefault()}onPointerMove(e){if(e.isPrimary&&this._isDragging){const t=e.clientX-this._lastX;this._lastX=e.clientX;const n=e.clientY-this._lastY;this._lastY=e.clientY,this.target.dragMove(e,t,n)}e.stopPropagation(),e.preventDefault()}onPointerUp(e){this._isDragging&&e.isPrimary&&(this.target.dragEnd(e),this.target.releasePointerCapture(e.pointerId),this._isDragging=!1),e.stopPropagation(),e.preventDefault()}}},1239:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let o=i=class extends s.ZP{constructor(e){super(),this.template=null,this.name=e||""}static add(e,t){if(i.templates[e])throw new Error(`icon already registered: '${e}'`);i.templates[e]=t}static getTemplateNames(){return Object.keys(i.templates)}firstConnected(){this.classList.add("ff-icon")}render(){if(this.name){const e=this.constructor.templates[this.name];return e||console.warn(`icon not found: '${this.name}'`),e}return this.template?this.template:s.dy`[icon undefined]`}};o.templates={},r([(0,s.Cb)({attribute:!1})],o.prototype,"template",void 0),r([(0,s.Cb)({type:String})],o.prototype,"name",void 0),o=i=r([(0,s.Mo)("ff-icon")],o);const a=o;o.add("empty",s.dy``),o.add("check",s.dy``),o.add("close",s.dy``),o.add("grip",s.dy``),o.add("up",s.dy``),o.add("down",s.dy``),o.add("caret-up",s.dy``),o.add("caret-down",s.dy``),o.add("folder",s.dy``),o.add("file",s.dy``),o.add("info",s.dy``),o.add("warning",s.dy``),o.add("error",s.dy``),o.add("prompt",s.dy``)},45716:(e,t,n)=>{"use strict";var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let r=class extends i.ZP{constructor(){super(...arguments),this.name="",this.index=0,this.text="",this.placeholder="",this.align="left",this.initialValue="",this.requestFocus=!1}get inputElement(){return this.getElementsByTagName("input").item(0)}focus(){this.requestFocus=!0,this.performUpdate()}hasFocus(){const e=document.activeElement.shadowRoot?document.activeElement.shadowRoot.activeElement:document.activeElement;return this.inputElement===e}firstConnected(){this.classList.add("ff-control","ff-line-edit")}shouldUpdate(e){return!this.hasFocus()&&super.shouldUpdate(e)}render(){return i.dy``}updated(){this.requestFocus&&(this.requestFocus=!1,this.inputElement.focus())}onKeyDown(e){const t=e.target;"Enter"===e.key?(this.commit(t),t.blur()):"Escape"===e.key&&(this.revert(t),t.blur())}onChange(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!1)}onInput(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!0)}onFocus(e){this.initialValue=e.target.value,e.target.select()}onBlur(e){this.commit(e.target),this.requestUpdate()}revert(e){e.value=this.initialValue,this.dispatchChangeEvent(e.value,!1)}commit(e){this.initialValue=e.value,this.dispatchChangeEvent(e.value,!1)}dispatchChangeEvent(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{text:e,isEditing:t}}))}};s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"index",void 0),s([(0,i.Cb)({type:String})],r.prototype,"text",void 0),s([(0,i.Cb)({type:String})],r.prototype,"placeholder",void 0),s([(0,i.Cb)({type:String})],r.prototype,"align",void 0),r=s([(0,i.Mo)("ff-line-edit")],r)},61497:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(28581),s=n(51120),r=n(69551),o=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let a=class extends s.ZP{constructor(){super(),this.direction="horizontal",this.value=0,this._isVertical=!1,this._offsetX=0,this._offsetY=0,this._knob=(new s.ZP).addClass("ff-knob").setStyle({display:"block",position:"relative "}),new r.Z(this)}dragStart(e){const t=this._knob,n=this.getBoundingClientRect();e.target===this._knob?(this._offsetX=e.clientX-t.offsetLeft+.5*(t.clientWidth-t.offsetWidth),this._offsetY=e.clientY-t.offsetTop+.5*(t.clientHeight-t.offsetHeight)):(this._offsetX=n.left+.8*t.clientWidth,this._offsetY=n.top+.8*t.clientHeight),this.dragMove(e)}dragMove(e){const t=this._knob,n=e.clientX-this._offsetX,s=e.clientY-this._offsetY;let r=this._isVertical?1-s/(this.clientHeight-t.clientHeight):n/(this.clientWidth-t.clientWidth);r=i.Z.limit(r,0,1),r!==this.value&&(this.value=r,this.emitChangeEvent(!0))}dragEnd(){this.emitChangeEvent(!1)}firstConnected(){this.setStyle({position:"relative",touchAction:"none"}),this.setAttribute("touch-action","none"),this.setAttribute("tabindex","0"),this.classList.add("ff-control","ff-linear-slider"),this.appendChild(this._knob)}update(e){if(e.has("direction")&&(this._isVertical="vertical"===this.direction,this.setClass("ff-horizontal",!this._isVertical),this.setClass("ff-vertical",this._isVertical)),e.has("value")){const e=i.Z.limit(this.value,0,1),t=this._isVertical?0:100*e,n=this._isVertical?100*(1-e):0;this._knob.style.left=`${t.toFixed(3)}%`,this._knob.style.top=`${n.toFixed(3)}%`}super.update(e)}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,isDragging:e},bubbles:!0}))}};o([(0,s.Cb)({type:String})],a.prototype,"direction",void 0),o([(0,s.Cb)({type:Number})],a.prototype,"value",void 0),a=o([(0,s.Mo)("ff-linear-slider")],a);const l=a},10564:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>h});n(1239);var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const o={info:"ff-info",success:"ff-success",warning:"ff-warning",error:"ff-error"},a={info:"info",success:"check",warning:"warning",error:"error"},l={info:2e3,success:2e3,warning:5e3,error:0};let c=i=class extends s.ZP{constructor(e,t,n){super(),this._handler=0,this.on("transitionend",this.remove.bind(this)),this.message=e||"",this.level=t||"info",this.timeout=void 0!==n?n:l[this.level];const s=(i.shadowRootNode||document).getElementById(i.stackId);s?s.appendChild(this):console.warn(`element '#${i.stackId}' not found`)}static show(e,t,n){new i(e,t,n)}close(){this._handler>0&&(window.clearTimeout(this._handler),this._handler=0),this.classList.add("ff-out")}firstUpdated(){this.classList.add("ff-notification",o[this.level]),this.timeout>0&&(this._handler=window.setTimeout((()=>this.close()),this.timeout))}render(){const e=a[this.level];return s.dy` -
${this.message}
- `}onClose(e){e.stopPropagation(),this.close()}};c.stackId="ff-notification-stack",c.shadowRootNode=null,r([(0,s.Cb)({type:String})],c.prototype,"message",void 0),r([(0,s.Cb)({type:String})],c.prototype,"level",void 0),r([(0,s.Cb)({type:Number})],c.prototype,"timeout",void 0),c=i=r([(0,s.Mo)("ff-notification")],c);const h=c},34287:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>i.Mo,ZP:()=>o,dy:()=>i.dy});var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let r=class extends i.ZP{constructor(){super(),this.anchor=null,this.portal=null,this.position=void 0,this.align=void 0,this.justify=void 0,this.positionX=0,this.positionY=0,this.offsetX=0,this.offsetY=0,this.keepVisible=!1,this.modal=!1,this._modalPlane=null,this.onResize=this.onResize.bind(this),this.onCaptureEvent=this.onCaptureEvent.bind(this),this.onEatEvent=this.onEatEvent.bind(this)}close(){this.dispatchEvent(new CustomEvent("close"))}connected(){if(this.calculatePosition(),window.addEventListener("resize",this.onResize),this.modal){const e=this._modalPlane=this.createElement("div");e.classList.add("ff-modal-plane"),e.addEventListener("mousedown",this.onEatEvent),e.addEventListener("contextmenu",this.onEatEvent),e.addEventListener("pointerdown",this.onEatEvent),this.parentElement.appendChild(e),setTimeout((()=>e.classList.add("ff-transition")))}else document.addEventListener("mousedown",this.onCaptureEvent,{capture:!0,passive:!0})}disconnected(){window.removeEventListener("resize",this.onResize),this._modalPlane?(this._modalPlane.remove(),this._modalPlane=null):document.removeEventListener("mousedown",this.onCaptureEvent)}firstConnected(){super.firstConnected(),this.setStyle({position:"fixed",zIndex:"1000"}),this.classList.add("ff-popup")}updated(){this.isConnected&&this.calculatePosition()}calculatePosition(){let e,t;const n=this.getBoundingClientRect();let i;if(t=this.portal?this.portal.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight},"center"===this.position)i=this.center(n,t);else if("anchor"===this.position){const s=this.anchor||this.parentElement;s&&(e=s.getBoundingClientRect(),i=this.positionToAnchor(n,e,t))}else i={x:this.positionX,y:this.positionY};this.keepVisible&&"center"!==this.position&&(i=this.keepElementVisible(i,n,t)),this.style.left=Math.round(i.x)+"px",this.style.top=Math.round(i.y)+"px"}center(e,t){return{x:Math.round(.5*(t.width-e.width)),y:Math.round(.5*(t.height-e.height))}}positionToAnchor(e,t,n){const i=this.align,s=this.justify,r=this.offsetX,o=this.offsetY,a={x:0,y:0};switch(i){case"start":a.x="start"!==s&&"end"!==s?t.left-e.width-r:t.left;break;case"end":a.x="start"!==s&&"end"!==s?t.right+r:t.right-e.width;break;case"fixed":a.x=this.positionX;break;default:a.x=t.left+.5*(t.width-e.width)}switch(s){case"start":a.y=t.top-e.height-o;break;case"end":a.y=t.bottom+o;break;case"fixed":a.y=this.positionY;break;default:a.y=t.top+.5*(t.height-e.height)}return a.x+=this.offsetX,a.y+=this.offsetY,a}keepElementVisible(e,t,n){const i=this.offsetX,s=this.offsetY;return t.width>n.width?e.x=.5*(n.width-t.width):e.xn.right&&(e.x=n.right-t.width-i),t.height>n.height?e.y=.5*(n.height-t.height):e.yn.bottom&&(e.y=n.bottom-t.height-s),e}onResize(){this.calculatePosition()}onCaptureEvent(e){e.target instanceof Node&&this.contains(e.target)||this.close()}onEatEvent(e){console.log("Popup.onEatEvent"),e.stopPropagation(),e.preventDefault()}};s([(0,i.Cb)({attribute:!1})],r.prototype,"anchor",void 0),s([(0,i.Cb)({attribute:!1})],r.prototype,"portal",void 0),s([(0,i.Cb)({type:String})],r.prototype,"position",void 0),s([(0,i.Cb)({type:String})],r.prototype,"align",void 0),s([(0,i.Cb)({type:String})],r.prototype,"justify",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"positionX",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"positionY",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"offsetX",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"offsetY",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"keepVisible",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"modal",void 0),r=s([(0,i.Mo)("ff-popup")],r);const o=r},39229:(e,t,n)=>{"use strict";var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let o=i=class extends s.ZP{constructor(){super(),this.direction="horizontal",this.width=5,this.margin=20,this.detached=!1,this._isActive=!1,this._offset=0,this._position=0,this.addEventListener("pointerdown",(e=>this.onPointerDown(e))),this.addEventListener("pointermove",(e=>this.onPointerMove(e))),this.addEventListener("pointerup",(e=>this.onPointerUpOrCancel(e))),this.addEventListener("pointercancel",(e=>this.onPointerUpOrCancel(e)))}get position(){return this._position}isHorizontal(){return"horizontal"===this.direction}update(e){super.update(e);const t=this.isHorizontal(),n=this.width;this.setStyle({padding:t?`0 ${n}px`:`${n}px 0`,margin:t?`0 ${-n}px`:-n+"px 0",cursor:t?"col-resize":"row-resize"})}firstUpdated(){this.classList.add("ff-splitter"),this.setAttribute("touch-action","none"),this.setStyle({position:"relative",display:"block",zIndex:"1",touchAction:"none"})}onPointerDown(e){if(e.isPrimary){e.stopPropagation(),e.preventDefault(),this._isActive=!0,this.setPointerCapture(e.pointerId);const t=this.getBoundingClientRect();this._offset=this.isHorizontal()?t.left+.5*t.width-e.clientX:t.top+.5*t.height-e.clientY}}onPointerMove(e){if(e.isPrimary&&this._isActive){e.stopPropagation(),e.preventDefault();const t=this.parentElement;if(!t)return;const n=t.getBoundingClientRect(),s=this.isHorizontal(),r=s?n.width:n.height;let o=this._offset+(s?e.clientX-n.left:e.clientY-n.top),a=o/r;if(!this.detached){const e=this.previousElementSibling,n=this.nextElementSibling;if(e instanceof HTMLElement&&n instanceof HTMLElement){const l=Array.from(t.children);let c=0,h=r,d=!1;l.forEach((t=>{if(t instanceof i)return;if(t===e||t===n)return void(d=!0);const r=t.getBoundingClientRect(),o=s?r.width:r.height;h-=o,d||(c+=o)}));const u=this.margin,p=h-u;o-=c,o=op?p:o;const m=(h-o)/r;a=o/r,e.style.flexBasis=(100*a).toFixed(3)+"%",n.style.flexBasis=(100*m).toFixed(3)+"%",setTimeout((()=>window.dispatchEvent(new CustomEvent("resize"))),0)}}this._position=a,this.dispatchEvent(new CustomEvent(i.changeEvent,{detail:{direction:this.direction,position:this._position,isDragging:!0}}))}}onPointerUpOrCancel(e){e.isPrimary&&(e.stopPropagation(),e.preventDefault(),this._isActive=!1,this.dispatchEvent(new CustomEvent(i.changeEvent,{detail:{direction:this.direction,position:this._position,isDragging:!1}})))}};o.changeEvent="ff-splitter-change",r([(0,s.Cb)({type:String})],o.prototype,"direction",void 0),r([(0,s.Cb)({type:Number})],o.prototype,"width",void 0),r([(0,s.Cb)({type:Number})],o.prototype,"margin",void 0),r([(0,s.Cb)({type:Boolean})],o.prototype,"detached",void 0),o=i=r([(0,s.Mo)("ff-splitter")],o)},13470:(e,t,n)=>{"use strict";var i=n(51120),s=n(53868);const r=new WeakMap,o=(0,s.XM)((e=>t=>{const n=r.get(t);if(void 0===e&&t instanceof s._l){if(void 0!==n||!r.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==n&&t.setValue(e);r.set(t,e)}));var a=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let l=class extends i.ZP{constructor(){super(...arguments),this.name="",this.index=0,this.text="",this.placeholder="",this.readonly=!1,this.align="left",this.maxLength=0,this.initialValue=""}get textArea(){return this.getElementsByTagName("textarea").item(0)}select(){const e=this.textArea;e&&e.select()}focus(){const e=this.textArea;e&&e.focus()}blur(){const e=this.textArea;e&&e.blur()}hasFocus(){const e=document.activeElement.shadowRoot?document.activeElement.shadowRoot.activeElement:document.activeElement;return this.textArea===e}firstConnected(){this.classList.add("ff-control","ff-text-edit")}shouldUpdate(e){return!this.hasFocus()&&super.shouldUpdate(e)}render(){var e;return i.dy``}onKeyDown(e){const t=e.target;"Escape"===e.key&&(this.revert(t),t.blur())}onChange(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!1)}onInput(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!0)}onFocus(e){this.initialValue=e.target.value}onBlur(e){this.commit(e.target),this.requestUpdate()}revert(e){e.value=this.initialValue,this.dispatchChangeEvent(e.value,!1)}commit(e){this.initialValue=e.value,this.dispatchChangeEvent(e.value,!1)}dispatchChangeEvent(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{text:e,isEditing:t}}))}};a([(0,i.Cb)({type:String})],l.prototype,"name",void 0),a([(0,i.Cb)({type:Number})],l.prototype,"index",void 0),a([(0,i.Cb)({type:String})],l.prototype,"text",void 0),a([(0,i.Cb)({type:String})],l.prototype,"placeholder",void 0),a([(0,i.Cb)({type:Boolean})],l.prototype,"readonly",void 0),a([(0,i.Cb)({type:String})],l.prototype,"align",void 0),a([(0,i.Cb)({type:Number})],l.prototype,"maxLength",void 0),l=a([(0,i.Mo)("ff-text-edit")],l)},41029:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{static registerType(e){if(this.types[e.typeName])throw new Error(`Annotation type '${e.typeName}' already registered.`);this.types[e.typeName]=e}static registerDefaultType(e){this.defaultType=e}static get typeNames(){return[this.defaultTypeName,...Object.keys(this.types).sort()]}static get defaultTypeName(){return this.defaultType.typeName}static getType(e){const t=this.types[e]||this.defaultType;if(!t)throw new Error(`type '${e}' not registered and no default type set.`);return t}static createInstance(e,t,n){return"Circle"===(t=t||e.data.style)?new(this.getType(t))(e,n):new(this.getType(t))(e)}}i.types={},i.defaultType=null},56752:(e,t,n)=>{"use strict";n.d(t,{m$:()=>v,ZP:()=>g});var i,s=n(19588),r=n(60531),o=n(94608),a=(n(44466),n(34287)),l=(n(98595),n(13470),n(53310)),c=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let h=i=class extends a.ZP{constructor(e,t){super(),this.content=null,this.sprite=null,this.resizeObserver=null,this.close=this.close.bind(this),this.content=e,this.title=t.annotation.title,this.sprite=t,this.position="center",this.modal=!0}static show(e,t,n){const s=new i(t,n);return e.appendChild(s),new Promise(((e,t)=>{s.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-annotation-overlay","sv-annotation")}connected(){super.connected(),this.sprite.addEventListener("link",this.close),this.resizeObserver||(this.resizeObserver=new ResizeObserver((()=>this.onResize()))),this.resizeObserver.observe(this)}disconnected(){this.resizeObserver.disconnect(),this.sprite.removeEventListener("link",this.close),super.disconnected()}render(){return a.dy` -
this.discardEvents(e)} @pointerdown=${e=>this.discardEvents(e)} aria-label="Annotation pop-up" @keydown=${e=>this.onKeyDownMain(e)}> -
-
${this.title}
- -
-
- `}firstUpdated(e){super.firstUpdated(e);this.querySelector("#anno_container").append(this.content)}onKeyDownMain(e){"Escape"===e.code?this.close():"Tab"===e.code&&(0,l.e)((0,l.G)(this),e)}tabReset(e){const t=e.target instanceof Element?e.target:null;if(t){const e=Array.from(t.parentElement.children).find((e=>e.hasAttribute("selected")));e!==t&&(t.setAttribute("tabIndex","-1"),e.setAttribute("tabIndex","0"))}}discardEvents(e){e.stopPropagation()}};h=i=c([(0,a.Mo)("sv-annotation-overlay")],h);const d=h,u=new s.P(0,1,0),p=new s.P,m=new s.P,f=new s.P;class g extends o.ZP{constructor(e,t){super(),this.isAdaptive=!0,this.isAnimating=!1,this.assetManager=null,this.audioManager=null,this.annotation=e,this.matrixAutoUpdate=!1}get typeName(){return this.constructor.typeName}update(){super.update();const e=this.annotation.data;this.position.fromArray(e.position),p.fromArray(e.direction).normalize(),this.quaternion.setFromUnitVectors(u,p),this.updateMatrix()}emitClickEvent(){const e={type:"click",annotation:this.annotation,sprite:this};this.dispatchEvent(e)}emitLinkEvent(e){const t={type:"link",annotation:this.annotation,sprite:this,link:e};this.dispatchEvent(t)}isBehindCamera(e,t){let n=null;n=t instanceof r.H&&t.cameras.length>0?t.cameras[0]:t;const i=n.matrixWorld.elements;return e.updateMatrixWorld(),m.setFromMatrixPosition(e.matrixWorld),f.setFromMatrixPosition(n.matrixWorld),p.set(-i[8],-i[9],-i[10]).normalize(),f.addScaledVector(p,n.near),f.sub(m),f.angleTo(p)<=Math.PI/2}}g.typeName="Annotation";class v extends o.KB{constructor(e){super(),this.isTruncated=!1,this.isOverlayed=!1,this.sprite=e,this.discardEvent=this.discardEvent.bind(this),this.addEventListener("pointercancel",this.discardEvent),this.addEventListener("click",this.discardEvent)}get truncated(){return this.isTruncated}set truncated(e){this.isTruncated=e}get overlayed(){return this.isOverlayed}set overlayed(e){this.isOverlayed=e}firstConnected(){super.firstConnected(),this.classList.add("sv-annotation")}discardEvent(e){e.stopPropagation()}showOverlay(e){this.requestUpdate().then((()=>{d.show(this.parentElement,e,this.sprite).then((()=>{this.overlayed=!1,this.append(e),this.requestUpdate()}))}))}}},10160:(e,t,n)=>{"use strict";var i=n(19588),s=n(29187),r=n(8035),o=n(75809),a=n(24479),l=n(51120),c=n(28581),h=n(47855),d=(n(98595),n(56752)),u=n(41029),p=n(19853),m=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const f=new h.ZP,g=new i.P(0,0,0),v=new i.P,y=new i.P,b=new i.P,_=new i.P;class x extends d.ZP{constructor(e){super(e),this.adaptive=!0,this.offset=new s.Z,this.offset.matrixAutoUpdate=!1,this.add(this.offset),this.anchorMesh=new r.K(new o.u,new a.v),this.anchorMesh.frustumCulled=!1,this.anchorMesh.matrixAutoUpdate=!1,this.offset.add(this.anchorMesh),this.update()}dispose(){this.offset=null,this.anchorMesh=null,super.dispose()}update(){const e=this.annotation.data;this.anchorMesh.scale.setScalar(e.scale),this.anchorMesh.position.y=e.offset,this.anchorMesh.updateMatrix(),super.update()}renderHTMLElement(e,t,n){super.renderHTMLElement(e,t,n,this.anchorMesh,g);const i=this.anchorMesh;v.set(0,0,0),v.applyMatrix4(i.modelViewMatrix),y.set(0,1,0),y.applyMatrix4(i.modelViewMatrix),b.copy(y).sub(v).normalize(),_.set(0,0,1),this.viewAngle=b.angleTo(_);const s=c.Z.scaleLimit(this.viewAngle*c.Z.RAD2DEG,90,100,1,0),r=this.annotation.data.visible?s:0;e.setOpacity(r);const o=this.annotation.data,a=o.visible;this.offset.visible=a,this.adaptive!==this.isAdaptive&&(this.isAdaptive||(e.truncated=!1,e.classList.remove("sv-short"),e.requestUpdate()),this.adaptive=this.isAdaptive),this.setVisible(!this.isBehindCamera(this.offset,n)&&a),this.getVisible()||e.setVisible(this.getVisible()),this.adaptive&&!this.isAnimating&&o.expanded&&(e.truncated||(e.classList.contains("sv-expanded")?(this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth):e.requestUpdate().then((()=>{this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth,this.checkTruncate(e,t)}))),this.checkTruncate(e,t))}createHTMLElement(){return new w(this)}checkTruncate(e,t){e.getBoundingClientRect().left,t.getBoundingClientRect().left;const n=e.getBoundingClientRect().top-t.getBoundingClientRect().top+this.originalHeight>=t.offsetHeight;n!==e.truncated?(e.truncated=n,e.requestUpdate().then((()=>{this.checkBounds(e,t)}))):this.checkBounds(e,t)}checkBounds(e,t){const n=e.getBoundingClientRect().left-t.getBoundingClientRect().left,i=e.getBoundingClientRect().top-t.getBoundingClientRect().top;n+e.offsetWidth>=t.offsetWidth&&!e.classList.contains("sv-align-right")?(e.classList.add("sv-align-right"),e.requestUpdate()):n+e.offsetWidth=t.offsetHeight&&!e.classList.contains("sv-align-bottom")?(e.classList.add("sv-align-bottom"),e.requestUpdate()):i+e.offsetHeight0),s=this.sprite.audioManager;this.markerElement.innerText=n.marker;const r=l.dy` - ${this.isOverlayed?null:l.dy`
${t.title}
`} - ${n.imageUri&&!i?l.dy`
${t.imageAltText}${t.imageCredit?l.dy`
${t.imageCredit}
`:null}
`:null} - ${i?null:l.dy`

${(0,p.A)(t.lead)}

`} - ${n.audioId&&!this.isOverlayed?l.dy`
`:null} - ${n.articleId&&!i?l.dy``:null} - ${i?l.dy``:null}`;(0,l.sY)(r,this.contentElement),f.fromArray(n.color),this.markerElement.style.borderColor=f.toString(),this.isExpanded&&(this.contentElement.style.height="auto"),this.isExpanded===n.expanded||this.overlayed||(this.isExpanded=n.expanded,this.isExpanded?(n.audioId&&this.querySelector("#audio_container").append(s.getPlayerById(n.audioId)),this.classList.add("sv-expanded"),this.contentElement.style.display="block",this.contentElement.style.height="auto"):(this.classList.remove("sv-expanded"),this.contentElement.style.display="none",s.activeId==n.audioId&&this.sprite.audioManager.stop())),this.isExpanded&&(this.contentElement.style.removeProperty("transform"),this.classList.contains("sv-align-right")&&(this.contentElement.style.transform=`translateX(-${this.offsetWidth}px)`),this.classList.contains("sv-align-bottom")&&(this.contentElement.style.transform=`translateY(-${this.offsetHeight-this.markerElement.offsetHeight}px)`));const o=this.querySelector(".sv-audio-view");if(n.audioId&&!this.overlayed)if(n.expanded&&!o){this.querySelector("#audio_container").append(s.getPlayerById(n.audioId))}else!n.expanded&&o&&s.activeId==n.audioId&&s.stop()}onClickMarker(e){this.contentElement.style.display="block",e.stopPropagation(),this.sprite.emitClickEvent()}onClickArticle(e){e.stopPropagation(),this.sprite.emitLinkEvent(this.sprite.annotation.data.articleId)}onClickOverlay(e){e.stopPropagation();const t=this.contentElement;this.overlayed=!0,this.showOverlay(t)}onClickAudio(e){e.stopPropagation()}onKeyDown(e){"Space"!==e.code&&"Enter"!==e.code||(e.stopPropagation(),this.sprite.emitClickEvent())}};w=m([(0,l.Mo)("sv-circle-annotation")],w)},13301:(e,t,n)=>{"use strict";var i=n(19588),s=n(75809),r=n(64026),o=n(93122),a=n(28581),l=n(47855),c=n(51120),h=n(19853),d=(n(98595),n(56752)),u=n(41029),p=n(94608),m=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const f=["sv-q0","sv-q1","sv-q2","sv-q3"],g=new l.ZP,v=new i.P(0,1,0);class y extends d.ZP{constructor(e){super(e),this.quadrant=-1,this.adaptive=!0;const t=[];t.push(new i.P(0,0,0)),t.push(new i.P(0,1,0));const n=(new s.u).setFromPoints(t),a=new r.n({color:"#009cde",transparent:!0});a.toneMapped=!1,this.stemLine=new o.x(n,a),this.stemLine.frustumCulled=!1,this.stemLine.matrixAutoUpdate=!1,this.add(this.stemLine),this.update()}update(){const e=this.annotation.data;this.stemLine.scale.setScalar(e.scale),this.stemLine.position.y=e.offset,this.stemLine.updateMatrix();this.stemLine.material.color.fromArray(e.color),super.update()}renderHTMLElement(e,t,n){super.renderHTMLElement(e,t,n,this.stemLine,v);const i=a.Z.scaleLimit(this.viewAngle*a.Z.RAD2DEG,90,100,1,0),s=this.annotation.data.visible?i:0;if(this.stemLine.material.opacity=s,e.setOpacity(s),this.orientationQuadrant!==this.quadrant&&(e.classList.remove(f[this.quadrant]),e.classList.add(f[this.orientationQuadrant]),this.quadrant=this.orientationQuadrant),this.adaptive!==this.isAdaptive&&(this.isAdaptive?e.classList.remove("sv-static-width"):(e.classList.add("sv-static-width"),e.truncated=!1,e.classList.remove("sv-short"),e.requestUpdate()),this.adaptive=this.isAdaptive),this.setVisible(!this.isBehindCamera(this.stemLine,n)),this.adaptive&&!this.isAnimating&&this.annotation.data.expanded){if(!e.truncated){if(!e.classList.contains("sv-expanded"))return void e.requestUpdate().then((()=>{this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth,this.checkTruncate(e,t)}));this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth}this.checkTruncate(e,t)}}createHTMLElement(){return new b(this)}checkTruncate(e,t){const n=this.quadrant==p.hf.TopLeft||this.quadrant==p.hf.TopRight,i=this.quadrant==p.hf.TopRight||this.quadrant==p.hf.BottomRight,s=i?e.getBoundingClientRect().left-t.getBoundingClientRect().left:e.getBoundingClientRect().right-t.getBoundingClientRect().left,r=n?e.getBoundingClientRect().bottom-t.getBoundingClientRect().top:e.getBoundingClientRect().top-t.getBoundingClientRect().top,o=n?r-this.originalHeight<=0:r+this.originalHeight>=t.offsetHeight,a=i?s+this.originalWidth>=t.offsetWidth:s-this.originalWidth<=0,l=o||a;l!==e.truncated&&(e.truncated=l,l?e.classList.add("sv-short"):e.classList.remove("sv-short"),e.requestUpdate().then((()=>{})))}}y.typeName="Extended",u.Z.registerType(y);let b=class extends d.m${constructor(e){super(e),this.isExpanded=void 0,this.onClickTitle=this.onClickTitle.bind(this),this.onClickArticle=this.onClickArticle.bind(this),this.onClickAudio=this.onClickAudio.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onClickOverlay=this.onClickOverlay.bind(this),this.titleElement=this.appendElement("div"),this.titleElement.classList.add("sv-title"),this.titleElement.addEventListener("click",this.onClickTitle),this.wrapperElement=this.appendElement("div"),this.contentElement=this.createElement("div",null,this.wrapperElement),this.contentElement.classList.add("sv-annotation-body"),this.contentElement.style.display="none"}firstConnected(){super.firstConnected(),this.classList.add("sv-extended-annotation")}update(e){super.update(e);const t=this.sprite.annotation,n=this.sprite.annotation.data,i=this.sprite.audioManager,s=!this.overlayed&&this.truncated&&(n.imageUri||n.articleId||t.lead.length>0);this.titleElement.innerText=this.sprite.annotation.title;const r=c.dy` - ${n.imageUri&&!s?c.dy`
${t.imageAltText}${t.imageCredit?c.dy`
${t.imageCredit}
`:null}
`:null} - ${s?null:c.dy`

${(0,h.A)(t.lead)}

`} - ${n.audioId&&!this.overlayed?c.dy`
`:null} - ${n.articleId&&!s?c.dy``:null} - ${s?c.dy``:null}`;(0,c.sY)(r,this.contentElement),g.fromArray(n.color),this.style.borderColor=g.toString(),this.isExpanded&&(this.contentElement.style.height="auto"),this.isExpanded===n.expanded||this.overlayed||(this.isExpanded=n.expanded,this.isExpanded?(n.audioId&&this.querySelector("#audio_container").append(i.getPlayerById(n.audioId)),this.classList.add("sv-expanded"),this.style.minWidth=this.sprite.annotation.lead.length<40&&(!n.audioId||0==n.audioId.length)?"0":"",this.contentElement.style.display="block",this.contentElement.style.height="auto"):(this.classList.remove("sv-expanded"),this.contentElement.style.height="0",this.contentElement.style.display="none",i.activeId==n.audioId&&this.sprite.audioManager.stop()));const o=this.querySelector(".sv-audio-view");if(n.audioId&&!this.overlayed)if(n.expanded&&!o){this.querySelector("#audio_container").append(i.getPlayerById(n.audioId))}else!n.expanded&&o&&i.activeId==n.audioId&&i.stop()}onClickTitle(e){e.stopPropagation(),this.sprite.emitClickEvent()}onClickArticle(e){e.stopPropagation(),this.sprite.emitLinkEvent(this.sprite.annotation.data.articleId)}onClickAudio(e){e.stopPropagation()}onClickOverlay(e){e.stopPropagation();const t=this.contentElement;this.overlayed=!0,this.showOverlay(t)}onKeyDown(e){"Space"!==e.code&&"Enter"!==e.code||(e.stopPropagation(),this.sprite.emitClickEvent())}};b=m([(0,c.Mo)("sv-extended-annotation")],b)},91013:(e,t,n)=>{"use strict";var i=n(19588),s=n(75809),r=n(64026),o=n(93122),a=n(28581),l=n(47855),c=n(51120),h=(n(98595),n(56752)),d=n(41029),u=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const p=["sv-q0","sv-q1","sv-q2","sv-q3"],m=new l.ZP,f=new i.P(0,1,0);class g extends h.ZP{constructor(e){super(e),this.quadrant=-1,this.adaptive=!0;const t=[];t.push(new i.P(0,0,0)),t.push(new i.P(0,1,0));const n=(new s.u).setFromPoints(t),a=new r.n({color:"#009cde",transparent:!0});a.toneMapped=!1,this.stemLine=new o.x(n,a),this.stemLine.frustumCulled=!1,this.stemLine.matrixAutoUpdate=!1,this.add(this.stemLine),this.update()}update(){const e=this.annotation.data;this.stemLine.scale.setScalar(e.scale),this.stemLine.position.y=e.offset,this.stemLine.updateMatrix();this.stemLine.material.color.fromArray(e.color),super.update()}renderHTMLElement(e,t,n){super.renderHTMLElement(e,t,n,this.stemLine,f);const i=a.Z.scaleLimit(this.viewAngle*a.Z.RAD2DEG,90,100,1,0),s=this.annotation.data.visible?i:0;this.stemLine.material.opacity=s,e.setOpacity(s),this.orientationQuadrant!==this.quadrant&&(e.classList.remove(p[this.quadrant]),e.classList.add(p[this.orientationQuadrant]),this.quadrant=this.orientationQuadrant),this.adaptive!==this.isAdaptive&&(this.isAdaptive?e.classList.remove("sv-static-width"):e.classList.add("sv-static-width"),this.adaptive=this.isAdaptive),this.setVisible(!this.isBehindCamera(this.stemLine,n))}createHTMLElement(){return new v(this)}}g.typeName="Standard",d.Z.registerDefaultType(g);let v=class extends h.m${constructor(e){super(e),this.onClickTitle=this.onClickTitle.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.titleElement=this.appendElement("div"),this.titleElement.classList.add("sv-title"),this.titleElement.addEventListener("click",this.onClickTitle)}firstConnected(){super.firstConnected(),this.classList.add("sv-standard-annotation")}update(e){super.update(e);const t=this.sprite.annotation.data;t.viewId.length?this.classList.add("sv-enable-events"):this.classList.remove("sv-enable-events"),this.titleElement.innerText=this.sprite.annotation.title,m.fromArray(t.color),this.style.borderColor=m.toString()}onClickTitle(e){e.stopPropagation(),this.sprite.emitClickEvent()}onKeyDown(e){"Space"!==e.code&&"Enter"!==e.code||(e.stopPropagation(),this.sprite.emitClickEvent())}};v=u([(0,c.Mo)("sv-standard-annotation")],v)},13772:(e,t,n)=>{"use strict";n.d(t,{Z:()=>ee});var i=n(31741),s=n(96561),r=n(26041),o=n(10564),a=n(56166),l=n(89167),c=n(31491),h=n(22040),d=(n(98595),n(18257),n(85203),n(44661)),u=n(97008),p=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class m extends u.ZP{createView(){return new f(this)}}m.typeName="CVViewTool",m.text="View",m.icon="eye";let f=class extends u.v5{firstConnected(){super.firstConnected(),this.classList.add("sv-view-tool-view")}render(){const e=this.activeDocument;if(!e)return u.dy``;this.tool;const t=e.setup.navigation,n=e.setup.language,i=t.ins.projection,s=t.ins.preset,r=t.ins.zoomExtents,o=[d.LY.Front,d.LY.Back,d.LY.Left,d.LY.Right,d.LY.Top,d.LY.Bottom];return u.dy``}onActiveDocument(e,t){this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};f=p([(0,u.Mo)("sv-view-tool-view")],f);var g=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class v extends u.ZP{createView(){return new y(this)}}v.typeName="CVRenderTool",v.text="Material",v.icon="palette";let y=class extends u.v5{constructor(){super(...arguments),this.viewer=null}firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-render-tool-view")}render(){this.tool;const e=this.activeDocument,t=this.viewer;if(!t)return u.dy``;const n=t.ins.shader,i=e.setup.language;return u.dy`
-
- -
-
`}onActiveDocument(e,t){this.viewer&&(this.viewer.ins.shader.off("value",this.onUpdate,this),this.viewer=null),t&&(this.viewer=t.setup.viewer,this.viewer.ins.shader.on("value",this.onUpdate,this))}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};y=g([(0,u.Mo)("sv-render-tool-view")],y);var b=n(76969),_=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class x extends u.ZP{createView(){return new w(this)}}x.typeName="CVEnvironmentTool",x.text="Environment",x.icon="environment";let w=class extends u.v5{firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-environment-tool-view")}render(){this.tool;if(!this.activeDocument)return u.dy`No active document`;const e=this.activeDocument.setup,t=e.grid,n=e.floor,i=e.background,s=i.ins.style.getValidatedValue()===b.u.Solid,r=e.environment,o=e.language;return u.dy`
-
- - - ${s?null:u.dy``} - - - - - -
-
`}onActiveDocument(e,t){if(e){e.setup.background.ins.style.off("value",this.onUpdate,this)}if(t){t.setup.background.ins.style.on("value",this.onUpdate,this)}this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};w=_([(0,u.Mo)("sv-environment-tool-view")],w);var S=n(16967),M=(n(97010),n(90470),n(46436),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});class E extends u.ZP{constructor(){super(...arguments),this.lights=[],this.ins=this.addInputs(E.ins),this.outs=this.addOutputs(E.outs)}update(e){return this.outs.light.setValue(this.lights[this.ins.light.getValidatedValue()]),!0}createView(){return new T(this)}onActiveDocument(e,t){this.lights=t?t.getInnerComponents(S.Z):[],this.ins.light.setOptions(this.lights.map((e=>e.node.name))),this.outs.light.setValue(this.lights[0]),super.onActiveDocument(e,t)}}E.typeName="CVLightTool",E.text="Lights",E.icon="bulb",E.ins={light:u.V5.Option("Tool.Light",[])},E.outs={light:u.V5.Object("Tool.SelectedLight",S.Z)};let T=class extends u.v5{constructor(){super(...arguments),this.lights=null}firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-light-tool-view")}connected(){super.connected(),this.tool.outs.light.on("value",this.onUpdate,this)}disconnected(){this.tool.outs.light.off("value",this.onUpdate,this),super.disconnected()}render(){const e=this.tool,t=e.lights,n=this.activeDocument;if(!t||!n)return u.dy`No editable lights in this scene.`;const i=e.outs.light.value,s=n.setup.navigation,r=n.setup.language,o=i?u.dy`
- -
- - - -
-
`:null;return u.dy`${o}
-
- - -
-
`}onActiveDocument(e,t){e&&e.setup.navigation.ins.lightsFollowCamera.off("value",this.onUpdate,this),t&&t.setup.navigation.ins.lightsFollowCamera.on("value",this.onUpdate,this),this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};T=M([(0,u.Mo)("sv-light-tool-view")],T);n(77804);var C=n(29767),A=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class P extends u.ZP{createView(){return new R(this)}}P.typeName="CVTapeTool",P.text="Measure",P.icon="tape";let R=class extends u.v5{constructor(){super(...arguments),this.firstRender=!0,this.statusMsg=""}firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-tape-tool-view")}render(){const e=this.activeDocument;if(!e)return u.dy``;this.tool;const t=e.setup.tape,n=t.ins.enabled,i=t.outs.state.value,s=t.outs.distance.value,r=e.setup.language;let o;if(n.value)if(0===s)o=r.getLocalizedString("Tap on model to set start of tape")+".";else if(i===C.T.SetStart){const t=e.root.scene.ins.units.getOptionText();o=`${s.toFixed(2)} ${t}`}else o=r.getLocalizedString("Tap on model to set end of tape")+".";else o=r.getLocalizedString("Switch on to take measurements")+".";return this.statusMsg=o,u.dy`
-
- -
-
-
`}updated(e){super.updated(e);const t=this.getElementsByClassName("ff-string").item(0);t&&(t.innerHTML=this.statusMsg,this.firstRender&&(setTimeout((()=>{t.innerHTML=`
${this.statusMsg}
`}),200),this.firstRender=!1))}onActiveDocument(e,t){e&&e.setup.tape.off("update",this.onUpdate,this),t&&t.setup.tape.on("update",this.onUpdate,this),this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("ff-button")[1].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};R=A([(0,u.Mo)("sv-tape-tool-view")],R);var L=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class N extends u.ZP{createView(){return new D(this)}}N.typeName="CVSliceTool",N.text="Slice",N.icon="knife";let D=class extends u.v5{firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-slice-tool-view")}render(){const e=this.activeDocument;if(!e)return u.dy``;this.tool;const t=e.setup.slicer,n=t.ins.enabled,i=t.ins.axis,s=t.ins.position,r=e.setup.language;return u.dy`
-
- - - -
-
`}onActiveDocument(e,t){this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("ff-button")[1].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};D=L([(0,u.Mo)("sv-slice-tool-view")],D);var I=n(90199);class O extends I.Z{get toolProvider(){return this.getComponent(h.Z)}createComponents(){this.createComponent(h.Z),this.createComponent(m),this.createComponent(v),this.createComponent(x),this.createComponent(E),this.createComponent(P),this.createComponent(N)}}O.typeName="NVTools";const U=[c.Z,h.Z,m,v,x,E,P,N,O];var k=n(47227),V=n(25864),z=n(63872),F=n(68327),B=n(11359),$=n(38303),j=n(87203),H=n(94860),G=n(43875),Z=n(30242),W=n(40490),q=n(60206),X=n(15271),Y=n(88300),K=n(26629),J=n(51462),Q=n(1594);class ee{constructor(e,t,n){this.props=t||{},console.log(ee.splashMessage);const i=new r.Z;i.add(l.Z),i.add(U),this.commander=new s.Z;const o=this.system=new a.Z(i),c=o.graph.createCustomNode($.Z);o.graph.createCustomNode(O),o.graph.createCustomNode(j.Z),this.analytics.startTimer(),e&&new H.Z(this).appendTo(e),n||(this.documentProvider.createDocument(k),this.evaluateProps());(/^(iPad|iPhone|iPod)/.test(window.navigator.platform)||/^Mac/.test(window.navigator.platform)&&window.navigator.maxTouchPoints>1)&&(window.createImageBitmap=void 0),c.pulse.start()}get assetManager(){return this.system.getMainComponent(z.Z)}get assetReader(){return this.system.getMainComponent(F.Z)}get documentProvider(){return this.system.getMainComponent(V.Z)}get analytics(){return this.system.getMainComponent(B.Z)}dispose(){this.assetReader.dispose(),this.documentProvider.activeComponent.clearNodeTree(),this.system.getMainComponent(X.Z).views.forEach((e=>e.dispose()))}setBaseUrl(e){this.assetManager.baseUrl=e}loadDocument(e,t,n){const i=G.$l[n];return this.assetReader.getJSON(e).then((n=>(t=void 0===t?!n.lights&&!n.cameras:t,this.documentProvider.amendDocument(n,e,t)))).then((e=>(isFinite(i)&&e.setup.viewer.ins.quality.setValue(i),e)))}reloadDocument(){this.documentProvider.removeActiveDocument(),this.documentProvider.createDocument(k),this.evaluateProps()}loadModel(e,t){return this.documentProvider.appendModel(e,t)}loadGeometry(e,t,n,i,s){return this.documentProvider.appendGeometry(e,t,n,i,s)}evaluateProps(){const e=this.props,t=this.assetManager;e.root=e.root||(0,i.Z)("root")||(0,i.Z)("r"),e.dracoRoot=e.dracoRoot||(0,i.Z)("dracoRoot")||(0,i.Z)("dr"),e.resourceRoot=e.resourceRoot||(0,i.Z)("resourceRoot")||(0,i.Z)("rr"),e.document=e.document||(0,i.Z)("document")||(0,i.Z)("d"),e.model=e.model||(0,i.Z)("model")||(0,i.Z)("m"),e.geometry=e.geometry||(0,i.Z)("geometry")||(0,i.Z)("g"),e.texture=e.texture||(0,i.Z)("texture")||(0,i.Z)("t"),e.occlusion=e.occlusion||(0,i.Z)("occlusion")||(0,i.Z)("o"),e.normals=e.normals||(0,i.Z)("normals")||(0,i.Z)("n"),e.quality=e.quality||(0,i.Z)("quality")||(0,i.Z)("q"),e.uiMode=e.uiMode||(0,i.Z)("uiMode")||(0,i.Z)("u"),e.bgColor=e.bgColor||(0,i.Z)("bgColor")||(0,i.Z)("bc"),e.bgStyle=e.bgStyle||(0,i.Z)("bgStyle")||(0,i.Z)("bs"),e.controls=e.controls||(0,i.Z)("controls")||(0,i.Z)("ct"),e.prompt=e.prompt||(0,i.Z)("prompt")||(0,i.Z)("pm"),e.reader=e.reader||(0,i.Z)("reader")||(0,i.Z)("rdr"),e.lang=e.lang||(0,i.Z)("lang")||(0,i.Z)("l");const n=e.root||e.document||e.model||e.geometry;if(this.setBaseUrl(new URL(n||".",window.location).href),e.uiMode){let t=0,n=!1;const i=Object.values(W.p).filter((e=>"string"==typeof e));e.uiMode.split("|").forEach((e=>{const s=e.toLowerCase();i.includes(s)&&(t+=W.p[s],n=!0)})),n&&this.documentProvider.activeComponent.setup.interface.ins.visibleElements.setValue(t)}e.dracoRoot&&this.assetReader.setDracoPath(e.dracoRoot),e.resourceRoot&&this.assetReader.setSystemAssetPath(e.resourceRoot),e.lang&&this.setLanguage(e.lang),e.document?(e.document=t.getAssetName(e.document),this.loadDocument(e.document,void 0,e.quality).then((()=>this.postLoadHandler(e))).catch((e=>o.ZP.show(`Failed to load document: ${e.message}`,"error")))):e.model?(e.model=t.getAssetName(e.model),this.assetReader.getText(e.model).then((()=>{this.loadModel(e.model,e.quality),this.postLoadHandler(e)})).catch((e=>o.ZP.show(`Bad Model Path: ${e.message}`,"error")))):e.geometry?(e.geometry=t.getAssetName(e.geometry),e.texture=t.getAssetName(e.texture),e.occlusion=t.getAssetName(e.occlusion),e.normals=t.getAssetName(e.normals),this.assetReader.getText(e.geometry).then((()=>{this.loadGeometry(e.geometry,e.texture,e.occlusion,e.normals,e.quality),this.postLoadHandler(e)})).catch((e=>o.ZP.show(`Bad Geometry Path: ${e.message}`,"error")))):e.root&&this.loadDocument("scene.svx.json",void 0).then((()=>this.postLoadHandler(e))).catch((()=>{}))}postLoadHandler(e){if(this.assetManager.ins.baseUrlValid.setValue(!0),e.bgColor){const t=e.bgColor.split(" ");this.setBackgroundColor(t[0],t[1]||null)}e.bgStyle&&this.setBackgroundStyle(e.bgStyle),e.controls&&this.enableNavigation(e.controls),e.prompt&&this.enablePrompt(e.prompt),e.reader&&this.enableReader(e.reader)}toggleAnnotations(){const e=this.system.getMainComponent(V.Z).activeComponent.setup.viewer.ins,t=this.system.getMainComponent(h.Z).ins;t.visible.value&&t.visible.setValue(!1),e.annotationsVisible.setValue(!e.annotationsVisible.value),this.analytics.sendProperty("Annotations_Visible",e.annotationsVisible.value)}toggleReader(){const e=this.system.getMainComponent(V.Z).activeComponent.setup.reader,t=e.ins;t.enabled.setValue(!t.enabled.value),t.focus.setValue(t.enabled.value),t.enabled.value&&t.articleId.setValue(1===e.articles.length?e.articles[0].article.id:""),this.analytics.sendProperty("Reader_Enabled",t.enabled.value)}toggleTours(){const e=this.system.getMainComponent(V.Z).activeComponent.setup.tours.ins,t=this.system.getMainComponent(V.Z).activeComponent.setup.reader.ins;e.enabled.value?e.enabled.setValue(!1):(t.enabled.value&&t.enabled.setValue(!1),e.enabled.setValue(!0),e.tourIndex.setValue(-1)),this.analytics.sendProperty("Tours_Enabled",e.enabled.value)}toggleTools(){const e=this.system.getMainComponent(h.Z).ins,t=this.system.getMainComponent(V.Z).activeComponent.setup.viewer.ins;t.annotationsVisible.value&&t.annotationsVisible.setValue(!1),e.visible.setValue(!e.visible.value),this.analytics.sendProperty("Tools_Visible",e.visible.value)}toggleMeasurement(){const e=this.system.getMainComponent(V.Z).activeComponent.setup.tape.ins;e.visible.setValue(!e.visible.value)}enableAR(){this.system.getMainComponent(Z.Z).ins.enabled.setValue(!0),this.analytics.sendProperty("AR_enabled",!0)}getArticles(){return this.system.getMainComponent(V.Z).activeComponent.setup.reader.articles.map((e=>e.article.data))}getAnnotations(){const e=this.system.getComponent(K.Z).getGraphComponents(J.Z);let t=[];return e.forEach((e=>{t=t.concat(e.getAnnotations())})),t}getCameraOrbit(e){const t=this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins;let n=t.orbit.value;if(e){const i=e.toLowerCase();if("max"===i)n=t.maxOrbit.value;else if("min"===i)n=t.minOrbit.value;else if("active"!==i)return void console.error("Error: getCameraOrbit invalid type param.")}return n.slice(0,2)}setCameraOrbit(e,t){const n=this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins,i=parseFloat(e),s=parseFloat(t);isNaN(i)||isNaN(s)?console.error("Error: setCameraOrbit param is not a number."):n.orbit.setValue([i,s,0])}getCameraOffset(e){const t=this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins;let n=t.offset.value;if(e){const i=e.toLowerCase();if("max"===i)n=t.maxOffset.value;else if("min"===i)n=t.minOffset.value;else if("active"!==i)return void console.error("Error: getCameraOffset invalid type param.")}return n.slice(0,3)}setCameraOffset(e,t,n){const i=this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins;let s=parseFloat(e),r=parseFloat(t),o=parseFloat(n);if(isNaN(s)||isNaN(r)||isNaN(o))console.error("Error: setCameraOffset param is not a number.");else{const e=i.minOffset.value,t=i.maxOffset.value;s=(0,Y.u)(s,e[0],t[0]),r=(0,Y.u)(r,e[1],t[1]),o=(0,Y.u)(o,e[2],t[2]),i.offset.setValue([s,r,o])}}setBackgroundColor(e,t){const n=this.system.getMainComponent(V.Z).activeComponent.setup.background.ins,i=document.createElement("div");if(i.id="temp-color",i.style.color=e,document.body.appendChild(i),""!==i.style.color){const e=getComputedStyle(i).color.split("(")[1].split(")")[0].split(",").map((e=>parseInt(e)/255));n.color0.setValue(e)}else console.error("Error: Color0 param is invalid.");if(t)if(i.style.color=t,""!==i.style.color){const e=getComputedStyle(i).color.split("(")[1].split(")")[0].split(",").map((e=>parseInt(e)/255));n.color1.setValue(e)}else console.error("Error: Color1 param is invalid.");document.body.removeChild(i)}setBackgroundStyle(e){const t=this.system.getMainComponent(V.Z).activeComponent.setup.background.ins,n=Object.values(q.u6).filter((e=>"string"==typeof e)).find((t=>t.toLowerCase()===e.toLowerCase()));void 0!==n?t.style.setValue(q.u6[n]):console.error("Error: Style param is invalid.")}setTourStep(e,t,n){const i=this.system.getMainComponent(V.Z).activeComponent.setup.tours.ins,s=this.system.getMainComponent(V.Z).activeComponent.setup.tours.outs;let r=parseInt(e),o=parseInt(t);!isNaN(r)&&!isNaN(o)&&r>=0&&o>=0?(i.tourIndex.setValue(r),n?(s.stepIndex.setValue(o-1),i.next.set()):i.stepIndex.setValue(o)):console.error("Error: setTourStep param ["+r+" "+o+"] is not a valid number.")}enableNavigation(e){const t=this.isTrue(e);if(null!=t){this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins.pointerEnabled.setValue(t)}else console.error("Error: enableNavigation param is not valid.")}enablePrompt(e){const t=this.isTrue(e);if(null!=t){this.system.getMainComponent(V.Z).activeComponent.setup.navigation.ins.promptEnabled.setValue(t)}else console.error("Error: enablePrompt param is not valid.")}enableReader(e){const t=this.isTrue(e);if(null!=t){this.system.getMainComponent(V.Z).activeComponent.setup.reader.ins.visible.setValue(t)}else console.error("Error: enableReader param is not valid.")}setLanguage(e){const t=this.system.getMainComponent(V.Z).activeComponent.setup.language.ins,n=e.toUpperCase();n in Q.PD?t.language.setValue(Q.PD[n]):console.error("Error: setLanguage param is not a valid language id.")}setActiveArticle(e){const t=this.system.getMainComponent(V.Z).activeComponent.setup.reader;t.ins.enabled.setValue(!0),t.ins.articleId.setValue(e)}isTrue(e){let t;const n=e.toLowerCase();return"true"===n?t=!0:"false"===n&&(t=!1),t}}ee.splashMessage="\n _________ .__ __ .__ .__ ________ ________ \n / _____/ _____ |__|/ |_| |__ __________ ____ |__|____ ____ \\_____ \\\\______ \\ \n \\_____ \\ / \\| \\ __\\ | \\ / ___/ _ \\ / \\| \\__ \\ / \\ _(__ < | | \\ \n / \\ Y Y \\ || | | Y \\\\___ ( <_> ) | \\ |/ __ \\| | \\ / \\| ` \\\n/_______ /__|_| /__||__| |___| /____ >____/|___| /__(____ /___| / /______ /_______ /\n \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \n \nVoyager - 3D Explorer and Tool Suite\n3D Foundation Project\n(c) 2024 Smithsonian Institution\n\nhttps://3d.si.edu\nhttps://github.com/smithsonian/dpo-voyager\n\n-----------------------------------------------------\nVersion: Voyager v0.42.1 PROD\n-----------------------------------------------------\n ",window.VoyagerExplorer=ee},89167:(e,t,n)=>{"use strict";n.d(t,{Z:()=>me,J:()=>pe});var i=n(18894),s=n(26220),r=n(63833),o=n(92989),a=n(403),l=n(15271),c=n(38080),h=n(18345),d=n(36283),u=n(90199),p=n(11359),m=n(63872),f=n(68327),g=n(48377),v=n(25864),y=n(26629),b=n(79815),_=n(13227),x=n(84678),w=n(3388),S=n(80038);class M extends S.ZP{constructor(){super(...arguments),this.ins=this.addInputs(M.ins)}get model(){return this.getComponent(w.Z)}update(e){return!0}}M.typeName="CVAnnotations",M.ins={};var E=n(51462),T=n(31105),C=n(27884),A=n(53414),P=n(19588),R=n(54992),L=n(16967);new P.P;class N extends L.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(N.pointLightIns),this.object3D=new R.c}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return n.position.changed&&(t.position.fromArray(n.position.value),t.updateMatrix()),(n.distance.changed||n.decay.changed)&&(t.distance=n.distance.value,t.decay=n.decay.value,t.shadow.camera.near=t.distance?t.distance/800:.5),t.updateMatrix(),!0}}N.typeName="CPointLight",N.pointLightIns={position:S.V5.Vector3("Light.Position"),distance:S.V5.Number("Light.Distance"),decay:S.V5.Number("Light.Decay",1)};class D extends N{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.distance,this.ins.decay,this.ins.shadowEnabled,this.ins.shadowResolution,this.ins.shadowBlur]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){this.ins.shadowEnabled.value&&this.light.shadow.map&&this.light.shadow.map.dispose(),super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==D.type)throw new Error("light type mismatch: not a point light");return n.point=n.point||{},i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,distance:n.point.distance||i.distance.schema.preset,decay:void 0!==n.point.decay?n.point.decay:i.decay.schema.preset,shadowEnabled:n.shadowEnabled||!1,shadowResolution:void 0!==n.shadowResolution&&L.B[n.shadowResolution]||1,shadowBlur:void 0!==n.shadowBlur?n.shadowBlur:i.shadowBlur.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value,point:{distance:n.distance.value,decay:n.decay.value}};i.type=D.type,n.shadowEnabled.value&&(i.shadowEnabled=!0,n.shadowBlur.isDefault()||(i.shadowBlur=n.shadowBlur.value),n.shadowResolution.isDefault()||(i.shadowResolution=L.B[n.shadowResolution.value])),e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}D.typeName="CVPointLight",D.type="point",D.text="Point Light",D.icon="bulb";var I=n(16426),O=n(71050);class U extends L.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(U.spotLightIns),this.object3D=new I.P,this.light.target.matrixAutoUpdate=!1}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return(n.position.changed||n.target.changed)&&(t.position.fromArray(n.position.value),t.target.position.fromArray(n.target.value),t.updateMatrix(),t.target.updateMatrix()),(n.distance.changed||n.decay.changed||n.angle.changed||n.penumbra.changed)&&(t.distance=n.distance.value,t.decay=n.decay.value,t.angle=n.angle.value*O.M8.DEG2RAD,t.penumbra=n.penumbra.value,t.shadow.camera.near=t.distance?t.distance/800:.5),!0}onAddToParent(e){super.onAddToParent(e),e.add(this.light.target)}onRemoveFromParent(e){super.onRemoveFromParent(e),e.remove(this.light.target)}}U.typeName="CSpotLight",U.spotLightIns={position:S.V5.Vector3("Light.Position"),target:S.V5.Vector3("Light.Target",[0,-1,0]),distance:S.V5.Number("Light.Distance"),decay:S.V5.Number("Light.Decay",1),angle:S.V5.Number("Light.Angle",45),penumbra:S.V5.Percent("Light.Penumbra",.5)};class k extends U{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.distance,this.ins.decay,this.ins.angle,this.ins.penumbra,this.ins.shadowEnabled,this.ins.shadowResolution,this.ins.shadowBlur]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){this.ins.shadowEnabled.value&&this.light.shadow.map&&this.light.shadow.map.dispose(),super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==k.type)throw new Error("light type mismatch: not a spot light");return n.spot=n.spot||{},i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,target:i.target.schema.preset,distance:n.spot.distance||i.distance.schema.preset,decay:void 0!==n.spot.decay?n.spot.decay:i.decay.schema.preset,angle:void 0!==n.spot.angle?n.spot.angle:i.angle.schema.preset,penumbra:n.spot.penumbra||i.penumbra.schema.preset,shadowEnabled:n.shadowEnabled||!1,shadowResolution:void 0!==n.shadowResolution&&L.B[n.shadowResolution]||1,shadowBlur:void 0!==n.shadowBlur?n.shadowBlur:i.shadowBlur.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value,spot:{distance:n.distance.value,decay:n.decay.value,angle:n.angle.value,penumbra:n.penumbra.value}};i.type=k.type,n.shadowEnabled.value&&(i.shadowEnabled=!0,n.shadowBlur.isDefault()||(i.shadowBlur=n.shadowBlur.value),n.shadowResolution.isDefault()||(i.shadowResolution=L.B[n.shadowResolution.value])),e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}k.typeName="CVSpotLight",k.type="spot",k.text="Spot Light",k.icon="spot";var V=n(40490),z=n(27643),F=n(5249),B=n(44661),$=n(71507),j=n(97322),H=n(6461),G=n(29767),Z=n(63531),W=n(7134),q=n(74572),X=n(24856),Y=n(30242),K=n(93072),J=n(17467),Q=n(38303),ee=n(87203),te=n(82567),ne=n(75222),ie=n(19816);class se extends ie._{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class re extends L.Z{constructor(e,t){super(e,t),this.object3D=new se}get light(){return this.object3D}}re.typeName="CAmbientLight";class oe extends re{get settingProperties(){return[this.ins.color,this.ins.intensity]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==oe.type)throw new Error("light type mismatch: not an ambient light");return n.point=n.point||{},i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value};i.type=oe.type,e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}oe.typeName="CVAmbientLight",oe.type="ambient",oe.text="Ambient Light",oe.icon="globe";var ae=n(57090);class le extends L.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(le.hemiLightIns),this.object3D=new ae.v}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return(n.ground.changed||n.intensity.changed)&&(t.groundColor.fromArray(n.ground.value),t.intensity=n.intensity.value),!0}}le.typeName="CHemisphereLight",le.hemiLightIns={ground:S.V5.ColorRGB("Light.Ground",[.31,.31,.125])};class ce extends le{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.ground]}get snapshotProperties(){return[this.ins.color,this.ins.intensity,this.ins.ground]}dispose(){super.dispose()}fromDocument(e,t){var n,i;if(!isFinite(t.light))throw new Error("light property missing in node");const s=e.lights[t.light],r=this.ins;if(s.type!==ce.type)throw new Error("light type mismatch: not an hemisphere light");return s.point=s.point||{},r.copyValues({color:void 0!==s.color?s.color:r.color.schema.preset,intensity:void 0!==s.intensity?s.intensity:r.intensity.schema.preset,ground:null!==(i=null===(n=s.hemisphere)||void 0===n?void 0:n.ground)&&void 0!==i?i:r.ground.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value,hemisphere:{ground:n.ground.cloneValue()}};i.type=ce.type,e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}ce.typeName="CVHemisphereLight",ce.type="hemisphere",ce.text="Hemisphere Light",ce.icon="half-sun";var he=n(50910);class de extends L.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(de.rectLightIns),this.object3D=new he.T}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return(n.position.changed||n.target.changed)&&(t.position.fromArray(n.position.value),t.updateMatrix()),!0}}de.typeName="CRectLight",de.rectLightIns={position:S.V5.Vector3("Light.Position",[0,1,0]),target:S.V5.Vector3("Light.Target",[0,0,0]),size:S.V5.Vector2("Light.Size",[10,10])};class ue extends de{get settingProperties(){return[this.ins.color,this.ins.intensity]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==ue.type)throw new Error(`light type mismatch: not a directional light (${n.type})`);return i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,target:i.target.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value};i.type=ue.type,e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}ue.typeName="CVRectLight",ue.type="rect",ue.text="Rectangular Light",ue.icon="area";const pe=[A.Z,D,k,oe,ce,ue],me=[i.ZP,s.Z,r.Z,o.Z,a.Z,l.Z,c.Z,h.Z,d.Z,u.Z,p.Z,Y.Z,m.Z,f.Z,g.Z,v.Z,y.Z,b.Z,_.Z,x.Z,w.Z,M,E.Z,T.Z,C.Z,...pe,V.Z,z.Z,F.ZP,B.ZP,$.Z,j.Z,H.Z,G.Z,Z.Z,W.Z,q.Z,X.Z,K.Z,J.Z,Q.Z,ee.Z,te.Z,ne.Z]},30242:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Ye});var i={};n.r(i),n.d(i,{ArcCurve:()=>E,CatmullRomCurve3:()=>L,CubicBezierCurve:()=>O,CubicBezierCurve3:()=>U,EllipseCurve:()=>M,LineCurve:()=>k,LineCurve3:()=>V,QuadraticBezierCurve:()=>z,QuadraticBezierCurve3:()=>F,SplineCurve:()=>B});var s=n(80038),r=n(15271),o=n(92642),a=n(26220),l=n(10564),c=n(82587),h=n(19588),d=n(40693),u=n(37840),p=n(78943),m=n(96643),f=n(45787);class g{constructor(e,t,n=0,i=1/0){this.ray=new m.z(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new f.S,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return y(e,this,n,t),n.sort(v),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i0)){l=i;break}l=i-1}if(i=l,n[i]===r)return i/(s-1);const c=n[i];return(i+(r-c)/(n[i+1]-c))/(s-1)}getTangent(e,t){const n=1e-4;let i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);const r=this.getPoint(i),o=this.getPoint(s),a=t||(r.isVector2?new d.F:new h.P);return a.copy(o).sub(r).normalize(),a}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new h.P,i=[],s=[],r=[],o=new h.P,a=new c.y;for(let t=0;t<=e;t++){const n=t/e;i[t]=this.getTangentAt(n,new h.P)}s[0]=new h.P,r[0]=new h.P;let l=Number.MAX_VALUE;const d=Math.abs(i[0].x),u=Math.abs(i[0].y),p=Math.abs(i[0].z);d<=l&&(l=d,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),p<=l&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],o),r[0].crossVectors(i[0],s[0]);for(let t=1;t<=e;t++){if(s[t]=s[t-1].clone(),r[t]=r[t-1].clone(),o.crossVectors(i[t-1],i[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(w.uZ(i[t-1].dot(i[t]),-1,1));s[t].applyMatrix4(a.makeRotationAxis(o,e))}r[t].crossVectors(i[t],s[t])}if(!0===t){let t=Math.acos(w.uZ(s[0].dot(s[e]),-1,1));t/=e,i[0].dot(o.crossVectors(s[0],s[e]))>0&&(t=-t);for(let n=1;n<=e;n++)s[n].applyMatrix4(a.makeRotationAxis(i[n],t*n)),r[n].crossVectors(i[n],s[n])}return{tangents:i,normals:s,binormals:r}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class M extends S{constructor(e=0,t=0,n=1,i=1,s=0,r=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=r,this.aClockwise=o,this.aRotation=a}getPoint(e,t){const n=t||new d.F,i=2*Math.PI;let s=this.aEndAngle-this.aStartAngle;const r=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(l)/s)+1)*s:0===c&&l===s-1&&(l=s-2,c=1),this.closed||l>0?o=i[(l-1)%s]:(C.subVectors(i[0],i[1]).add(i[0]),o=C);const d=i[l%s],u=i[(l+1)%s];if(this.closed||l+2i.length-2?i.length-1:r+1],h=i[r>i.length-3?i.length-1:r+2];return n.set(N(o,a.x,l.x,c.x,h.x),N(o,a.y,l.y,c.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const e=i[s]-n,r=this.curves[s],o=r.getLength(),a=0===o?0:1-e/o;return r.getPointAt(a,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class H extends j{constructor(e){super(e),this.uuid=w.DO(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n80*n){a=c=e[0],l=h=e[1];for(let t=n;tc&&(c=d),u>h&&(h=u);p=Math.max(c-a,h-l),p=0!==p?32767/p:0}return Y(r,o,n,a,l,p,0),o};function q(e,t,n,i,s){let r,o;if(s===function(e,t,n,i){let s=0;for(let r=t,o=n-i;r0)for(r=t;r=t;r-=i)o=fe(r,e[r],e[r+1],o);return o&&ce(o,o.next)&&(ge(o),o=o.next),o}function X(e,t){if(!e)return e;t||(t=e);let n,i=e;do{if(n=!1,i.steiner||!ce(i,i.next)&&0!==le(i.prev,i,i.next))i=i.next;else{if(ge(i),i=t=i.prev,i===i.next)break;n=!0}}while(n||i!==t);return t}function Y(e,t,n,i,s,r,o){if(!e)return;!o&&r&&function(e,t,n,i){let s=e;do{0===s.z&&(s.z=se(s.x,s.y,t,n,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==e);s.prevZ.nextZ=null,s.prevZ=null,function(e){let t,n,i,s,r,o,a,l,c=1;do{for(n=e,e=null,r=null,o=0;n;){for(o++,i=n,a=0,t=0;t0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(s=n,n=n.nextZ,a--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:e=s,s.prevZ=r,r=s;n=i}r.nextZ=null,c*=2}while(o>1)}(s)}(e,i,s,r);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,r?J(e,i,s,r):K(e))t.push(a.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),ge(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Y(e=Q(X(e),t,n),t,n,i,s,r,2):2===o&&ee(e,t,n,i,s,r):Y(X(e),t,n,i,s,r,1);break}}function K(e){const t=e.prev,n=e,i=e.next;if(le(t,n,i)>=0)return!1;const s=t.x,r=n.x,o=i.x,a=t.y,l=n.y,c=i.y,h=sr?s>o?s:o:r>o?r:o,p=a>l?a>c?a:c:l>c?l:c;let m=i.next;for(;m!==t;){if(m.x>=h&&m.x<=u&&m.y>=d&&m.y<=p&&oe(s,a,r,l,o,c,m.x,m.y)&&le(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function J(e,t,n,i){const s=e.prev,r=e,o=e.next;if(le(s,r,o)>=0)return!1;const a=s.x,l=r.x,c=o.x,h=s.y,d=r.y,u=o.y,p=al?a>c?a:c:l>c?l:c,g=h>d?h>u?h:u:d>u?d:u,v=se(p,m,t,n,i),y=se(f,g,t,n,i);let b=e.prevZ,_=e.nextZ;for(;b&&b.z>=v&&_&&_.z<=y;){if(b.x>=p&&b.x<=f&&b.y>=m&&b.y<=g&&b!==s&&b!==o&&oe(a,h,l,d,c,u,b.x,b.y)&&le(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,_.x>=p&&_.x<=f&&_.y>=m&&_.y<=g&&_!==s&&_!==o&&oe(a,h,l,d,c,u,_.x,_.y)&&le(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;b&&b.z>=v;){if(b.x>=p&&b.x<=f&&b.y>=m&&b.y<=g&&b!==s&&b!==o&&oe(a,h,l,d,c,u,b.x,b.y)&&le(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;_&&_.z<=y;){if(_.x>=p&&_.x<=f&&_.y>=m&&_.y<=g&&_!==s&&_!==o&&oe(a,h,l,d,c,u,_.x,_.y)&&le(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function Q(e,t,n){let i=e;do{const s=i.prev,r=i.next.next;!ce(s,r)&&he(s,i,i.next,r)&&pe(s,r)&&pe(r,s)&&(t.push(s.i/n|0),t.push(i.i/n|0),t.push(r.i/n|0),ge(i),ge(i.next),i=e=r),i=i.next}while(i!==e);return X(i)}function ee(e,t,n,i,s,r){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&ae(o,e)){let a=me(o,e);return o=X(o,o.next),a=X(a,a.next),Y(o,t,n,i,s,r,0),void Y(a,t,n,i,s,r,0)}e=e.next}o=o.next}while(o!==e)}function te(e,t){return e.x-t.x}function ne(e,t){const n=function(e,t){let n,i=t,s=-1/0;const r=e.x,o=e.y;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){const e=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=r&&e>s&&(s=e,n=i.x=i.x&&i.x>=l&&r!==i.x&&oe(on.x||i.x===n.x&&ie(n,i)))&&(n=i,d=h)),i=i.next}while(i!==a);return n}(e,t);if(!n)return t;const i=me(n,e);return X(i,i.next),X(n,n.next)}function ie(e,t){return le(e.prev,e,t.prev)<0&&le(t.next,e,e.next)<0}function se(e,t,n,i,s){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function re(e){let t=e,n=e;do{(t.x=(e-o)*(r-a)&&(e-o)*(i-a)>=(n-o)*(t-a)&&(n-o)*(r-a)>=(s-o)*(i-a)}function ae(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&he(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(pe(e,t)&&pe(t,e)&&function(e,t){let n=e,i=!1;const s=(e.x+t.x)/2,r=(e.y+t.y)/2;do{n.y>r!=n.next.y>r&&n.next.y!==n.y&&s<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(le(e.prev,e,t.prev)||le(e,t.prev,t))||ce(e,t)&&le(e.prev,e,e.next)>0&&le(t.prev,t,t.next)>0)}function le(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ce(e,t){return e.x===t.x&&e.y===t.y}function he(e,t,n,i){const s=ue(le(e,t,n)),r=ue(le(e,t,i)),o=ue(le(n,i,e)),a=ue(le(n,i,t));return s!==r&&o!==a||(!(0!==s||!de(e,n,t))||(!(0!==r||!de(e,i,t))||(!(0!==o||!de(n,e,i))||!(0!==a||!de(n,t,i)))))}function de(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function ue(e){return e>0?1:e<0?-1:0}function pe(e,t){return le(e.prev,e,e.next)<0?le(e,t,e.next)>=0&&le(e,e.prev,t)>=0:le(e,t,e.prev)<0||le(e,e.next,t)<0}function me(e,t){const n=new ve(e.i,e.x,e.y),i=new ve(t.i,t.x,t.y),s=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=s,s.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function fe(e,t,n,i){const s=new ve(e,t,n);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function ge(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ve(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class ye{static area(e){const t=e.length;let n=0;for(let i=t-1,s=0;s2&&e[t-1].equals(e[0])&&e.pop()}function _e(e,t){for(let n=0;n{const e=navigator.userAgent||navigator.vendor||self.opera;let t=!1;return(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t})(),Ee=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,Te=Boolean(window.webkit&&window.webkit.messageHandlers),Ce=(()=>{if(Ee){if(Te)return Boolean(/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent));{const e=document.createElement("a");return Boolean(e.relList&&e.relList.supports&&e.relList.supports("ar"))}}return!1})(),Ae=(/\bCrOS\b/.test(navigator.userAgent),/android/i.test(navigator.userAgent));var Pe=n(26629),Re=n(79815),Le=n(1594),Ne=n(37117),De=n(3388),Ie=n(63872),Oe=n(77656),Ue=n(63960),ke=n(93113);class Ve extends Ue.F{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new ke.I(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class ze extends Oe.O{constructor(e,t,n){super(),this.shadowMaterial=new Ve,this.boundingBox=new u.Z,this.size=new h.P,this.isAnimated=!1,this.needsUpdate=!1,this.intensity=0,this.castShadow=!0,this.frustumCulled=!1,this.floor=new b.K(new _._,this.shadowMaterial),this.floor.rotateX(-Math.PI/2),this.floor.receiveShadow=!0,this.floor.castShadow=!1,this.floor.frustumCulled=!1,this.add(this.floor),this.shadow.camera.up.set(0,0,1),t.add(this),this.target=t,this.setModel(e,n)}setModel(e,t){this.boundingBox.copy(e.outs.boundingBox.value),e.outs.boundingBox.value.getSize(this.size);const{boundingBox:n,size:i}=this;if(this.isAnimated){const e=2*Math.max(i.x,i.y,i.z);i.y=e,n.expandByVector(i.subScalar(e).multiplyScalar(-.5)),n.max.y=n.min.y+e,i.set(e,e,e)}const s=.001*i.y;this.position.y=n.max.y+s,n.getCenter(this.floor.position),this.setSoftness(t)}setSoftness(e){const t=Math.pow(2,9-3*e);this.setMapSize(t)}setMapSize(e){const{camera:t,mapSize:n,map:i}=this.shadow,{size:s,boundingBox:r}=this;null!=i&&(i.dispose(),this.shadow.map=null),this.isAnimated&&(e*=2);const o=Math.floor(s.x>s.z?e:e*s.x/s.z),a=Math.floor(s.x>s.z?e*s.z/s.x:e);n.set(o,a);const l=2.5*s.x/o,c=2.5*s.z/a;t.left=-r.max.x-l,t.right=-r.min.x+l,t.bottom=r.min.z-c,t.top=r.max.z+c,this.setScaleAndOffset(t.zoom,0),this.shadow.updateMatrices(this),this.floor.scale.set(s.x+2*l,s.z+2*c,1),this.needsUpdate=!0}setIntensity(e){this.shadowMaterial.opacity=e,e>0?(this.visible=!0,this.floor.visible=!0):(this.visible=!1,this.floor.visible=!1)}getIntensity(){return this.shadowMaterial.opacity}setRotation(e){this.shadow.camera.up.set(Math.sin(e),0,Math.cos(e)),this.shadow.updateMatrices(this)}setScaleAndOffset(e,t){const n=this.size.y,i=1/e,s=.001*n;this.floor.position.y=2*s-n+t*i;const{camera:r}=this.shadow;r.zoom=e,r.near=0,r.far=n*e-t,r.projectionMatrix.makeOrthographic(r.left*e,r.right*e,r.top*e,r.bottom*e,r.near,r.far),r.projectionMatrixInverse.copy(r.projectionMatrix).invert(),this.shadow.updateMatrices(this)}updateMatrices(){this.shadow.updateMatrices(this)}dispose(){const{floor:e,shadowMaterial:t}=this;e.geometry.dispose(),t.dispose(),this.floor=null,this.shadowMaterial=null}}var Fe=n(53414),Be=n(60206),$e=n(11359),je=n(84678);const He=new c.y,Ge=new h.P,Ze=new d.F,We=new h.P,qe=new u.Z,Xe=new p._;class Ye extends s.ZP{constructor(){super(...arguments),this._shadowRoot=null,this._arCodeImage=null,this.ins=this.addInputs(Ye.ins),this.outs=this.addOutputs(Ye.outs),this.arLink=document.createElement("a"),this.raycaster=new g,this.initialHitTestSource=null,this.inputSource=null,this.transientHitTestSource=null,this.refSpace=null,this.frame=null,this.vScene=null,this.camera=null,this.cameraParent=null,this.cachedView=null,this.cachedQuality=null,this.cachedNearPlane=0,this.cachedFarPlane=0,this.xrCamera=null,this.hitPlane=null,this.selectionRing=null,this.session=null,this.setup=null,this.originalUnits=null,this.isTranslating=!1,this.isRotating=!1,this.isScaling=!1,this.lastDragValueX=0,this.lastDragValueY=0,this.totalDrag=0,this.lastScale=0,this.lastHitPosition=new h.P,this.lastFrameTime=0,this.targetOpacity=0,this.modelFloorOffset=0,this.optimalCameraDistance=0,this.shadow=null,this.lightTransform=null,this.lightsToReset=[],this.featuresToReset=[],this.annotationsAtLaunch=!1,this.scaleDisplay=null,this.updateScale=!1,this.placementRotation=new p._,this.onSessionEnded=()=>{this.outs.isPresenting.setValue(!1);const e=this.renderer.views[0].renderer;this.resetScene(),e.shadowMap.autoUpdate=!0;const t=this.initialHitTestSource;null!=t&&(t.cancel(),this.initialHitTestSource=null);const n=this.transientHitTestSource;null!=n&&(n.cancel(),this.transientHitTestSource=null),this.refSpace=null,this.frame=null,this.inputSource=null,this.xrCamera=null,this.cachedView=null,this.vScene=null,this.cachedView=null,this.camera=null;const i=this.session;i&&(i.removeEventListener("end",this.onSessionEnded),i.removeEventListener("selectstart",this.onSelectStart),i.removeEventListener("selectend",this.onSelectEnd),this.session=null),this.setup.reader.ins.enabled.off("value",this.endSession,this),e.setAnimationLoop(null),e.xr.enabled=!1,this.outs.isPlaced.setValue(!1),this.setup.navigation.ins.enabled.setValue(!0),this.renderer.views[0].render()},this.render=(e,t)=>{this.frame=t;const n=this.renderer.views[0].renderer,{camera:i,xrCamera:s,refSpace:r,initialHitTestSource:o,vScene:a,sceneNode:l,shadow:c,lastFrameTime:h}=this;if(!t||!t.getViewerPose(r))return;if(!s&&this.session){const e=n.xr.getCamera();return void(this.xrCamera=e.cameras[0])}if(s&&(n.xr.updateCamera(i),i.updateMatrixWorld(!0),i.projectionMatrix.fromArray(s.projectionMatrix.elements),i.projectionMatrixInverse.copy(s.projectionMatrix).invert()),null!=o&&s){const e=a.scene,{position:t}=e,n=2*l.outs.boundingRadius.value+s.near;s.projectionMatrixInverse.copy(s.projectionMatrix).invert();const r=i.getWorldDirection(Ge);e.rotation.y=Math.atan2(-r.x,-r.z),t.copy(i.position).add(r.multiplyScalar(n)),this.shadow.setRotation(e.rotation.y),e.updateMatrix(),e.updateMatrixWorld()}if(this.setInitialPosition(t),this.handleInput(t),this.outs.isPlaced.value){const t=e-h;this.updateOpacity(t,this.targetOpacity),this.lastFrameTime=e}const d=n.getContext();if(d.depthMask(!1),d.clear(d.DEPTH_BUFFER_BIT),d.depthMask(!0),c.needsUpdate&&(n.shadowMap.needsUpdate=!0,c.needsUpdate=!1),this.updateScale){const e=a.scene,t=this.scaleDisplay;Ge.copy(e.position);const n=this.renderer.views[0].viewports[0].width,i=this.renderer.views[0].viewports[0].height,r=n/2,o=i/2,l=n-t.clientWidth,c=i-t.clientHeight;Ge.project(s),Ge.x=Math.min(Math.max(Ge.x*r+r,0),l),Ge.y=Math.min(Math.max(-Ge.y*o+o,0),c),t.style.left=Ge.x.toString()+"px",t.style.top=Ge.y.toString()+"px",t.innerText=Math.round(100*e.scale.x).toString()+"%"}n.render(a.scene,i)},this.onSelectStart=e=>{const t=this.vScene.scene,n=this.transientHitTestSource;if(null==n)return;this.targetOpacity=.5;const i=this.frame.getHitTestResultsForTransientInput(n);if(1===i.length){this.inputSource=e.inputSource;const{axes:t}=this.inputSource.gamepad,n=this.raycaster;Ze.set(t[0],-t[1]),n.setFromCamera(Ze,this.xrCamera);const i=n.intersectObject(this.hitPlane);i.length>0?(this.isTranslating=!0,this.lastHitPosition.copy(i[0].point)):!1===this.ins.wallMount.value&&(this.isRotating=!0),this.lastDragValueX=t[0],this.lastDragValueY=t[1]}else 2===i.length&&(this.isScaling=!0,this.lastScale=this.getFingerSeparation(i)/t.scale.x)},this.onSelectEnd=()=>{this.targetOpacity=0,this.totalDrag=0,this.isTranslating=!1,this.isRotating=!1,this.isScaling=!1,this.scaleDisplay.classList.remove("sv-show"),this.inputSource=null}}get renderer(){return this.getMainComponent(r.Z)}get pulse(){return this.getMainComponent(a.Z)}get sceneNode(){return this.getSystemComponent(Pe.Z)}get analytics(){return this.system.getMainComponent($e.Z)}get assetManager(){return this.getMainComponent(Ie.Z)}get shadowRoot(){return this._shadowRoot}set shadowRoot(e){this._shadowRoot=e}get arCodeImage(){const e=document.documentURI;if(null==this._arCodeImage&&e.includes(".si.edu")&&e.includes("3d-api")){const t=e.split("/").pop().split(":").pop();36==t.length&&(this._arCodeImage="https://3d-api.si.edu/voyager/"+t+"/qrcode")}return this._arCodeImage}create(){super.create(),this.system.components.on(je.Z,this.onMetaComponent,this)}dispose(){this.system.components.off(je.Z,this.onMetaComponent,this),super.dispose()}update(){const{ins:e,outs:t}=this;if(e.enabled.changed){let n=e.enabled.value;n&&(Se?(this.launchWebXR(),this.analytics.sendProperty("AR_Enabled","WebXR")):Ae?(this.launchSceneViewer(),this.analytics.sendProperty("AR_Enabled","SceneViewer")):Ee&&Ce?(this.launchQuickLook(),this.analytics.sendProperty("AR_Enabled","QuickLook")):(n=!1,this.analytics.sendProperty("AR_Enabled","Unavailable"),l.ZP.show("AR unavailable on this platform.","warning"))),t.enabled.setValue(n)}return!0}launchWebXR(){var e,t,n;const i=null===(e=this.renderer)||void 0===e?void 0:e.views[0].renderer,s=this.vScene=null===(t=this.renderer)||void 0===t?void 0:t.activeSceneComponent,r=this.camera=null==s?void 0:s.activeCamera;this.cameraParent=r.parent;if(!(this.setup=this.getSystemComponent(Re.Z)))return!1;const o=null===(n=this.sceneNode)||void 0===n?void 0:n.getGraphComponents(De.Z);let a=null;for(const e of o)if(a=e.derivatives.get(Ne._U.Web3D,Ne.$l.AR),null!=a)break;a&&(this.setup.navigation.setChanged(!0),this.cachedQuality=o[0].ins.quality.value,o.forEach((e=>{e.ins.quality.setValue(Ne.$l.AR)})),i.setAnimationLoop(((e,t)=>this.render(e,t))),navigator.xr.requestSession("immersive-ar",{requiredFeatures:["hit-test"],optionalFeatures:["dom-overlay"],domOverlay:{root:this.shadowRoot.querySelector("ff-viewport-overlay")}}).then((e=>this.onSessionStarted(i,e))).catch((e=>{console.log("Error starting session: "+e),l.ZP.show("AR available but blocked. Please check your browser settings.","warning")})))}async onSessionStarted(e,t){const n=this.renderer.views[0].renderer.getContext();await n.makeXRCompatible(),t.updateRenderState({baseLayer:new XRWebGLLayer(t,n,{alpha:!0})}),this.setupScene(),e.shadowMap.autoUpdate=!1,e.xr.enabled=!0,e.xr.setReferenceSpaceType("local"),e.xr.setSession(t),await t.addEventListener("end",this.onSessionEnded),this.refSpace=await t.requestReferenceSpace("local");const i=await t.requestReferenceSpace("viewer");e.xr.cameraAutoUpdate=!1;const s=20*Math.PI/180,r=!0===this.ins.wallMount.value?void 0:new XRRay(new DOMPoint(0,0,0),{x:0,y:-Math.sin(s),z:-Math.cos(s)});t.requestHitTestSource({space:i,offsetRay:r}).then((e=>{this.initialHitTestSource=e})),this.outs.isPresenting.setValue(!0),this.session=t,this.lastFrameTime=performance.now(),this.setup.reader.ins.enabled.on("value",this.endSession,this)}endSession(){this.session&&this.session.end()}setupScene(){const{cameraParent:e,setup:t,featuresToReset:n}=this,i=this.sceneNode;e&&e.remove(this.camera),this.setup.background.hide(),this.setup.navigation.ins.enabled.setValue(!1);const s=i.graph.findNodeByName("Lights");(this.lightTransform=s.getComponent(o.ZP,!0)).ins.rotation.reset();const r=this.scaleDisplay=document.createElement("div");r.classList.add("sv-scale-annotation"),this.shadowRoot.querySelector("ff-viewport-overlay").appendChild(r),n.push(t.floor.ins.visible.value?1:0),n.push(t.grid.ins.visible.value?1:0),n.push(t.tape.ins.visible.value?1:0),n.push(t.slicer.ins.enabled.value?1:0),n.push(t.viewer.ins.shader.value),this.annotationsAtLaunch=t.viewer.ins.annotationsVisible.value,t.floor.ins.visible.setValue(!1),t.grid.ins.visible.setValue(!1),t.tape.ins.visible.setValue(!1),t.slicer.ins.enabled.setValue(!1),t.viewer.ins.shader.value!==Be.pH.Default&&t.viewer.ins.shader.setValue(Be.pH.Default),t.viewer.ins.annotationsVisible.setValue(!1);(this.originalUnits=i.ins.units.getValidatedValue())!=Le.f_.m&&this.sceneNode.ins.units.setValue(Le.f_.m);i.getGraphComponents(Fe.Z).forEach((e=>{e.ins.shadowEnabled.value&&(e.ins.shadowEnabled.setValue(!1),this.lightsToReset.push(e))})),this.pulse.pulse(Date.now()),i.update(null);(this.shadow=new ze(this.sceneNode,this.vScene.scene,.5)).setIntensity(0),qe.copy(this.sceneNode.outs.boundingBox.value),qe.getSize(Ge),this.cachedNearPlane=this.camera.near,this.cachedFarPlane=this.camera.far,this.vScene.activeCameraComponent.ins.near.setValue(.01),this.vScene.activeCameraComponent.ins.far.setValue(1e3)}resetScene(){const{camera:e,cameraParent:t,setup:n,featuresToReset:i}=this,s=this.vScene.scene;t&&t.add(e),e.position.set(0,0,0),e.rotation.set(0,0,0),this.vScene.activeCameraComponent.ins.near.setValue(this.cachedNearPlane),this.vScene.activeCameraComponent.ins.far.setValue(this.cachedFarPlane),e.updateMatrix(),this.lightTransform.object3D.rotation.set(0,0,0),this.lightTransform.object3D.updateMatrix(),this.sceneNode.ins.units.setValue(this.originalUnits),s.position.setScalar(0),s.rotation.y=0,s.scale.setScalar(1),s.updateMatrix(),s.updateMatrixWorld(!0),i.reverse(),n.floor.ins.visible.setValue(!!i.pop()),n.grid.ins.visible.setValue(!!i.pop()),n.tape.ins.visible.setValue(!!i.pop()),n.slicer.ins.enabled.setValue(!!i.pop());const r=i.pop();r!==Be.pH.Default&&n.viewer.ins.shader.setValue(r),this.lightsToReset.forEach((e=>{e.ins.shadowEnabled.setValue(!0)})),this.lightsToReset.length=0,n.background.show();this.sceneNode.getGraphComponents(De.Z).forEach((e=>{e.ins.quality.setValue(this.cachedQuality)}));const o=this.selectionRing;null!=o&&(s.remove(o),o.geometry.dispose(),o.material.dispose(),this.selectionRing=null);const a=this.hitPlane;null!=a&&(s.remove(a),a.geometry.dispose(),a.material.dispose(),this.hitPlane=null),this.scaleDisplay.remove();const l=this.shadow;null!=l&&(s.remove(l),l.dispose(),this.shadow=null),e.aspect=window.innerWidth/window.innerHeight,e.updateProjectionMatrix()}setInitialPosition(e){const t=this.initialHitTestSource;if(null==t)return;const n=e.getHitTestResults(t);if(0==n.length)return;const i=n[0],s=this.getHitPoint(i);if(null==s)return;this.placeModel(s),t.cancel(),this.initialHitTestSource=null;const{session:r}=e;r.addEventListener("selectstart",this.onSelectStart),r.addEventListener("selectend",this.onSelectEnd),r.requestHitTestSourceForTransientInput({profile:"generic-touchscreen"}).then((e=>{this.transientHitTestSource=e}))}getHitPoint(e){const t=e.getPose(this.refSpace);if(null==t)return null;const n=He.fromArray(t.transform.matrix),i=n.elements[5]>.75;if(!0===this.ins.wallMount.value&&!i){const e=this.vScene.scene;e.rotation.y=Math.atan2(n.elements[4],n.elements[6]),e.updateMatrix()}return i!==this.ins.wallMount.value?We.setFromMatrixPosition(n):null}handleInput(e){const t=this.transientHitTestSource;if(null==t)return;if(!this.isTranslating&&!this.isScaling&&!this.isRotating)return;const n=e.getHitTestResultsForTransientInput(t),i=this.vScene.scene,s=i.scale.x;if(this.isScaling)if(n.length<2)this.isScaling=!1,this.scaleDisplay.classList.remove("sv-show"),this.scaleDisplay.addEventListener("transitionend",(()=>{this.updateScale=!1}),{once:!0});else{let e=this.getFingerSeparation(n)/this.lastScale;e=e>.9&&e<1.1?1:e,this.scaleScene(i,e),this.scaleDisplay.classList.add("sv-show"),this.updateScale=!0}else{if(2===n.length)return this.isTranslating=!1,this.isRotating=!1,this.isScaling=!0,void(this.lastScale=this.getFingerSeparation(n)/s);if(this.isRotating){const e=this.inputSource.gamepad.axes[0];i.rotation.y+=1.5*(e-this.lastDragValueX),i.updateMatrix(),this.sceneRotateHelper(),this.lastDragValueX=e}else if(this.isTranslating){const e=this.inputSource.gamepad.axes,t=e[0]-this.lastDragValueX,s=e[1]-this.lastDragValueY;this.totalDrag+=Math.hypot(t,s),n.forEach((e=>{if(this.totalDrag<.01||e.inputSource!==this.inputSource||e.results.length<1)return;const t=this.getHitPoint(e.results[0]);null!=t&&(Ge.copy(t),Ge.sub(this.lastHitPosition),i.position.add(Ge),i.updateMatrix(),i.updateMatrixWorld(),this.lastHitPosition.copy(t),this.updateBoundingBox())})),this.shadow.updateMatrices()}}}getFingerSeparation(e){const t=e[0].inputSource.gamepad.axes,n=e[1].inputSource.gamepad.axes,i=n[0]-t[0],s=n[1]-t[1];return Math.sqrt(i*i+s*s)}placeModel(e){const t=this.vScene.scene,n=!0===this.ins.wallMount.value,{min:i,max:s}=qe,r=this.sceneNode.outs.boundingRadius.value,o=Math.max(1.25*(s.x-i.x),.15),a=n?Math.max(1.25*(s.y-i.y),.15):Math.max(1.25*(s.z-i.z),.15),l=(i.x+s.x)/2,c=(i.z+s.z)/2,d=(i.y+s.y)/2,u=n?0:-Math.PI/2;this.lastHitPosition.copy(e);const p=this.hitPlane=new b.K(new _._(o,a),new x.v);p.position.set(l,n?d:i.y,n?i.z:c),p.rotation.set(u,0,0),p.visible=!1,t.add(p),this.placementRotation.copy(t.quaternion);const f=new H,g=new H,v=o>a?.025*o:.025*a;this.roundedRect(f,-o/2,-a/2,o,a,.5*v),this.roundedRect(g,-o/2+v,-a/2+v,o-2*v,a-2*v,.4*v),f.holes.push(g);let y=new xe(f);const w=this.selectionRing=new b.K(y,new x.v({side:we.ehD,opacity:0}));w.position.set(l,n?d:i.y,n?i.z:c),w.rotation.set(u,0,0),w.material.transparent=!0,w.visible=!1,t.add(w),this.modelFloorOffset=i.y,t.position.set(e.x,n?e.y:e.y-i.y,e.z),t.updateMatrix(),t.updateMatrixWorld(!0),this.updateBoundingBox(),this.pulse.pulse(Date.now()),this.shadow.updateMatrices(),this.shadow.setIntensity(!0===this.ins.wallMount.value?0:.3),this.setup.viewer.ins.annotationsVisible.setValue(this.annotationsAtLaunch),1===this.ins.arScale.value||n||this.renderer.views[0].renderer.render(t,this.shadow.shadow.camera),this.scaleScene(this.vScene.scene,this.ins.arScale.value);const S=this.camera.position.clone(),M=e.clone().sub(S);if(M.length(){this.scaleDisplay.classList.remove("sv-show"),this.scaleDisplay.addEventListener("transitionend",(()=>{this.updateScale=!1}),{once:!0})}),1500))}launchSceneViewer(){const e=this.sceneNode.getGraphComponents(De.Z),t=e.findIndex((e=>null!==e.derivatives.get(Ne._U.App3D,Ne.$l.AR))),n=t>-1?e[t].derivatives.get(Ne._U.App3D,Ne.$l.AR):null;if(n){const e=this.arLink,t=n.findAsset(Ne.hH.Model),i=`intent://arvr.google.com/scene-viewer/1.0?file=${this.assetManager.getAssetUrl(t.data.uri)}&mode=ar_only#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;end;`;e.setAttribute("href",i),e.click()}}launchQuickLook(){const e=this.sceneNode.getGraphComponents(De.Z),t=e.findIndex((e=>null!==e.derivatives.get(Ne._U.iOSApp3D,Ne.$l.AR))),n=t>-1?e[t].derivatives.get(Ne._U.iOSApp3D,Ne.$l.AR):null;if(n){const e=this.arLink,t=n.findAsset(Ne.hH.Model),i=this.assetManager.getAssetUrl(t.data.uri);e.setAttribute("rel","ar");const s=document.createElement("img");e.appendChild(s),e.setAttribute("href",i.toString()),e.click(),e.removeChild(s)}}updateBoundingBox(){this.sceneNode.ins.sceneTransformed.set()}updateOpacity(e,t){const n=this.selectionRing.material,i=n.opacity;if(t===i)return;const s=t-i;n.opacity=s>0?Math.min(i+.002*e,t):Math.max(i-.002*e,t),this.selectionRing.visible=n.opacity>0}roundedRect(e,t,n,i,s,r){e.moveTo(t,n+r),e.lineTo(t,n+s-r),e.quadraticCurveTo(t,n+s,t+r,n+s),e.lineTo(t+i-r,n+s),e.quadraticCurveTo(t+i,n+s,t+i,n+s-r),e.lineTo(t+i,n+r),e.quadraticCurveTo(t+i,n,t+i-r,n),e.lineTo(t+r,n),e.quadraticCurveTo(t,n,t,n+r)}sceneRotateHelper(){const e=this.vScene.scene;Xe.copy(e.quaternion),Xe.invert(),Xe.multiply(this.placementRotation),this.lightTransform.object3D.rotation.setFromQuaternion(Xe),this.lightTransform.object3D.updateMatrix(),this.shadow.setRotation(e.rotation.y)}scaleScene(e,t){e.scale.setScalar(t),!1===this.ins.wallMount.value&&(e.position.y=this.lastHitPosition.y-this.modelFloorOffset*e.scale.y),e.updateMatrix(),e.updateMatrixWorld(),this.shadow.setScaleAndOffset(t,0),this.updateBoundingBox()}onMetaComponent(e){const t=e.object;e.add&&t.once("load",(()=>{const e=t.images.dictionary;Object.keys(e).forEach((t=>{const n=e[t];n.usage&&"ARCode"===n.usage&&(this._arCodeImage=this.assetManager.getAssetUrl(n.uri))}))}))}}Ye.typeName="CVARManager",Ye.text="ARManager",Ye.icon="",Ye.isSystemSingleton=!0,Ye.ins={enabled:s.V5.Boolean("State.Enabled"),wallMount:s.V5.Boolean("AR.wallMount",!1),arScale:s.V5.Number("AR.Scale",1)},Ye.outs={enabled:s.V5.Boolean("State.Enabled"),available:s.V5.Boolean("State.Available",Me),isPlaced:s.V5.Boolean("AR.Placed",!1),isPresenting:s.V5.Boolean("AR.Presenting",!1)}},11359:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s extends i.ZP{constructor(){super(...arguments),this._title="Untitled",this._timerStart=0}startTimer(){0===this._timerStart&&(this._timerStart=Date.now())}resetTimer(){this._timerStart=0}getTimerTime(){return this._timerStart>0?Date.now()-this._timerStart:0}setTitle(e){this._title=e}sendProperty(e,t){if("function"==typeof gtag){const n=void 0!==t?t.toString():"undefined";gtag("event",e.toLowerCase(),{scene_title:this._title,event_value:n})}}}s.typeName="CVAnalytics",s.text="Analytics",s.icon="",s.isSystemSingleton=!0},51462:(e,t,n)=>{"use strict";n.d(t,{Z:()=>x});var i=n(80038),s=n(28110),r=n(2837),o=n(15271),a=n(3388),l=n(84678),c=n(5249),h=n(15577),d=n(44466),u=n(41029),p=(n(91013),n(13301),n(10160),n(30242)),m=n(93072),f=n(1594),g=n(68327),v=n(17467),y=n(63872),b=n(74572),_=n(26220);class x extends r.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(x.ins),this._activeAnnotation=null,this._annotations={},this._viewports=new Set,this._sprites={},this._truncateLock=!1,this._activeView=!1,this.addEvents("active-annotation","group"),this.onSpriteClick=this.onSpriteClick.bind(this),this.onSpriteLink=this.onSpriteLink.bind(this),this.on("pointer-up",this.onPointerUp,this),this.system.on("pointer-up",this.onSystemPointerUp,this),this.arManager.outs.isPresenting.on("value",this.handleARStateChange,this),this.language.outs.language.on("value",this.updateLanguage,this),this.object3D=new s.Z}get model(){return this.getComponent(a.Z)}get meta(){return this.getComponent(l.Z,!0)}get reader(){return this.getGraphComponent(c.ZP,!0)}get language(){return this.getGraphComponent(m.Z,!0)}get audio(){return this.getGraphComponent(v.Z,!0)}get snapshots(){return this.getGraphComponent(b.Z,!0)}get articles(){const e=this.meta;return e?e.articles:null}get arManager(){return this.system.getMainComponent(p.Z)}get assetManager(){return this.system.getMainComponent(y.Z)}get renderer(){return this.getMainComponent(o.Z)}get assetReader(){return this.getMainComponent(g.Z)}get activeAnnotation(){return this._activeAnnotation}set activeAnnotation(e){if(e!==this._activeAnnotation){const t=this._activeAnnotation;t&&(t.set("expanded",!1),this.updateSprite(t)),this._activeAnnotation=e,e&&(e.set("expanded",!0),this.updateSprite(e),this._activeView&&(this._truncateLock=!0,this._activeView=!1));const n=this.ins;n.marker.setValue(e?e.data.marker:"",!0),n.title.setValue(e?e.title:"",!0),n.lead.setValue(e?e.lead:"",!0),n.tags.setValue(e?e.tags.join(", "):"",!0),n.style.setOption(e?e.data.style:u.Z.defaultTypeName,!0),n.scale.setValue(e?100*e.data.scale*(0,h.Z)(this.model.ins.localUnits.getValidatedValue(),f.f_.m):1,!0),n.offset.setValue(e?100*e.data.offset*(0,h.Z)(this.model.ins.localUnits.getValidatedValue(),f.f_.m):0,!0),n.tilt.setValue(e?e.data.tilt:0,!0),n.azimuth.setValue(e?e.data.azimuth:0,!0),n.color.setValue(e?e.data.color.slice():[1,1,1],!0);const i=this.reader.articles;if(i.length){const t=i.map((e=>e.article.title));t.unshift("(none)"),n.article.setOptions(t);const s=e?i.find((t=>t.article.id===e.data.articleId)):null;n.article.setValue(s?i.indexOf(s)+1:0,!0)}else n.article.setOptions(["(none)"]),n.article.setValue(0);n.audioId.setValue(e?e.data.audioId:null,!0),n.image.setValue(e?e.data.imageUri:"",!0),n.imageCredit.setValue(e?e.imageCredit:"",!0),n.imageAltText.setValue(e?e.imageAltText:"",!0),this.emit({type:"annotation-update",annotation:e})}}get hasAnnotations(){return Object.keys(this._annotations).length>0}setActiveAnnotationById(e){this.activeAnnotation=this._annotations[e]}update(e){super.update(e);const t=this.ins,n=this.object3D,i=this.activeAnnotation;if(t.unitScale.changed&&(n.scale.setScalar(t.unitScale.value),n.updateMatrix()),t.activeTags.changed){const e=t.activeTags.value.split(",").map((e=>e.trim())).filter((e=>e));for(const t in this._annotations){const n=this._annotations[t],i=n.tags;let s=0===i.length;e.forEach((e=>{i.indexOf(e)>=0&&(s=!0)})),n.set("visible",s),this.updateSprite(n)}}if(t.visible.changed&&n.setVisible(t.visible.value),i){if(t.marker.changed&&i.set("marker",t.marker.value),t.title.changed&&(i.title=t.title.value),t.lead.changed&&(i.lead=t.lead.value),t.tags.changed&&(i.tags=t.tags.value.split(",").map((e=>e.trim())).filter((e=>e)),this.emit({type:"tag-update"})),t.style.changed&&(i.set("style",t.style.getOptionText()),this.createSprite(i)),t.scale.changed&&i.set("scale",t.scale.value*(0,h.Z)(f.f_.m,this.model.ins.localUnits.getValidatedValue())*.01),t.offset.changed&&i.set("offset",t.offset.value*(0,h.Z)(f.f_.m,this.model.ins.localUnits.getValidatedValue())*.01),t.tilt.changed&&i.set("tilt",t.tilt.value),t.azimuth.changed&&i.set("azimuth",t.azimuth.value),t.color.changed&&i.set("color",t.color.value.slice()),t.image.changed&&i.set("imageUri",t.image.value),t.imageCredit.changed&&(i.imageCredit=t.imageCredit.value),t.imageAltText.changed&&(i.imageAltText=t.imageAltText.value),t.article.changed){const e=this.reader.articles,n=e&&e[t.article.getValidatedValue()-1];i.set("articleId",n?n.article.id:"")}t.audioId.changed&&i.set("audioId",t.audioId.value),this.updateSprite(i),this.emit({type:"annotation-update",annotation:i})}return!0}tock(){if(this.updated)return!0}postRender(e){const t=e.viewport;this._viewports.has(t)||(t.on("dispose",this.onViewportDispose,this),this._viewports.add(t));if(this.object3D.render(t.overlay,e.camera),this._truncateLock){const e=this.activeAnnotation.data,t=this._sprites[e.id];t.isAnimating=!0,this.snapshots.outs.tweening.once("value",(()=>{t.isAnimating=!1}),this),this._truncateLock=!1}}dispose(){this.object3D.dispose(),this.off("pointer-up",this.onPointerUp,this),this.system.off("pointer-up",this.onSystemPointerUp,this),this.arManager.outs.isPresenting.off("value",this.handleARStateChange,this),this.language.outs.language.off("value",this.updateLanguage,this),this._viewports.forEach((e=>e.off("dispose",this.onViewportDispose,this))),this._viewports.clear(),super.dispose()}getAnnotations(){return Object.keys(this._annotations).map((e=>this._annotations[e]))}addAnnotation(e){this._annotations[e.id]=e,this.createSprite(e),Object.keys(e.data.titles).forEach((e=>{this.language.addLanguage(f.PD[e])})),Object.keys(e.data.leads).forEach((e=>{this.language.addLanguage(f.PD[e])})),this.changed=!0}removeAnnotation(e){const t=Object.keys(this._annotations);if(delete this._annotations[e.id],this.removeSprite(e),e===this.activeAnnotation){const n=Math.min(t.indexOf(e.id)+1,t.length-1);this.activeAnnotation=n<0?null:this._annotations[t[n]],e.tags.length>0&&this.emit({type:"tag-update"})}this.changed=!0}updateAnnotation(e,t){t&&this.updateSprite(e),this.changed=!0}toJSON(){const e=super.toJSON(),t=this.toData();return t&&(e.data=t),e}fromJSON(e){e.data&&this.fromData(e.data)}toData(){const e=Object.keys(this._annotations);return 0===e.length?null:e.map((e=>this._annotations[e].toJSON()))}fromData(e){const t=this.language.outs.language.value;e.forEach((e=>{let n=new d.Z(e);n.language=t,this.addAnnotation(n)})),this.emit({type:"tag-update"})}handleARStateChange(){for(const e in this._annotations){const t=this._annotations[e];this._sprites[t.id].isAdaptive=!this.arManager.outs.isPresenting.value}}onPointerUp(e){if(e.isDragging)return;let t=e.object3D;for(;t&&!t.isHTMLSprite;)t=t.parent;const n=t&&t.annotation;n&&(this.emit({type:"click",sprite:t,annotation:n}),e.stopPropagation=!0)}onSystemPointerUp(e){e.isDragging||this.emit({type:"click",sprite:null,annotation:null})}onViewportDispose(e){this.object3D.disposeHTMLElements(e.viewport.overlay)}onSpriteClick(e){this.emit(e);const t=e.annotation;if(t&&t.data.viewId.length&&!this.arManager.outs.isPresenting.value){this.normalizeViewOrbit(t.data.viewId);const e=this.snapshots.getTargetProperties().findIndex((e=>"ActiveId"==e.name));if(e>=0){this.snapshots.getState(t.data.viewId).values[e]=t.data.id}const n=this.getMainComponent(_.Z);this.snapshots.tweenTo(t.data.viewId,n.context.secondsElapsed),this._activeView=!0}}onSpriteLink(e){this.reader&&(this.reader.ins.articleId.setValue(e.annotation.data.articleId),this.reader.ins.enabled.setValue(!0))}createSprite(e){this.removeSprite(e);const t=u.Z.createInstance(e);t.addEventListener("click",this.onSpriteClick),t.addEventListener("link",this.onSpriteLink),t.assetManager=this.assetManager,t.audioManager=this.audio,this._sprites[e.id]=t,this.object3D.add(t),this.registerPickableObject3D(t,!0)}removeSprite(e){const t=this._sprites[e.id];t&&(t.removeEventListener("click",this.onSpriteClick),t.removeEventListener("link",this.onSpriteLink),t.dispose(),this._sprites[e.id]=void 0,this.object3D.remove(t),this.unregisterPickableObject3D(t,!0))}updateSprite(e){const t=this._sprites[e.id];t&&t.update()}updateLanguage(){if(!this.getComponent(a.Z,!0))return;const e=this.ins,t=this._activeAnnotation,n=this.language;this.getAnnotations().forEach((e=>{e.language=n.outs.language.value})),e.activeTags.set();for(const e in this._annotations){const t=this._annotations[e],n=this._sprites[t.id];n&&n.update()}e.title.setValue(t?t.title:"",!0),e.lead.setValue(t?t.lead:"",!0),e.tags.setValue(t?t.tags.join(", "):""),e.imageCredit.setValue(t?t.imageCredit:"",!0),e.imageAltText.setValue(t?t.imageAltText:"",!0);const i=this.reader.articles.map((e=>e.article.title));i.unshift("(none)"),e.article.setOptions(i)}normalizeViewOrbit(e){const t=this.snapshots.getTargetProperties().findIndex((e=>"Orbit"==e.name)),n=this.snapshots.getState(e),i=this.snapshots.getCurrentValues()[t];let s=0;i.forEach(((e,i)=>{const r=Math.round((e-n.values[t][i])/360);n.values[t][i]+=360*r,s+=Math.abs(e-n.values[t][i])})),n.duration=s>.01?1:0}}x.typeName="CVAnnotationView",x.ins={unitScale:i.V5.Number("Transform.UnitScale",{preset:1,precision:5}),activeTags:i.V5.String("Tags.Active"),title:i.V5.String("Annotation.Title"),lead:i.V5.String("Annotation.Lead"),marker:i.V5.String("Annotation.Marker"),tags:i.V5.String("Annotation.Tags"),style:i.V5.Option("Annotation.Style",u.Z.typeNames),scale:i.V5.Scale("Annotation.Scale",{preset:1,precision:3}),offset:i.V5.Number("Annotation.Offset",{preset:0,precision:3}),article:i.V5.Option("Annotation.Article",[]),image:i.V5.String("Annotation.Image"),imageCredit:i.V5.String("Image.Credit"),imageAltText:i.V5.String("Image.AltText"),audioId:i.V5.String("Annotation.AudioID"),tilt:i.V5.Number("Annotation.Tilt"),azimuth:i.V5.Number("Annotation.Azimuth"),color:i.V5.ColorRGB("Annotation.Color")}},63872:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(58754),s=n(80038);class r extends s.ZP{constructor(){super(...arguments),this.ins=this.addInputs(r.ins),this.outs=this.addOutputs(r.outs),this._loadingManager=new o(this),this._baseUrl=window.location.href,this._initialLoad=!1}get loadingManager(){return this._loadingManager}get baseUrl(){return this._baseUrl}set baseUrl(e){this._baseUrl=new URL(e,window.location.href).href}get initialLoad(){return this._initialLoad}set initialLoad(e){this._initialLoad=e}getAssetName(e){return e.split("/").pop()}getAssetUrl(e){const t=new URL(e,this._baseUrl).href;return this.loadingManager.resolveURL(t)}getAssetPath(e){const t=this._baseUrl,n=e.indexOf(t);return n>=0?e.substr(n+t.length):e}getAssetBasePath(e){const t=this.getAssetPath(e).split("/");t.pop();const n=t.join("/");return n?n+"/":n}getRelativeAssetPath(e,t){const n=this.getAssetUrl(e),i=this.getAssetUrl(t),s=n.indexOf(i);return s>=0?n.substr(s+i.length):this.getAssetPath(n)}create(){super.create()}update(){const{ins:e,outs:t}=this;if(e.busy.changed){const n=e.busy.value||this._loadingManager.isBusy;t.busy.setValue(n),n||t.completed.set()}return!0}}r.typeName="CVAssetManager",r.text="AssetManager",r.icon="",r.isSystemSingleton=!0,r.ins={busy:s.V5.Boolean("State.Busy"),baseUrlValid:s.V5.Boolean("Settings.BaseURLValid")},r.outs={busy:s.V5.Boolean("State.Busy"),completed:s.V5.Event("State.Completed")};class o extends i.l{constructor(e){super(),this._manager=e,this._isBusy=!1,this.onStart=this.onLoadingStart.bind(this),this.onProgress=this.onLoadingProgress.bind(this),this.onLoad=this.onLoadingCompleted.bind(this),this.onError=this.onLoadingError.bind(this)}get isBusy(){return this._isBusy}onLoadingStart(){this._isBusy=!0,this._manager.ins.busy.set()}onLoadingProgress(e,t,n){0}onLoadingCompleted(){this._isBusy=!1,this._manager.ins.busy.set()}onLoadingError(){this._isBusy=!1,this._manager.ins.busy.set()}}},68327:(e,t,n)=>{"use strict";n.d(t,{x:()=>An,Z:()=>Pn});var i=n(56587),s=n(80038);class r{constructor(e){this._loadingManager=e}async get(e){return this._loadingManager.itemStart(e),fetch(e,{headers:{Accept:"application/json"}}).then((t=>{if(!t.ok)throw this._loadingManager.itemError(e),this._loadingManager.itemEnd(e),new Error(`failed to fetch from '${e}', status: ${t.status} ${t.statusText}`);return this._loadingManager.itemEnd(e),t.json()}))}}var o=n(40693),a=n(6965),l=n(93113),c=n(71050);class h extends a.W{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new o.F(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return c.uZ(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new l.I(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new l.I(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new l.I(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}var d=n(75544),u=n(8173),p=n(17393),m=n(19588),f=n(84538),g=n(60206);const v=n(8669).Z,y=n(9849).Z;class b extends h{constructor(e){super(),this._clayColor=new l.I("#a67a6c").convertLinearToSRGB(),this._wireColor=new l.I("#004966").convertLinearToSRGB(),this._wireEmissiveColor=new l.I("#004966").convertLinearToSRGB(),this._objectSpaceNormalMap=!1,this._paramCopy={},this._sideCopy=d.Wl3,this.type="UberPBRAdvMaterial",this.isUberPBRMaterial=!0,this.isMeshStandardMaterial=!0,this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:!0,PHYSICAL:!0,OBJECTSPACE_NORMALMAP:!1,MODE_NORMALS:!1,MODE_XRAY:!1,CUT_PLANE:!1,USE_ZONEMAP:!1},this.uniforms=u.rD.merge([p.V.physical.uniforms,{aoMapMix:{value:new m.P(.25,.25,.25)},cutPlaneDirection:{value:new f.L(0,0,-1,0)},cutPlaneColor:{value:new m.P(1,0,0)},zoneMap:{value:null}}]),this._aoMapMix=this.uniforms.aoMapMix.value,this._cutPlaneDirection=this.uniforms.cutPlaneDirection.value,this._cutPlaneColor=this.uniforms.cutPlaneColor.value,this._zoneMap=this.uniforms.zoneMap.value,this.vertexShader=y,this.fragmentShader=v,this.color=new l.I(16777215),this.roughness=.7,this.metalness=0,e&&this.setValues(e)}set cutPlaneDirection(e){this._cutPlaneDirection.copy(e)}get cutPlaneDirection(){return this._cutPlaneDirection}set cutPlaneColor(e){this._cutPlaneColor.copy(e)}get cutPlaneColor(){return this._cutPlaneColor}set aoMapMix(e){this._aoMapMix.copy(e)}get aoMapMix(){return this._aoMapMix}set zoneMap(e){this._zoneMap=e,this.uniforms.zoneMap.value=e,this.needsUpdate=!0}get zoneMap(){return this._zoneMap}setShaderMode(e){switch(Object.assign(this,this._paramCopy),this.defines.MODE_NORMALS=!1,this.defines.MODE_XRAY=!1,this.defines.OBJECTSPACE_NORMALMAP=!(!this.normalMap||!this._objectSpaceNormalMap),this.side=this.defines.CUT_PLANE?d.ehD:this.side,this.needsUpdate=!0,e){case g.pH.Clay:this._paramCopy={color:this.color,map:this.map,roughness:this.roughness,metalness:this.metalness,aoMapIntensity:this.aoMapIntensity,blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite,envMap:this.envMap,transmission:this.transmission},this.color=this._clayColor,this.map=null,this.envMap=null,this.transmission=0,this.roughness=1,this.metalness=0,this.aoMapIntensity*=1,this.blending=d.jFi,this.transparent=!1,this.depthWrite=!0;break;case g.pH.Normals:this._paramCopy={blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite},this.defines.MODE_NORMALS=!0,this.blending=d.jFi,this.transparent=!1,this.depthWrite=!0;break;case g.pH.XRay:this._paramCopy={side:this.side,blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite},this.defines.MODE_XRAY=!0,this.side=d.ehD,this.blending=d.WMw,this.transparent=!0,this.depthWrite=!1;break;case g.pH.Wireframe:this._paramCopy={color:this.color,emissive:this.emissive,roughness:this.roughness,metalness:this.metalness,wireframe:this.wireframe,map:this.map,aoMap:this.aoMap,emissiveMap:this.emissiveMap,normalMap:this.normalMap},this.color=this._wireColor,this.emissive=this._wireEmissiveColor,this.roughness=.8,this.metalness=.1,this.wireframe=!0,this.map=null,this.aoMap=null,this.emissiveMap=null,this.normalMap=null,this.defines.OBJECTSPACE_NORMALMAP=!1}}enableCutPlane(e){this.defines.CUT_PLANE=e,e?(this._sideCopy=this.side,this.side=d.ehD):this.side=this._sideCopy}enableObjectSpaceNormalMap(e){e!==this._objectSpaceNormalMap&&(this._objectSpaceNormalMap=e),this.normalMap&&(this.normalMapType=d.PA7,this.needsUpdate=!0)}enableZoneMap(e){this.defines.USE_ZONEMAP=e}}var _=n(58754);class x{constructor(e){this.manager=void 0!==e?e:_.t,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(i,s){n.load(e,i,t,s)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}x.DEFAULT_MATERIAL_NAME="__DEFAULT";const w={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},S={};class M extends Error{constructor(e,t){super(e),this.response=t}}class E extends x{constructor(e){super(e)}load(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const s=w.get(e);if(void 0!==s)return this.manager.itemStart(e),setTimeout((()=>{t&&t(s),this.manager.itemEnd(e)}),0),s;if(void 0!==S[e])return void S[e].push({onLoad:t,onProgress:n,onError:i});S[e]=[],S[e].push({onLoad:t,onProgress:n,onError:i});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(r).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const n=S[e],i=t.body.getReader(),s=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),r=s?parseInt(s):0,o=0!==r;let a=0;const l=new ReadableStream({start(e){!function t(){i.read().then((({done:i,value:s})=>{if(i)e.close();else{a+=s.byteLength;const i=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:r});for(let e=0,t=n.length;e{switch(a){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,o)));case"json":return e.json();default:if(void 0===o)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,i=new TextDecoder(n);return e.arrayBuffer().then((e=>i.decode(e)))}}})).then((t=>{w.add(e,t);const n=S[e];delete S[e];for(let e=0,i=n.length;e{const n=S[e];if(void 0===n)throw this.manager.itemError(e),t;delete S[e];for(let e=0,i=n.length;e{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}var T=n(75809),C=n(35322);const A=new WeakMap;class P extends x{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,n,i){const s=new E(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(e=>{this.parse(e,t,i)}),n,i)}parse(e,t,n){this.decodeDracoFile(e,t,null,null,d.KI_).catch(n)}decodeDracoFile(e,t,n,i,s=d.GUF){const r={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:s};return this.decodeGeometry(e,r).then(t)}decodeGeometry(e,t){const n=JSON.stringify(t);if(A.has(e)){const t=A.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const s=this.workerNextTaskID++,r=e.byteLength,o=this._getWorker(s,r).then((n=>(i=n,new Promise(((n,r)=>{i._callbacks[s]={resolve:n,reject:r},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return o.catch((()=>!0)).then((()=>{i&&s&&this._releaseTask(i,s)})),A.set(e,{key:n,promise:o}),o}_createGeometry(e){const t=new T.u;e.index&&t.setIndex(new C.Tl(e.index.array,1));for(let n=0;n{n.load(e,t,void 0,i)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,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((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const i=R.toString(),s=["/* draco decoder */",n,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([s]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.lengtht._taskLoad?-1:1}));const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n}))}_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{const t=e.draco,o=new t.Decoder;try{const e=function(e,t,i,s){const r=s.attributeIDs,o=s.attributeTypes;let a,l;const c=t.GetEncodedGeometryType(i);if(c===e.TRIANGULAR_MESH)a=new e.Mesh,l=t.DecodeArrayToMesh(i,i.byteLength,a);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,l=t.DecodeArrayToPointCloud(i,i.byteLength,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const i in r){const l=self[o[i]];let c,d;if(s.useUniqueIDs)d=r[i],c=t.GetAttributeByUniqueId(a,d);else{if(d=t.GetAttributeId(a,e[r[i]]),-1===d)continue;c=t.GetAttribute(a,d)}const u=n(e,t,a,i,l,c);"color"===i&&(u.vertexColorSpace=s.vertexColorSpace),h.attributes.push(u)}c===e.TRIANGULAR_MESH&&(h.index=function(e,t,n){const i=3*n.num_faces(),s=4*i,r=e._malloc(s);t.GetTrianglesUInt32Array(n,s,r);const o=new Uint32Array(e.HEAPF32.buffer,r,i).slice();return e._free(r),{array:o,itemSize:1}}(e,t,a));return e.destroy(a),h}(t,o,new Int8Array(i),r),a=e.attributes.map((e=>e.array.buffer));e.index&&a.push(e.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:e},a)}catch(e){console.error(e),self.postMessage({type:"error",id:s.id,error:e.message})}finally{t.destroy(o)}}))}}}class L{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,i=e.length;n=s)break e;{const o=t[1];e=s)break t}r=n,n=0}}for(;n>>1;e0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;es.far)return;r.push({distance:l,distanceToRay:Math.sqrt(a),point:n,index:t,face:null,object:o})}}var Oe=n(29187),Ue=n(67440),ke=n(62257);class Ve extends Y.T{constructor(){super(),this.isBone=!0,this.type="Bone"}}class ze extends ee.x{constructor(e=null,t=1,n=1,i,s,r,o,a,l=d.TyD,c=d.TyD,h,u){super(null,r,o,a,l,c,i,s,h,u),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Fe=new U.y,Be=new U.y;class $e{constructor(e=[],t=[]){this.uuid=c.DO(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;et;)--r;if(++r,0!==s||r!==i){s>=r&&(r=Math.max(r,1),s=r-1);const e=this.getValueSize();this.times=n.slice(s,r),this.values=this.values.slice(s*e,r*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;0===s&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let r=null;for(let t=0;t!==s;t++){const i=n[t];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,i),e=!1;break}if(null!==r&&r>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,i,r),e=!1;break}r=i}if(void 0!==i&&He(i))for(let t=0,n=i.length;t!==n;++t){const n=i[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===d.pIN,s=e.length-1;let r=1;for(let o=1;o0){e[r]=e[s];for(let e=s*n,i=r*n,o=0;o!==n;++o)t[i+o]=t[e+o];++r}return r!==e.length?(this.times=e.slice(0,r),this.values=t.slice(0,r*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}Ke.prototype.TimeBufferType=Float32Array,Ke.prototype.ValueBufferType=Float32Array,Ke.prototype.DefaultInterpolation=d.NMF;class Je extends Ke{}Je.prototype.ValueTypeName="bool",Je.prototype.ValueBufferType=Array,Je.prototype.DefaultInterpolation=d.Syv,Je.prototype.InterpolantFactoryMethodLinear=void 0,Je.prototype.InterpolantFactoryMethodSmooth=void 0;class Qe extends Ke{}Qe.prototype.ValueTypeName="color";class et extends Ke{}et.prototype.ValueTypeName="number";class tt extends K{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=(n-t)/(i-t);let l=e*o;for(let e=l+o;l!==e;l+=4)k._.slerpFlat(s,0,r,l-o,r,l,a);return s}}class nt extends Ke{InterpolantFactoryMethodLinear(e){return new tt(this.times,this.values,this.getValueSize(),e)}}nt.prototype.ValueTypeName="quaternion",nt.prototype.DefaultInterpolation=d.NMF,nt.prototype.InterpolantFactoryMethodSmooth=void 0;class it extends Ke{}it.prototype.ValueTypeName="string",it.prototype.ValueBufferType=Array,it.prototype.DefaultInterpolation=d.Syv,it.prototype.InterpolantFactoryMethodLinear=void 0,it.prototype.InterpolantFactoryMethodSmooth=void 0;class st extends Ke{}st.prototype.ValueTypeName="vector";class rt{constructor(e,t=-1,n,i=d.IFH){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=c.DO(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let e=0,s=n.length;e!==s;++e)t.push(ot(n[e]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,i=n.length;e!==i;++e)t.push(Ke.toJSON(n[e]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,r=[];for(let e=0;e1){const e=r[1];let t=i[e];t||(i[e]=t=[]),t.push(n)}}const r=[];for(const e in i)r.push(this.CreateFromMorphTargetSequence(e,i[e],t,n));return r}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,i,s){if(0!==n.length){const r=[],o=[];We(n,r,o,i),0!==r.length&&s.push(new e(t,r,o))}},i=[],s=e.name||"default",r=e.fps||30,o=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e=2.0 are supported.")));const l=new nn(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(r),l.setPlugins(o),l.parse(n,i)}parseAsync(e,t){const n=this;return new Promise((function(i,s){n.parse(e,t,i,s)}))}}function ht(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const dt={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_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_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 ut{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,r)}}class Mt{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const r=s.extensions[t],o=i.images[r.source];let a=n.textureLoader;if(o.uri){const e=n.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(s){if(s)return n.loadTextureImage(e,r.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.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(1===t.height)}}))),this.isSupported}}class Et{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const r=s.extensions[t],o=i.images[r.source];let a=n.textureLoader;if(o.uri){const e=n.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(s){if(s)return n.loadTextureImage(e,r.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.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(1===t.height)}}))),this.isSupported}}class Tt{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],i=this.parser.getDependency("buffer",e.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.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 i.then((function(t){const n=e.byteOffset||0,i=e.byteLength||0,r=e.count,o=e.byteStride,a=new Uint8Array(t,n,i);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(r,o,a,e.mode,e.filter).then((function(e){return e.buffer})):s.ready.then((function(){const t=new ArrayBuffer(r*o);return s.decodeGltfBuffer(new Uint8Array(t),r,o,a,e.mode,e.filter),t}))}))}return null}}class Ct{constructor(e){this.name=dt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||void 0===n.mesh)return null;const i=t.meshes[n.mesh];for(const e of i.primitives)if(e.mode!==Vt.TRIANGLES&&e.mode!==Vt.TRIANGLE_STRIP&&e.mode!==Vt.TRIANGLE_FAN&&void 0!==e.mode)return null;const s=n.extensions[this.name].attributes,r=[],o={};for(const e in s)r.push(this.parser.getDependency("accessor",s[e]).then((t=>(o[e]=t,o[e]))));return r.length<1?null:(r.push(this.parser.createNodeMesh(e)),Promise.all(r).then((e=>{const t=e.pop(),n=t.isGroup?t.children:[t],i=e[0].count,s=[];for(const e of n){const t=new U.y,n=new m.P,r=new k._,a=new m.P(1,1,1),l=new X(e.geometry,e.material,i);for(let e=0;e-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||n||i&&s<98?this.textureLoader=new te(this.options.manager):this.textureLoader=new ne(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new E(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const r={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:n,userData:{}};return Xt(s,r,i),Yt(r,i),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(r)}))).then((function(){e(r)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,i=t.length;n{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[n,i]of e.children.entries())s(i,t.children[n])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n=2&&p.setY(t,h[e*r+1]),r>=3&&p.setZ(t,h[e*r+2]),r>=4&&p.setW(t,h[e*r+3]),r>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(e){const t=this.json,n=this.options,i=t.textures[e].source,s=t.images[i];let r=this.textureLoader;if(s.uri){const e=n.manager.getHandler(s.uri);null!==e&&(r=e)}return this.loadTextureImage(e,i,r)}loadTextureImage(e,t,n){const i=this,s=this.json,r=s.textures[e],o=s.images[t],a=(o.uri||o.bufferView)+":"+r.sampler;if(this.textureCache[a])return this.textureCache[a];const l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,t.name=r.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);const n=(s.samplers||{})[r.sampler]||{};return t.magFilter=Ft[n.magFilter]||d.wem,t.minFilter=Ft[n.minFilter]||d.D1R,t.wrapS=Bt[n.wrapS]||d.rpg,t.wrapT=Bt[n.wrapT]||d.rpg,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[a]=l,l}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const r=i.images[e],o=self.URL||self.webkitURL;let a=r.uri||"",l=!1;if(void 0!==r.bufferView)a=n.getDependency("bufferView",r.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:r.mimeType});return a=o.createObjectURL(t),a}));else if(void 0===r.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(e){return new Promise((function(n,i){let r=n;!0===t.isImageBitmapLoader&&(r=function(e){const t=new ee.x(e);t.needsUpdate=!0,n(t)}),t.load(L.resolveURL(e,s.path),r,void 0,i)}))})).then((function(e){var t;return!0===l&&o.revokeObjectURL(a),e.userData.mimeType=r.mimeType||((t=r.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e}));return this.sourceCache[e]=c,c}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then((function(r){if(!r)return null;if(void 0!==n.texCoord&&n.texCoord>0&&((r=r.clone()).channel=n.texCoord),s.extensions[dt.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=s.associations.get(r);r=s.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(r,e),s.associations.set(r,t)}}return void 0!==i&&(r.colorSpace=i),e[t]=r,r}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=void 0===t.attributes.tangent,s=void 0!==t.attributes.color,r=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new oe,re.F.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new ae.n,re.F.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(i||s||r){let e="ClonedMaterial:"+n.uuid+":";i&&(e+="derivative-tangents:"),s&&(e+="vertex-colors:"),r&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),s&&(t.vertexColors=!0),r&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return a.W}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let r;const a={},c=[];if((s.extensions||{})[dt.KHR_MATERIALS_UNLIT]){const e=i[dt.KHR_MATERIALS_UNLIT];r=e.getMaterialType(),c.push(e.extendParams(a,s,t))}else{const n=s.pbrMetallicRoughness||{};if(a.color=new l.I(1,1,1),a.opacity=1,Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;a.color.setRGB(e[0],e[1],e[2],d.GUF),a.opacity=e[3]}void 0!==n.baseColorTexture&&c.push(t.assignTexture(a,"map",n.baseColorTexture,d.KI_)),a.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,a.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(c.push(t.assignTexture(a,"metalnessMap",n.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",n.metallicRoughnessTexture))),r=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),c.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)}))))}!0===s.doubleSided&&(a.side=d.ehD);const h=s.alphaMode||Zt;if(h===qt?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,h===Wt&&(a.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&r!==O.v&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new o.F(1,1),void 0!==s.normalTexture.scale)){const e=s.normalTexture.scale;a.normalScale.set(e,e)}if(void 0!==s.occlusionTexture&&r!==O.v&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(a.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&r!==O.v){const e=s.emissiveFactor;a.emissive=(new l.I).setRGB(e[0],e[1],e[2],d.GUF)}return void 0!==s.emissiveTexture&&r!==O.v&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,d.KI_)),Promise.all(c).then((function(){const n=new r(a);return s.name&&(n.name=s.name),Yt(n,s),t.associations.set(n,{materials:e}),s.extensions&&Xt(i,n,s),n}))}createUniqueName(e){const t=me.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(e){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return sn(n,e,t)}))}const r=[];for(let n=0,o=e.length;n0&&Kt(u,s),u.name=t.createUniqueName(s.name||"mesh_"+e),Yt(u,s),h.extensions&&Xt(i,u,h),t.assignFinalMaterial(u),l.push(u)}for(let n=0,i=l.length;n1?new Oe.Z:1===t.length?t[0]:new Y.T,o!==t[0])for(let e=0,n=t.length;e{const t=new Map;for(const[e,n]of i.associations)(e instanceof re.F||e instanceof ee.x)&&t.set(e,n);return e.traverse((e=>{const n=i.associations.get(e);null!=n&&t.set(e,n)})),t})(s),s}))}_createAnimationTracks(e,t,n,i,s){const r=[],o=e.name?e.name:e.uuid,a=[];let l;switch(Ht[s.path]===Ht.weights?e.traverse((function(e){e.morphTargetInfluences&&a.push(e.name?e.name:e.uuid)})):a.push(o),Ht[s.path]){case Ht.weights:l=et;break;case Ht.rotation:l=nt;break;case Ht.position:case Ht.scale:l=st;break;default:if(1===n.itemSize)l=et;else l=st}const c=void 0!==i.interpolation?Gt[i.interpolation]:d.NMF,h=this._getArrayFromAccessor(n);for(let e=0,n=a.length;e=0}isValidMimeType(e){return on.mimeTypes.indexOf(e)>=0}get(e){return new Promise(((t,n)=>{this.gltfLoader.load(e,(e=>{t(this.createModelGroup(e))}),null,(i=>{null===this.gltfLoader||null===this.gltfLoader.dracoLoader?t(null):(console.error(`failed to load '${e}': ${i}`),n(new Error(i)))}))}))}createModelGroup(e){const t=e.scene;return t.traverse((e=>{if("Mesh"===e.type){const t=e;t.castShadow=!0;const n=t.material;n.map&&(n.map.colorSpace=d.KI_),t.geometry.computeBoundingBox();const i="MeshPhysicalMaterial"===n.type?new b:new rn.Z;n.flatShading&&(t.geometry.computeVertexNormals(),n.flatShading=!1,console.warn("Normals unavailable so they have been calculated. For best outcomes, please provide normals with geometry.")),"MeshPhysicalMaterial"!==n.type&&"MeshStandardMaterial"!==n.type||i.copy(n),n.userData.objectSpaceNormals&&i.enableObjectSpaceNormalMap(!0),t.material=i}})),t}}on.extensions=["gltf","glb"],on.mimeTypes=["model/gltf+json","model/gltf-binary"];var an=n(41654);const ln=/^[og]\s*(.+)?/,cn=/^mtllib /,hn=/^usemtl /,dn=/^usemap /,un=/\s+/,pn=new m.P,mn=new m.P,fn=new m.P,gn=new m.P,vn=new m.P,yn=new l.I;function bn(){const e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);const n=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){const n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);const i={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==n?n.smooth:this.smooth,groupStart:void 0!==n?n.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){const t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(i),i},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){const t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let e=this.materials.length-1;e>=0;e--)this.materials[e].groupCount<=0&&this.materials.splice(e,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},n&&n.name&&"function"==typeof n.clone){const e=n.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseNormalIndex:function(e,t){const n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseUVIndex:function(e,t){const n=parseInt(e,10);return 2*(n>=0?n-1:n+t/2)},addVertex:function(e,t,n){const i=this.vertices,s=this.object.geometry.vertices;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[n+0],i[n+1],i[n+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){const i=this.normals,s=this.object.geometry.normals;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(e,t,n){const i=this.vertices,s=this.object.geometry.normals;pn.fromArray(i,e),mn.fromArray(i,t),fn.fromArray(i,n),vn.subVectors(fn,mn),gn.subVectors(pn,mn),vn.cross(gn),vn.normalize(),s.push(vn.x,vn.y,vn.z),s.push(vn.x,vn.y,vn.z),s.push(vn.x,vn.y,vn.z)},addColor:function(e,t,n){const i=this.colors,s=this.object.geometry.colors;void 0!==i[e]&&s.push(i[e+0],i[e+1],i[e+2]),void 0!==i[t]&&s.push(i[t+0],i[t+1],i[t+2]),void 0!==i[n]&&s.push(i[n+0],i[n+1],i[n+2])},addUV:function(e,t,n){const i=this.uvs,s=this.object.geometry.uvs;s.push(i[e+0],i[e+1]),s.push(i[t+0],i[t+1]),s.push(i[n+0],i[n+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,i,s,r,o,a,l){const c=this.vertices.length;let h=this.parseVertexIndex(e,c),d=this.parseVertexIndex(t,c),u=this.parseVertexIndex(n,c);if(this.addVertex(h,d,u),this.addColor(h,d,u),void 0!==o&&""!==o){const e=this.normals.length;h=this.parseNormalIndex(o,e),d=this.parseNormalIndex(a,e),u=this.parseNormalIndex(l,e),this.addNormal(h,d,u)}else this.addFaceNormal(h,d,u);if(void 0!==i&&""!==i){const e=this.uvs.length;h=this.parseUVIndex(i,e),d=this.parseUVIndex(s,e),u=this.parseUVIndex(r,e),this.addUV(h,d,u),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,i=e.length;n=7?(yn.setRGB(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6])).convertSRGBToLinear(),t.colors.push(yn.r,yn.g,yn.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case"vt":t.uvs.push(parseFloat(e[1]),parseFloat(e[2]))}}else if("f"===r){const e=s.slice(1).trim().split(un),n=[];for(let t=0,i=e.length;t0){const e=i.split("/");n.push(e)}}const i=n[0];for(let e=1,s=n.length-1;e1){const e=i[1].trim().toLowerCase();t.object.smooth="0"!==e&&"off"!==e}else t.object.smooth=!0;const e=t.object.currentMaterial();e&&(e.smooth=t.object.smooth)}else{if("\0"===s)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+s+'"')}}t.finalize();const s=new Oe.Z;s.materialLibraries=[].concat(t.materialLibraries);if(!0===!(1===t.objects.length&&0===t.objects[0].geometry.vertices.length))for(let e=0,n=t.objects.length;e0&&c.setAttribute("normal",new C.a$(i.normals,3)),i.colors.length>0&&(l=!0,c.setAttribute("color",new C.a$(i.colors,3))),!0===i.hasUVIndices&&c.setAttribute("uv",new C.a$(i.uvs,2));const h=[];for(let e=0,n=r.length;e1){for(let e=0,t=r.length;e0){const e=new oe({size:1,sizeAttenuation:!1}),n=new T.u;n.setAttribute("position",new C.a$(t.vertices,3)),t.colors.length>0&&void 0!==t.colors[0]&&(n.setAttribute("color",new C.a$(t.colors,3)),e.vertexColors=!0);const i=new De(n,e);s.add(i)}return s}}const xn=new l.I;class wn extends x{constructor(e){super(e),this.propertyNameMapping={},this.customPropertyMapping={}}load(e,t,n,i){const s=this,r=new E(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,(function(n){try{t(s.parse(n))}catch(t){i?i(t):console.error(t),s.manager.itemError(e)}}),n,i)}setPropertyNameMapping(e){this.propertyNameMapping=e}setCustomPropertyNameMapping(e){this.customPropertyMapping=e}parse(e){function t(e,t=0){let n="";const i=/^ply([\s\S]*)end_header(\r\n|\r|\n)/.exec(e);null!==i&&(n=i[1]);const s={comments:[],elements:[],headerLength:t,objInfo:""},r=n.split(/\r\n|\r|\n/);let o;function a(e,t){const n={type:e[0]};return"list"===n.type?(n.name=e[3],n.countType=e[1],n.itemType=e[2]):n.name=e[1],n.name in t&&(n.name=t[n.name]),n}for(let e=0;ee.name));function n(e){for(let n=0,i=e.length;n0&&t.setIndex(e.indices),t.setAttribute("position",new C.a$(e.vertices,3)),e.normals.length>0&&t.setAttribute("normal",new C.a$(e.normals,3)),e.uvs.length>0&&t.setAttribute("uv",new C.a$(e.uvs,2)),e.colors.length>0&&t.setAttribute("color",new C.a$(e.colors,3)),(e.faceVertexUvs.length>0||e.faceVertexColors.length>0)&&(t=t.toNonIndexed(),e.faceVertexUvs.length>0&&t.setAttribute("uv",new C.a$(e.faceVertexUvs,2)),e.faceVertexColors.length>0&&t.setAttribute("color",new C.a$(e.faceVertexColors,3)));for(const n of Object.keys(u.customPropertyMapping))e[n].length>0&&t.setAttribute(n,new C.a$(e[n],u.customPropertyMapping[n].length));return t.computeBoundingSphere(),t}function l(e,t,n,i){if("vertex"===t){e.vertices.push(n[i.attrX],n[i.attrY],n[i.attrZ]),null!==i.attrNX&&null!==i.attrNY&&null!==i.attrNZ&&e.normals.push(n[i.attrNX],n[i.attrNY],n[i.attrNZ]),null!==i.attrS&&null!==i.attrT&&e.uvs.push(n[i.attrS],n[i.attrT]),null!==i.attrR&&null!==i.attrG&&null!==i.attrB&&(xn.setRGB(n[i.attrR]/255,n[i.attrG]/255,n[i.attrB]/255).convertSRGBToLinear(),e.colors.push(xn.r,xn.g,xn.b));for(const t of Object.keys(u.customPropertyMapping))for(const i of u.customPropertyMapping[t])e[t].push(n[i])}else if("face"===t){const t=n.vertex_indices||n.vertex_index,s=n.texcoord;3===t.length?(e.indices.push(t[0],t[1],t[2]),s&&6===s.length&&(e.faceVertexUvs.push(s[0],s[1]),e.faceVertexUvs.push(s[2],s[3]),e.faceVertexUvs.push(s[4],s[5]))):4===t.length&&(e.indices.push(t[0],t[1],t[3]),e.indices.push(t[1],t[2],t[3])),null!==i.attrR&&null!==i.attrG&&null!==i.attrB&&(xn.setRGB(n[i.attrR]/255,n[i.attrG]/255,n[i.attrB]/255).convertSRGBToLinear(),e.faceVertexColors.push(xn.r,xn.g,xn.b),e.faceVertexColors.push(xn.r,xn.g,xn.b),e.faceVertexColors.push(xn.r,xn.g,xn.b))}}function c(e,t){const n={};let i=0;for(let s=0;se.getInt8(t),size:1};case"uint8":case"uchar":return{read:t=>e.getUint8(t),size:1};case"int16":case"short":return{read:t=>e.getInt16(t,n),size:2};case"uint16":case"ushort":return{read:t=>e.getUint16(t,n),size:2};case"int32":case"int":return{read:t=>e.getInt32(t,n),size:4};case"uint32":case"uint":return{read:t=>e.getUint32(t,n),size:4};case"float32":case"float":return{read:t=>e.getFloat32(t,n),size:4};case"float64":case"double":return{read:t=>e.getFloat64(t,n),size:8}}}for(let s=0,r=e.length;s=this.arr.length}next(){return this.arr[this.i++]}}class Mn{constructor(e){this.objLoader=new _n(e),this.plyLoader=new wn(e)}isValid(e){const t=e.split(".").pop().toLowerCase();return Mn.extensions.indexOf(t)>=0}get(e){const t=e.split(".").pop().toLowerCase();return new Promise(((n,i)=>{if("obj"===t)this.objLoader.load(e,(t=>{const s=t.children[0].geometry;return s&&"Geometry"===s.type||"BufferGeometry"===s.type?n(s):i(new Error(`Can't parse geometry from '${e}'`))}));else{if("ply"!==t)throw new Error(`Can't load geometry, unknown extension: '${t}' in '${e}'`);this.plyLoader.load(e,(t=>t&&"Geometry"===t.type||"BufferGeometry"===t.type?n(t):i(new Error(`Can't parse geometry from '${e}'`))))}}))}}Mn.extensions=["obj","ply"];class En{constructor(e){this.textureLoader=new te(e)}isValid(e){const t=e.split(".").pop().toLowerCase();return En.extensions.indexOf(t)>=0}isValidMimeType(e){return En.mimeTypes.indexOf(e)>=0}get(e){return new Promise(((t,n)=>{this.textureLoader.load(e,(e=>{t(e)}),null,(e=>{console.error(e),n(new Error(e.message))}))}))}getImmediate(e){return this.textureLoader.load(e,null,null,(e=>{console.error(e)}))}}En.extensions=["jpg","png"],En.mimeTypes=["image/jpeg","image/png"];class Tn{constructor(e){this._customFontPath=null,this._loadingManager=e,this._textureLoader=new te(e),this._cache={}}set fontPath(e){this._customFontPath=e}get fontPath(){return this._customFontPath}get(e){return this._cache[e]}async load(e){if(this._cache[e])return Promise.resolve(this._cache[e]);this._loadingManager.itemStart(e);const t=this.fontPath,n=t?t+e+".json":An+e+".json",i=t?t+e+".png":An+e+".png",s=fetch(n,{headers:{Accept:"application/json"}}).then((t=>{if(!t.ok)throw this._loadingManager.itemError(e),new Error(`failed to load bitmap font descriptor: '${n}', status: ${t.status} ${t.statusText}`);return t.json()})),r=new Promise(((e,t)=>{this._textureLoader.load(i,(n=>n?e(n):t(new Error(`failed to load font texture from '${i}'`))))}));return Promise.all([s,r]).then((t=>{const n={descriptor:t[0],texture:t[1]};return this._cache[e]=n,this._loadingManager.itemEnd(e),n}))}}var Cn=n(63872);const An="https://cdn.jsdelivr.net/gh/smithsonian/dpo-voyager@latest/assets/";class Pn extends s.ZP{constructor(e,t){super(e,t),this.systemAssetPath=null;const n=this.assetManager.loadingManager;this.jsonLoader=new r(n),this.modelLoader=new on(n),this.geometryLoader=new Mn(n),this.textureLoader=new En(n),this.fontReader=new Tn(n)}dispose(){this.modelLoader.dispose(),super.dispose()}get assetManager(){return this.getMainComponent(Cn.Z)}setDracoPath(e){this.modelLoader.dracoPath=e}setSystemAssetPath(e){this.fontReader.fontPath=e,this.systemAssetPath=e}getSystemAssetUrl(e){return(this.systemAssetPath||An)+e}async getJSON(e){const t=this.assetManager.getAssetUrl(e);return this.jsonLoader.get(t)}async getText(e){const t=this.assetManager.getAssetUrl(e);return i.Z.text(t,"GET")}async getModel(e){const t=this.assetManager.getAssetUrl(e);return this.modelLoader.get(t)}async getGeometry(e){const t=this.assetManager.getAssetUrl(e);return this.geometryLoader.get(t)}async getTexture(e){const t=this.assetManager.getAssetUrl(e);return this.textureLoader.get(t)}async getFont(e){const t=this.assetManager.getAssetUrl(e);return this.fontReader.load(t)}async getSystemTexture(e){const t=this.getSystemAssetUrl(e);return this.textureLoader.get(t)}async getSystemJSON(e){const t=this.getSystemAssetUrl(e);return this.jsonLoader.get(t)}}Pn.typeName="CVAssetReader",Pn.text="AssetReader",Pn.icon="",Pn.isSystemSingleton=!0},17467:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i=n(80038),s=n(84678),r=n(63872),o=n(93072),a=n(1594),l=n(10564),c=n(51120),h=n(11359),d=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class u extends i.ZP{constructor(){super(...arguments),this._narrationId=null,this._activeId=null,this._audioMap={},this.audioClips={},this.audioPlayer=null,this.audioView=null,this.audioViews={},this.isPlaying=!1,this.ins=this.addInputs(u.ins),this.outs=this.addOutputs(u.outs),this.onEnd=()=>{const{outs:e}=this;this.isPlaying=!1,e.isPlaying.setValue(!1),this.audioView.requestUpdate()},this.onCueChange=e=>{const t=e.target.track.activeCues,n=t.length>0?t[0].text:"";this.ins.activeCaption.setValue(n)},this.onLoadTrack=e=>{const t=this.audioPlayer.children[0].track.cues;0===t[0].startTime&&(t[0].startTime=.01)},this.onTimeChange=e=>{this.audioView.elapsed=this.getTimeElapsed(),this.audioView.requestUpdate()}}get assetManager(){return this.getMainComponent(r.Z)}get language(){return this.getGraphComponent(o.Z,!0)}get analytics(){return this.system.getMainComponent(h.Z)}get narrationId(){return this._narrationId||""}set narrationId(e){this._narrationId=e,this.outs.narrationEnabled.setValue(e.length>0)}get activeId(){return this._activeId||""}set activeId(e){this._activeId=e}create(){super.create(),this.graph.components.on(s.Z,this.onMetaComponent,this),this.language.outs.language.on("value",this.onLanguageChange,this)}dispose(){Object.keys(this._audioMap).forEach((e=>URL.revokeObjectURL(this._audioMap[e]))),this.language.outs.language.off("value",this.onLanguageChange,this),this.graph.components.off(s.Z,this.onMetaComponent,this),super.dispose()}update(){const{ins:e,outs:t}=this;return e.playNarration.changed&&this.audioPlayer&&this._narrationId&&(t.narrationPlaying.value&&this.activeId==this._narrationId?this.stop():t.narrationPlaying.value||this.play(this._narrationId),t.narrationPlaying.setValue(!t.narrationPlaying.value)),!0}getPlayerById(e){if(!this.audioViews.hasOwnProperty(e)){const t=this.audioViews[e]=new p;t.audio=this,t.audioId=e,t.requestUpdate()}return this.audioViews[e]}getAudioList(){return Object.keys(this.audioClips).map((e=>this.audioClips[e]))}getAudioClip(e){return this.audioClips[e]}getAudioClipUri(e){const t=this.audioClips[e];return t?t.uris[a.PD[this.language.outs.language.value]]:null}getClipCaptionUri(e){const t=this.audioClips[e];return t?t.captionUris[a.PD[this.language.outs.language.value]]:null}getDuration(e){const t=this.audioClips[e],n=a.PD[this.language.outs.language.getValidatedValue()],i=t.durations[n];if(i)return i;{const t=this.audioClips[e];return Object.keys(t.uris).forEach((n=>{const i=t.uris[n];if(i){const s=this.assetManager.getAssetUrl(i);t.durations[n]="pending";const r=new(window.AudioContext||window.webkitAudioContext),o=new XMLHttpRequest;o.open("GET",s,!0),o.responseType="arraybuffer",o.onload=()=>{const s=new Blob([o.response],{type:"audio/mpeg"}),a=window.URL.createObjectURL(s);this._audioMap[i]=a,r.decodeAudioData(o.response,(i=>{let s=i.duration;t.durations[n]=s.toString(),this.getPlayerById(e).requestUpdate()}))},o.send()}})),"pending"}}getTimeElapsed(){return this.audioPlayer?Math.floor(this.audioPlayer.currentTime):0}setTimeElapsed(e){this.audioPlayer&&(0===this.audioPlayer.seekable.length?this.audioPlayer.addEventListener("canplay",(()=>this.setTimeElapsed(e)),{once:!0}):(this.audioPlayer.currentTime=e,this.audioView.elapsed=e,this.audioView.requestUpdate()))}addAudioClip(e){this.audioClips[e.id]=e,this.outs.updated.set()}removeAudioClip(e){this.isPlaying&&e==this.activeId&&this.stop(),e==this._narrationId&&(this.narrationId=""),delete this.audioClips[e]}updateAudioClip(e){this.getDuration(e),this.outs.updated.set()}onMetaComponent(e){const t=e.object;"NVScene"===t.node.typeName&&e.add&&(this.audioClips=t.audio.dictionary,t.once("load",(()=>{this.audioClips=t.audio.dictionary,this.outs.updated.set(),Object.keys(this.audioClips).forEach((e=>{this.updateAudioClip(this.audioClips[e].id)}))})))}fromData(e){const{outs:t}=this;e=e||{},this._narrationId=e.narrationId||null,t.narrationEnabled.setValue(null!=this._narrationId),this.audioClips[this._narrationId]||(t.narrationEnabled.setValue(!1),console.warn("Invalid narration audio ID"))}toData(){let e=null;return null!==this._narrationId&&(e={narrationId:this._narrationId}),e}play(e){const{outs:t}=this;t.isPlaying.value&&this.audioPlayer.pause(),this.activeId!==e&&this.setTimeElapsed(0),t.isPlaying.setValue(!0),this.audioView=this.audioViews[e],this.initializeClip(e),this.audioPlayer.play().then((()=>{this.activeId=e,this.isPlaying=!0,Object.keys(this.audioViews).forEach((e=>this.audioViews[e].requestUpdate())),this.analytics.sendProperty("Audio_Play",this.getAudioClipUri(e))})).catch((e=>l.ZP.show(`Failed to play audio at '${this.audioPlayer.getAttribute("src")}':${e}`,"warning")))}pause(){this.audioPlayer&&(this.outs.isPlaying.setValue(!1),this.audioPlayer.pause(),this.audioView.requestUpdate())}stop(){this.audioPlayer&&(this.pause(),this.setTimeElapsed(0),this.onEnd())}initializeClip(e){null===this.audioPlayer&&this.setupAudio();const t=this.audioClips[e];if(t){const e=t.uris[a.PD[this.language.outs.language.getValidatedValue()]];this.assetManager.getAssetUrl(e);if(this.audioPlayer.src!=this._audioMap[e]){this.audioPlayer.setAttribute("src",this._audioMap[e]),this.audioPlayer.load(),this.audioPlayer.children[0].setAttribute("src","");const n=t.captionUris[a.PD[this.language.outs.language.getValidatedValue()]];n&&this.audioPlayer.children[0].setAttribute("src",this.assetManager.getAssetUrl(n))}}}setupAudio(){if(null===this.audioPlayer){const e=this.audioPlayer=document.createElement("audio");e.onended=this.onEnd,e.setAttribute("controls",""),e.setAttribute("preload","auto"),e.addEventListener("timeupdate",this.onTimeChange),e.crossOrigin="anonymous",e.onerror=()=>{console.error(`Error ${e.error.code}; details: ${e.error.message}`)};const t=document.createElement("track");t.setAttribute("default",""),this.audioPlayer.append(t),t.addEventListener("cuechange",this.onCueChange),t.addEventListener("load",this.onLoadTrack)}}onLanguageChange(){this.stop()}}u.typeName="CVAudioManager",u.text="Audio",u.icon="",u.isSystemSingleton=!0,u.ins={playNarration:i.V5.Event("Audio.PlayNarration"),activeCaption:i.V5.String("Audio.ActiveCaption"),captionsEnabled:i.V5.Boolean("Audio.CaptionsEnabled",!0)},u.outs={narrationEnabled:i.V5.Boolean("Audio.NarrationEnabled",!1),narrationPlaying:i.V5.Boolean("Audio.NarrationPlaying",!1),isPlaying:i.V5.Boolean("Audio.IsPlaying",!1),updated:i.V5.Event("Audio.Updated")};let p=class extends c.ZP{constructor(){super(),this.audio=null,this.audioId="",this.elapsed=0,this.onDrag=this.onDrag.bind(this)}firstConnected(){this.classList.add("sv-audio-view")}update(e){if(e.has("elapsed")){const e=this.querySelector("#time-slider");e&&(e.value=this.elapsed.toString())}super.update(e)}render(){const e=this.audio.outs.isPlaying.value&&this.audioId==this.audio.activeId,t=this.audio.getDuration(this.audioId),n=this.formatSeconds(this.elapsed),i="pending"==t?t:this.formatSeconds(parseInt(t));return c.dy`this.playAudio(e,this.audioId)}>
${n}/${i}
`}playAudio(e,t){const n=this.audio;this.audio.outs.isPlaying.value&&this.audioId==this.audio.activeId?n.pause():n.play(t)}onDrag(e){e.stopPropagation()}onTimeChange(){this.audioId==this.audio.activeId&&(this.audio.initializeClip(this.audioId),this.audio.setTimeElapsed(0|parseFloat(this.querySelector("#time-slider").value)))}formatSeconds(e){var t=new Date(0);return t.setSeconds(e),t.toISOString().substring(15,19)}};d([(0,c.Cb)({attribute:!1})],p.prototype,"audio",void 0),d([(0,c.Cb)({attribute:!1})],p.prototype,"audioId",void 0),d([(0,c.Cb)({attribute:!1})],p.prototype,"elapsed",void 0),p=d([(0,c.Mo)("sv-audio-view")],p)},71507:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(76969);class s extends i.Z{constructor(e,t){super(e,t),this.background.layers.set(1)}get settingProperties(){return[this.ins.style,this.ins.color0,this.ins.color1]}get snapshotProperties(){return[this.ins.color0,this.ins.color1]}hide(){this.background.visible=!1}show(){this.background.visible=!0}fromData(e){this.ins.copyValues({style:i.u[e.style]||i.u.Solid,color0:e.color0||[.2,.25,.3],color1:e.color1||[.01,.03,.05]})}toData(){const e=this.ins;return{style:i.u[e.style.value],color0:e.color0.cloneValue(),color1:e.color1.cloneValue()}}}s.typeName="CVBackground"},27884:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var i=n(19588),s=n(82954),r=n(78943),o=n(80038),a=n(26775),l=n(2837),c=n(28581);const h=new i.P,d=new i.P,u=new s.U,p=new r._;class m extends l.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(m.camIns),this.object3D=new a.ZP}get camera(){return this.object3D}update(){const{autoActivate:e,activate:t}=this.ins;if(t.changed||e.changed&&e.value){const e=this.scene;e&&(e.activeCameraComponent=this)}const n=this.camera,{position:i,rotation:s,projection:r,fov:o,size:a,zoom:l,near:c,far:h}=this.ins;if(i.changed||s.changed){n.position.fromArray(i.value);const e=[s.value[0],s.value[1],s.value[2]];n.rotation.fromArray(e),n.updateMatrix()}return r.changed&&n.setProjection(r.getValidatedValue()),n.fov=o.value,n.size=a.value,n.zoom=l.value,n.near=c.value,n.far=h.value,n.updateProjectionMatrix(),!0}dispose(){const e=this.scene;e&&e.activeCameraComponent===this&&(e.activeCameraComponent=null),super.dispose()}setPropertiesFromMatrix(e){const t=!e;e=e||this.object3D.matrix;const{position:n,rotation:i,order:s}=this.ins;e.decompose(h,p,d),h.toArray(n.value);const r=s.getOptionText();u.setFromQuaternion(p,r),h.setFromEuler(u),h.multiplyScalar(c.Z.RAD2DEG).toArray(i.value),n.set(t),i.set(t)}}m.typeName="CCamera",m.camIns={autoActivate:o.V5.Boolean("Camera.AutoActivate",!0),activate:o.V5.Event("Camera.Activate"),position:o.V5.Vector3("Transform.Position"),rotation:o.V5.Vector3("Transform.Rotation"),order:o.V5.Enum("Transform.Order",l.VZ,l.VZ.ZYX),projection:o.V5.Enum("Projection.Type",a.mP,a.mP.Perspective),fov:o.V5.Number("Projection.FovY",52),size:o.V5.Number("Projection.Size",20),zoom:o.V5.Number("Projection.Zoom",1),near:o.V5.Number("Frustum.ZNear",.01),far:o.V5.Number("Frustum.ZFar",1e4)};class f extends m{constructor(e,t){super(e,t),this.addIns=this.addInputs(f.cameraAddIns),this.object3D.layers.enable(1)}get settingProperties(){return[this.ins.projection,this.ins.fov,this.ins.size,this.ins.near,this.ins.far,this.addIns.autoNearFar]}fromDocument(e,t){if(!isFinite(t.camera))throw new Error("camera property missing in node");const n=e.cameras[t.camera];return null!=n.autoNearFar&&this.addIns.autoNearFar.setValue(n.autoNearFar),"perspective"===n.type?this.ins.copyValues({projection:a.mP.Perspective,fov:n.perspective.yfov,near:n.perspective.znear,far:n.perspective.zfar}):this.ins.copyValues({projection:a.mP.Orthographic,size:n.orthographic.ymag,near:n.orthographic.znear,far:n.orthographic.zfar}),t.camera}toDocument(e,t){const n=this.ins,i={};n.projection.getValidatedValue()===a.mP.Perspective?(i.type="perspective",i.perspective={yfov:n.fov.value,znear:n.near.value,zfar:n.far.value}):(i.type="orthographic",i.orthographic={ymag:n.size.value,znear:n.near.value,zfar:n.far.value}),i.autoNearFar=this.addIns.autoNearFar.value,e.cameras=e.cameras||[];const s=e.cameras.length;return e.cameras.push(i),s}}f.typeName="CVCamera",f.text="Camera",f.icon="video",f.cameraAddIns={autoNearFar:l.V5.Boolean("Frustum.AutoNearFar",!0)}},48377:(e,t,n)=>{"use strict";n.d(t,{Z:()=>M});var i=n(31271),s=n(80038),r=n(25499),o=n(18894),a=n(92642),l=n(36283);class c extends o.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(c.rgIns),this._object3D=null,this._isAttached=!1,this._object3D=new r.T,this._object3D.matrixAutoUpdate=!1}get transform(){return this.node.components.get(a.ZP,!0)}get scene(){const e=this.transform;return e?e.getParentComponent(l.Z,!0):void 0}get object3D(){return this._object3D}create(){super.create(),this.innerRoots.filter((e=>e.is(a.ZP))).forEach((e=>this._object3D.add(e.object3D))),this.trackComponent(a.ZP,(e=>this.ins.visible.value&&this.attachObject3D(e)),(e=>this.detachObject3D(e)))}dispose(){this.detachObject3D(this.transform),this.innerRoots.filter((e=>e.is(a.ZP))).forEach((e=>this._object3D.remove(e.object3D))),super.dispose()}update(e){super.update(e);const t=this.ins;if(t.visible.changed){const e=this.transform;t.visible.value?this.attachObject3D(e):this.detachObject3D(e)}return!0}onAddInnerRoot(e){e.is(a.ZP)&&this._object3D.add(e.object3D)}onRemoveInnerRoot(e){e.is(a.ZP)&&this._object3D.remove(e.object3D)}attachObject3D(e){this._isAttached||e&&(e.object3D.add(this._object3D),this._isAttached=!0)}detachObject3D(e){this._isAttached&&e&&(e.object3D.remove(this._object3D),this._isAttached=!1)}}c.typeName="CRenderGraph",c.rgIns={visible:o.V5.Boolean("Graph.Visible",!0)};var h=n(75310),d=n.n(h);const u=JSON.parse('{"$id":"https://schemas.3d.si.edu/voyager/document.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Smithsonian 3D Document","description":"Describes a 3D document containing a scene with 3D models.","definitions":{"scene":{"$id":"#scene","type":"object","properties":{"nodes":{"type":"array","description":"The indices of the scene\'s root nodes.","items":{"type":"integer","minimum":0},"uniqueItems":true,"minItems":1},"setup":{"description":"The index of the scene\'s setup.","type":"integer","minimum":0}}},"node":{"$id":"#node","type":"object","properties":{"name":{"type":"string"},"children":{"type":"array","description":"The indices of this node\'s children.","items":{"type":"integer","minimum":0},"uniqueItems":true,"minItems":1},"matrix":{"description":"A floating-point 4x4 transformation matrix stored in column-major order.","type":"array","items":{"type":"number"},"minItems":16,"maxItems":16,"default":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},"translation":{"description":"The node\'s translation along the x, y, and z axes.","type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"default":[0,0,0]},"rotation":{"description":"The node\'s unit quaternion rotation in the order (x, y, z, w), where w is the scalar.","type":"array","items":{"type":"number","minimum":-1,"maximum":1},"minItems":4,"maxItems":4,"default":[0,0,0,1]},"scale":{"description":"The node\'s non-uniform scale, given as the scaling factors along the x, y, and z axes.","type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"default":[1,1,1]},"camera":{"description":"The index of the camera component of this node.","type":"integer","minimum":0},"light":{"description":"The index of the light component of this node.","type":"integer","minimum":0},"meta":{"description":"The index of the meta data component of this node.","type":"integer","minimum":0},"model":{"description":"The index of the model component of this node.","type":"integer","minimum":0}},"not":{"anyOf":[{"required":["matrix","translation"]},{"required":["matrix","rotation"]},{"required":["matrix","scale"]}]}},"camera":{"$id":"#camera","type":"object","properties":{"type":{"description":"Specifies if the camera uses a perspective or orthographic projection.","type":"string","enum":["perspective","orthographic"]},"perspective":{"description":"A perspective camera containing properties to create a perspective projection matrix.","type":"object","properties":{"yfov":{"type":"number","description":"The floating-point vertical field of view in radians.","exclusiveMinimum":0},"aspectRatio":{"type":"number","description":"The floating-point aspect ratio of the field of view.","exclusiveMinimum":0},"znear":{"type":"number","description":"The floating-point distance to the near clipping plane.","exclusiveMinimum":0},"zfar":{"type":"number","description":"The floating-point distance to the far clipping plane.","exclusiveMinimum":0}},"required":["yfov","znear"]},"orthographic":{"description":"An orthographic camera containing properties to create an orthographic projection matrix.","type":"object","properties":{"xmag":{"type":"number","description":"The floating-point horizontal magnification of the view. Must not be zero."},"ymag":{"type":"number","description":"The floating-point vertical magnification of the view. Must not be zero."},"znear":{"type":"number","description":"The floating-point distance to the near clipping plane.","exclusiveMinimum":0},"zfar":{"type":"number","description":"The floating-point distance to the far clipping plane. `zfar` must be greater than `znear`.","exclusiveMinimum":0}},"required":["ymag","znear","zfar"]},"autoNearFar":{"type":"boolean","default":true}},"required":["type"],"not":{"required":["perspective","orthographic","autoNearFar"]}},"light":{"$id":"#light","type":"object","properties":{"type":{"description":"Specifies the type of the light source.","type":"string","enum":["ambient","directional","point","spot","hemisphere","rect"]},"color":{"$ref":"#/definitions/colorRGB"},"intensity":{"type":"number","minimum":0,"default":1},"castShadow":{"type":"boolean","default":false},"point":{"type":"object","properties":{"distance":{"type":"number","minimum":0},"decay":{"type":"number","minimum":0}}},"spot":{"type":"object","properties":{"distance":{"type":"number","minimum":0},"decay":{"type":"number","minimum":0},"angle":{"type":"number","minimum":0},"penumbra":{"type":"number","minimum":0}}},"hemisphere":{"type":"object","properties":{"groundColor":{"$ref":"#/definitions/colorRGB"}}}},"required":["type"],"not":{"required":["point","spot","hemisphere"]}},"colorRGB":{"$id":"#colorRGB","type":"array","items":{"type":"number","minimum":0,"maximum":1},"minItems":3,"maxItems":3,"default":[1,1,1]}},"type":"object","properties":{"asset":{"type":"object","properties":{"type":{"type":"string","const":"application/si-dpo-3d.document+json"},"version":{"description":"Version of this presentation description.","type":"string","minLength":1},"copyright":{"description":"A copyright message to credit the content creator.","type":"string","minLength":1},"generator":{"description":"Tool that generated this presentation description.","type":"string","minLength":1}},"required":["type","version"]},"scene":{"description":"Index of the root scene of the document.","type":"integer","minimum":0},"scenes":{"description":"An array of scenes.","type":"array","items":{"$ref":"#/definitions/scene"}},"nodes":{"description":"An array of nodes.","type":"array","items":{"$ref":"#/definitions/node"},"minItems":1},"metas":{"description":"An array of meta data components.","type":"array","items":{"$ref":"./meta.schema.json"}},"setups":{"description":"An array of setup components.","type":"array","items":{"$ref":"./setup.schema.json"},"minItems":1},"cameras":{"description":"An array of camera components.","type":"array","items":{"$ref":"#/definitions/camera"},"minItems":1},"lights":{"description":"An array of light components.","type":"array","items":{"$ref":"#/definitions/light"},"minItems":1},"models":{"description":"An array of model components.","type":"array","items":{"$ref":"./model.schema.json"},"minItems":1}},"required":["asset","scene","scenes"],"additionalProperties":false}'),p=JSON.parse('{"$id":"https://schemas.3d.si.edu/voyager/common.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Math","description":"Definitions for mathematical compound objects such as vectors and matrices.","definitions":{"units":{"$id":"#units","type":"string","enum":["inherit","mm","cm","m","km","in","ft","yd","mi"]},"vector2":{"description":"2-component vector.","$id":"#vector2","type":"array","items":{"type":"number"},"minItems":2,"maxItems":2,"default":[0,0]},"vector3":{"description":"3-component vector.","$id":"#vector3","type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"default":[0,0,0]},"vector4":{"description":"4-component vector.","$id":"#vector4","type":"array","items":{"type":"number"},"minItems":4,"maxItems":4,"default":[0,0,0,0]},"matrix3":{"description":"3 by 3, matrix, storage: column-major.","$id":"#matrix3","type":"array","items":{"type":"number"},"minItems":9,"maxItems":9,"default":[1,0,0,0,1,0,0,0,1]},"matrix4":{"description":"4 by 4 matrix, storage: column-major.","$id":"#matrix4","type":"array","items":{"type":"number"},"minItems":16,"maxItems":16,"default":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},"boundingBox":{"description":"Axis-aligned 3D bounding box.","$id":"#boundingBox","type":"object","properties":{"min":{"$ref":"#/definitions/vector3"},"max":{"$ref":"#/definitions/vector3"}},"required":["min","max"]}}}'),m=JSON.parse('{"$id":"https://schemas.3d.si.edu/voyager/meta.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Meta","description":"Meta data for a scene or model item.","definitions":{"image":{"$id":"image","description":"Reference to a preview image","type":"object","properties":{"uri":{"description":"Location of the image resource, absolute URL or path relative to this document","type":"string","minLength":1},"quality":{"type":"string","enum":["Thumb","Low","Medium","High"]},"byteSize":{"type":"integer","minimum":1},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1},"usage":{"type":"string","enum":["Render","ARCode"]}},"required":["uri","quality"]},"article":{"$id":"#article","description":"Reference to an external document (HTML)","type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"description":"Short title.","type":"string"},"titles":{"description":"Short title with language key.","type":"object"},"lead":{"description":"Short lead text.","type":"string"},"leads":{"description":"Short lead text with language key.","type":"object"},"tags":{"description":"Array of tags, categorizing the article.","type":"array","items":{"type":"string"}},"taglist":{"description":"Array of tags, categorizing the annotation with language key.","type":"object"},"intros":{"description":"Introductory splash screen text with language key.","type":"object"},"uri":{"description":"Location of the article resource, absolute URL or path relative to this document","type":"string","minLength":1},"uris":{"description":"Location of the article resource, absolute URL or path relative to this document with language key","type":"object"},"mimeType":{"description":"MIME type of the resource.","type":"string"},"thumbnailUri":{"description":"Location of a thumbnail/preview image of the resource.","type":"string"}},"required":["id"],"additionalProperties":false},"audioclip":{"$id":"audioclip","description":"Reference to an audio file","type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"description":"Short name.","type":"string"},"uris":{"description":"Location of the audio resource, absolute URL or path relative to this document with language key","type":"object"},"captionUris":{"description":"Location of the caption resource, absolute URL or path relative to this document with language key","type":"object"},"durations":{"description":"Length of the audio resource with language key","type":"object"}},"required":["id","uris"]}},"type":"object","properties":{"collection":{"description":"Information retrieved from the collection record for the item.","type":"object"},"process":{"description":"Information about how the item was processed.","type":"object"},"images":{"type":"array","items":{"$ref":"#/definitions/image"},"minItems":1},"articles":{"type":"array","items":{"$ref":"#/definitions/article"},"minItems":1},"leadArticle":{"description":"Index of the main article. This is the default article displayed with the item.","type":"integer","minimum":0},"audio":{"type":"array","items":{"$ref":"#/definitions/audioclip"},"minItems":0}},"additionalProperties":false}'),f=JSON.parse('{"$id":"https://schemas.3d.si.edu/voyager/model.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Model","description":"Describes the visual representations (models, derivatives) of a 3D item.","definitions":{"annotation":{"description":"Spatial annotation (hot spot, hot zone) on a model. Annotations can reference articles.","type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"type":"string"},"titles":{"description":"Short title with language key.","type":"object"},"lead":{"type":"string"},"leads":{"description":"Short lead text with language key.","type":"object"},"marker":{"type":"string"},"tags":{"description":"Array of tags, categorizing the annotation.","type":"array","items":{"type":"string"}},"taglist":{"description":"Array of tags, categorizing the annotation with language key.","type":"object"},"articleId":{"description":"Id of an article related to this annotation.","type":"string","minLength":1},"imageUri":{"description":"URI of an image resource for this annotation.","type":"string","minLength":1},"imageCredit":{"description":"Credit line image in this annotation with language key.","type":"object"},"imageAltText":{"description":"Alt text for image in this annotation with language key","type":"object"},"audioId":{"description":"Id of an audio resource for this annotation.","type":"string","minLength":1},"viewId":{"description":"Id of a snapshot resource with camera view information for this annotation.","type":"string","minLength":1},"style":{"type":"string"},"visible":{"description":"Flag indicating whether the annotation is visible.","type":"boolean","default":true},"expanded":{"description":"Flag indicating whether the annotation is displayed in expanded state.","type":"boolean","default":false},"scale":{"description":"Scales the annotation relative to its default size.","type":"number","default":1},"offset":{"description":"Offsets the annotation along its direction.","type":"number","default":0},"tilt":{"description":"Tilt angle of the annotation relative to the direction vector in degrees.","type":"number","default":0},"azimuth":{"description":"Azimuth angle of a tilted annotation.","type":"number","default":0},"color":{"description":"Color of the annotation","type":"array","minItems":3,"maxItems":3,"items":{"type":"number"}},"position":{"description":"Position where the annotation is anchored, in local item coordinates.","$ref":"./common.schema.json#/definitions/vector3"},"direction":{"description":"Direction of the stem of this annotation, usually corresponds to the surface normal.","$ref":"./common.schema.json#/definitions/vector3"},"zoneIndex":{"description":"Index of the zone on the zone texture.","type":"integer","minimum":0}},"required":["id"],"additionalProperties":false},"derivative":{"description":"Visual representation derived from the master model.","type":"object","properties":{"usage":{"description":"usage categories for a derivative.","type":"string","enum":["Image2D","Web3D","App3D","iOSApp3D","Print3D","Editorial3D"]},"quality":{"type":"string","enum":["Thumb","Low","Medium","High","Highest","AR"]},"assets":{"description":"List of individual resources this derivative is composed of.","type":"array","items":{"$ref":"#/definitions/asset"}}}},"asset":{"description":"an individual resource for a 3D model.","type":"object","properties":{"uri":{"type":"string","minLength":1},"type":{"type":"string","enum":["Model","Geometry","Image","Texture","Points","Volume"]},"part":{"type":"string","minLength":1},"mimeType":{"type":"string","minLength":1},"byteSize":{"type":"integer","minimum":1},"numFaces":{"type":"integer","minimum":1},"imageSize":{"type":"integer","minimum":1},"mapType":{"type":"string","enum":["Color","Normal","Occlusion","Emissive","MetallicRoughness","Zone"]}},"required":["uri","type"]},"material":{"description":"Surface properties for this model, shared by all derivatives.","type":"object","properties":{}}},"type":"object","properties":{"units":{"$ref":"./common.schema.json#/definitions/units"},"tags":{"type":"string"},"visible":{"type":"boolean"},"renderOrder":{"type":"number"},"overlayMap":{"type":"number"},"shadowSide":{"type":"string","enum":["Front","Back","Double"]},"derivatives":{"type":"array","items":{"$ref":"#/definitions/derivative"}},"translation":{"description":"Translation vector. Must be applied to bring model into its \'neutral\' pose.","$ref":"./common.schema.json#/definitions/vector3"},"rotation":{"description":"Rotation quaternion. Must be applied to bring model into its \'neutral\' pose.","$ref":"./common.schema.json#/definitions/vector4"},"boundingBox":{"description":"Bounding box for this model, shared by all derivatives.","$ref":"./common.schema.json#/definitions/boundingBox"},"material":{"$ref":"#/definitions/material"},"annotations":{"description":"List of annotations to be displayed with the model","type":"array","items":{"$ref":"#/definitions/annotation"}}},"required":["units","derivatives"],"additionalProperties":false}'),g=JSON.parse('{"$id":"https://schemas.3d.si.edu/voyager/setup.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Setup","description":"Tours and settings for explorer documents (background, interface, etc.)","definitions":{"viewer":{"type":"object","properties":{"shader":{"type":"string"},"exposure":{"type":"number"},"toneMapping":{"type":"boolean"},"gamma":{"type":"number"},"annotationsVisible":{"type":"boolean"},"isWallMountAR":{"type":"boolean"},"arScale":{"type":"number"},"activeTags":{"type":"string"},"sortedTags":{"type":"string"},"radioTags":{"type":"boolean"}},"required":["shader","exposure","gamma"]},"reader":{"type":"object","properties":{"enabled":{"type":"boolean"},"position":{"type":"string"},"articleId":{"description":"Id of the article currently displayed in the reader.","type":"string","minLength":1}}},"interface":{"type":"object","properties":{"visible":{"type":"boolean"},"logo":{"type":"boolean"},"menu":{"type":"boolean"},"tools":{"type":"boolean"}}},"navigation":{"type":"object","properties":{"type":{"type":"string","enum":["Orbit","Walk"]},"enabled":{"type":"boolean"},"autoZoom":{"type":"boolean"},"autoRotation":{"type":"boolean"},"lightsFollowCamera":{"type":"boolean"},"orbit":{"$comment":"TODO: Implement","type":"object","properties":{}},"walk":{"$comment":"TODO: Implement","type":"object","properties":{}}}},"background":{"type":"object","properties":{"style":{"type":"string","enum":["Solid","LinearGradient","RadialGradient"]},"color0":{"$ref":"./common.schema.json#/definitions/vector3"},"color1":{"$ref":"./common.schema.json#/definitions/vector3"}}},"floor":{"type":"object","properties":{"visible":{"type":"boolean"},"position":{"$ref":"./common.schema.json#/definitions/vector3"},"size":{"type":"number"},"color":{"$ref":"./common.schema.json#/definitions/vector3"},"opacity":{"type":"number"},"receiveShadow":{"type":"boolean"},"autoSize":{"type":"boolean"}}},"grid":{"type":"object","properties":{"visible":{"type":"boolean"},"color":{"$ref":"./common.schema.json#/definitions/vector3"}}},"tape":{"type":"object","properties":{"enabled":{"type":"boolean"},"startPosition":{"$ref":"./common.schema.json#/definitions/vector3"},"startDirection":{"$ref":"./common.schema.json#/definitions/vector3"},"endPosition":{"$ref":"./common.schema.json#/definitions/vector3"},"endDirection":{"$ref":"./common.schema.json#/definitions/vector3"}}},"slicer":{"type":"object","properties":{"enabled":{"type":"boolean"},"axis":{"type":"string","enum":["X","Y","Z"]},"inverted":{"type":"boolean"},"position":{"type":"number"},"color":{"$ref":"./common.schema.json#/definitions/vector3"}}},"audio":{"type":"object","properties":{"narrationId":{"type":"string"}}},"language":{"type":"object","properties":{"language":{"type":"string","enum":["EN","ES","DE","NL","JA","FR","HAW"]}}},"tours":{"description":"Animated tours.","type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"titles":{"description":"Short title with language key.","type":"object"},"lead":{"type":"string"},"leads":{"description":"Short lead text with language key.","type":"object"},"tags":{"description":"Array of tags, categorizing the tour.","type":"array","items":{"type":"string"}},"taglist":{"description":"Array of tags, categorizing the annotation with language key.","type":"object"},"steps":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"titles":{"description":"Short title with language key.","type":"object"},"id":{"type":"string"}}}}}}},"snapshots":{"description":"Snapshots are animatable scene states.","type":"object","properties":{"features":{"type":"array","items":{"type":"string"}},"targets":{"type":"array","items":{"type":"string"}},"states":{"type":"array","items":{"type":"object"}}}}},"type":"object","properties":{"units":{"$ref":"./common.schema.json#/definitions/units"},"interface":{"$ref":"#/definitions/interface"},"viewer":{"$ref":"#/definitions/viewer"},"reader":{"$ref":"#/definitions/reader"},"navigation":{"$ref":"#/definitions/navigation"},"background":{"$ref":"#/definitions/background"},"floor":{"$ref":"#/definitions/floor"},"grid":{"$ref":"#/definitions/grid"},"tape":{"$ref":"#/definitions/tape"},"slicer":{"$ref":"#/definitions/slicer"},"tours":{"$ref":"#/definitions/tours"},"language":{"$ref":"#/definitions/language"},"audio":{"$ref":"#/definitions/audio"}}}');var v=n(75222),y=n(82567),b=n(84678),_=n(79815),x=n(63872),w=n(11359),S=n(1594);class M extends c{constructor(e,t){super(e,t),this.titles={},this.intros={},this.meta=null,this.ins=this.addInputs(M.ins),this.outs=this.addOutputs(M.outs),this.innerGraph.createCustomNode(y.Z),this.ins.active.setValue(!1),this.ins.visible.setValue(!1)}get root(){return this.innerNodes.get(y.Z)}get setup(){return this.innerComponents.get(_.Z)}get assetPath(){return this.outs.assetPath.value}get assetBaseName(){let e=this.assetPath;const t=e.indexOf(".svx.json");return t>=0&&(e=e.substr(0,t)),e}get analytics(){return this.getMainComponent(w.Z)}create(){super.create(),this.innerGraph.components.on(b.Z,this.onMetaComponent,this),this.setup.language.outs.language.on("value",this.onLanguageUpdate,this)}dispose(){this.setup.language.outs.language.off("value",this.onLanguageUpdate,this),this.innerGraph.components.off(b.Z,this.onMetaComponent,this),super.dispose()}update(e){super.update(e);const{ins:t,outs:n}=this;if(t.dumpJson.changed){const e=this.deflateDocument();console.log("-------------------- VOYAGER DOCUMENT --------------------"),console.log(JSON.stringify(e,((e,t)=>"number"==typeof t?parseFloat(t.toFixed(5)):t),2))}if(t.dumpTree.changed&&(console.log("-------------------- VOYAGER DOCUMENT --------------------"),this.dump()),t.download.changed){const e=n.assetPath.value.split("/").pop()||"voyager-document.json";i.Z.json(this.deflateDocument(),e)}if(t.title.changed&&this.titles){const e=this.setup.language;t.title.setValue(t.title.value,!0),n.title.setValue(t.title.value),t.title.value&&(this.titles[S.PD[e.outs.language.value]]=t.title.value,this.updateMeta())}if(t.intro.changed&&this.intros){const e=this.setup.language;n.intro.setValue(t.intro.value),this.intros[S.PD[e.outs.language.value]]=t.intro.value,this.updateMeta()}return!0}clearNodeTree(){this.root.transform.children.slice().forEach((e=>e.node.dispose()))}openDocument(e,t,n){if(!M.validator.validate(e))throw new Error("document schema validation failed");n||(this.clearNodeTree(),this.ins.title.setValue(null)),this.onMetaComponent({type:"CVMeta",object:this.root.meta,add:!0,remove:!1});let i="object"==typeof n?n:this.root;if(i.graph!==this.innerGraph)throw new Error("invalid parent node");const s=new Map;if(i instanceof y.Z)i.fromDocument(e,e.scene,s);else{e.scenes[e.scene].nodes.forEach((t=>{const n=this.innerGraph.createCustomNode(v.Z);i.transform.addChild(n.transform),n.fromDocument(e,t,s)}))}t&&(this.outs.assetPath.setValue(t),this.name=this.getMainComponent(x.Z).getAssetName(t))}appendModel(e,t,n){if(n&&n.graph!==this.innerGraph)throw new Error("invalid parent node");if(this.isEmpty())throw new Error("empty document, can't append model");n=n||this.root;const i=this.innerGraph.createCustomNode(v.Z);n.transform.addChild(i.transform),i.createModel();const s=i.model;return s.derivatives.createModelAsset(e,t),s}appendGeometry(e,t,n,i,s,r){if(r&&r.graph!==this.innerGraph)throw new Error("invalid parent node");if(this.isEmpty())throw new Error("empty document, can't append geometry");r=r||this.root;const o=this.innerGraph.createCustomNode(v.Z);r.transform.addChild(o.transform),o.createModel();o.model.derivatives.createMeshAsset(e,t,n,i,s)}deflateDocument(e){if(this.isEmpty())throw new Error("empty document, can't serialize");const t={asset:{type:M.mimeType,version:M.version,generator:"Voyager",copyright:"(c) Smithsonian Institution. All rights reserved."},scene:0,scenes:[]},n=new Map;return t.scene=this.root.toDocument(t,n,e),t}onMetaComponent(e){const t=e.object,n=this.ins.title,i=this.ins.intro,s=this.setup.language;null===this.meta&&(this.meta=t),e.add&&!n.value&&t.once("load",(()=>{this.titles=t.collection.get("titles")||{},this.intros=t.collection.get("intros")||{},0===Object.keys(this.titles).length&&(this.titles[S.PD[s.outs.language.value]]=t.collection.get("title")||"",t.collection.dictionary.titles=this.titles);const e=this.titles[S.PD[s.outs.language.value]];n.setValue(e);const r=this.intros[S.PD[s.outs.language.value]]||"";i.setValue(r),this.analytics.setTitle(e),this.meta=t}))}onLanguageUpdate(){const e=this.setup.language,t=this.titles[S.PD[e.outs.language.value]];this.ins.title.setValue(t);const n=this.intros[S.PD[e.outs.language.value]]||"";this.ins.intro.setValue(n)}updateMeta(){const e=this.meta;e&&(e.collection.dictionary.titles=this.titles,e.collection.dictionary.intros=this.intros)}}M.typeName="CVDocument",M.mimeType="application/si-dpo-3d.document+json",M.version="1.0",M.validator=new class{constructor(){this._schemaValidator=new(d())({schemas:[u,p,m,f,g],allErrors:!0}),this._validateDocument=this._schemaValidator.getSchema("https://schemas.3d.si.edu/voyager/document.schema.json")}validate(e){return!!this._validateDocument(e)||(console.warn(this._schemaValidator.errorsText(this._validateDocument.errors,{separator:", ",dataVar:"document"})),!1)}},M.ins={dumpJson:s.V5.Event("Document.DumpJSON"),dumpTree:s.V5.Event("Document.DumpTree"),download:s.V5.Event("Document.Download"),title:s.V5.String("Document.Title"),intro:s.V5.String("Document.Intro","")},M.outs={assetPath:s.V5.AssetPath("Asset.Path",{preset:"scene.svx.json"}),title:s.V5.String("Document.Title"),intro:s.V5.String("Document.Intro","")}},25864:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(80038),s=n(63833),r=n(48377);class o extends s.Z{constructor(e,t){super(e,t),this.outs=this.addOutputs(o.outs),this.scope=s.$.Node}createDocument(e,t){const n=this.node.createComponent(r.Z);return this.activeComponent=n,e&&n.openDocument(e,t),n}amendDocument(e,t,n){const i=this.activeComponent;if(!i)throw new Error("no active document, can't amend");return i.openDocument(e,t,n),i}refreshDocument(){this.emit({type:"active-component",previous:null,next:this.activeComponent})}appendModel(e,t){const n=this.activeComponent;if(!n)throw new Error("no active document, can't append model");return n.appendModel(e,t),n}appendGeometry(e,t,n,i,s){const r=this.activeComponent;if(!r)throw new Error("no active document, can't append geometry");return r.appendGeometry(e,t,n,i,s),r}removeActiveDocument(){const e=this.activeComponent;e&&e.dispose()}activateComponent(e){e.ins.visible.setValue(!0),e.ins.active.setValue(!0)}deactivateComponent(e){e.ins.visible.setValue(!1),e.ins.active.setValue(!1)}onActiveComponent(e,t){this.outs.activeDocument.setValue(t)}onScopedComponents(){this.outs.changedDocuments.set()}}o.typeName="CVDocumentProvider",o.componentType=r.Z,o.outs={activeDocument:i.V5.Object("Documents.Active",r.Z),changedDocuments:i.V5.Event("Documents.Changed")}},24856:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(75544),s=n(80038),r=n(68327),o=n(26629),a=n(36283);const l=["Footprint_Court_1k_TMap.jpg","spruit_sunrise_1k_LDR.jpg","campbell_env.jpg"];class c extends s.ZP{constructor(){super(...arguments),this.ins=this.addInputs(c.envIns),this._texture=null,this._currentIdx=0,this.shouldUseEnvMap=!1}get assetReader(){return this.getMainComponent(r.Z)}get sceneNode(){return this.getSystemComponent(a.Z)}update(){const e=this.ins,t=this.getGraphComponent(o.Z);return e.dirty.changed&&(this.shouldUseEnvMap=!1,t.models.forEach((t=>{t.object3D.traverse((t=>{const n=t.material;n&&n.isUberPBRMaterial&&(n.roughnessMap||n.metalnessMap)&&(this.shouldUseEnvMap=!0,null!==this._texture&&(this._texture.dispose(),this._texture=null),e.imageIndex.set())}))}))),e.imageIndex.changed&&this.shouldUseEnvMap&&(e.imageIndex.value==this._currentIdx&&null!==this._texture||(null!==this._texture&&this._texture.dispose(),this.assetReader.getSystemTexture("images/"+l[e.imageIndex.value]).then((e=>{this._texture=e,this._texture.mapping=i.dSO,this.sceneNode.scene.environment=this._texture})),this._currentIdx=e.imageIndex.value)),!0}fromData(e){this.ins.copyValues({imageIndex:e.index})}toData(){return{index:this.ins.imageIndex.cloneValue()}}}c.typeName="CVEnvironment",c.text="Environment",c.envIns={imageIndex:s.V5.Integer("Environment.Index",{preset:0,options:l.map((function(e,t){return t.toString()}))}),dirty:s.V5.Event("Environment.Dirty")}},97322:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var i=n(2837),s=n(8035),r=n(83866),o=n(71050),a=n(41654),l=n(8173),c=n(17393);const h=n(93523).Z,d=n(62001).Z;class u extends s.K{constructor(){super(new r._(2,2,1,1),new p),this.geometry.rotateX(-90*o.M8.DEG2RAD),this.receiveShadow=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class p extends a.x{constructor(e){super(e),this.defines={},this.type="FloorMaterial",this.isMeshPhongMaterial=!0,this.isFloorMaterial=!0,this.defines={},this.uniforms=l.rD.merge([c.V.phong.uniforms]),this.vertexShader=d,this.fragmentShader=h,this.transparent=!0,this.shininess=0}}class m extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(m.floorIns),this.object3D=new u}get floor(){return this.object3D}update(e){super.update(e);const t=this.ins,n=this.floor;return(t.position.changed||t.radius.changed)&&(n.position.fromArray(t.position.value),n.scale.setScalar(t.radius.value),n.updateMatrix()),t.color.changed&&n.material.color.fromArray(t.color.value),t.opacity.changed&&(n.material.opacity=t.opacity.value),!0}dispose(){this.floor.dispose(),super.dispose()}}m.typeName="CFloor",m.floorIns={position:i.V5.Vector3("Floor.Position",[0,-25,0]),radius:i.V5.Number("Floor.Radius",50),color:i.V5.ColorRGB("Floor.Color",[.6,.75,.8]),opacity:i.V5.Percent("Floor.Opacity",.5),castShadow:i.V5.Boolean("Shadow.Cast"),receiveShadow:i.V5.Boolean("Shadow.Receive")};var f=n(80038),g=n(26629);const v=new(n(19588).P);class y extends m{constructor(e,t){super(e,t),this.addIns=this.addInputs(y.floorAddIns),this.ins.visible.setValue(!1),this.ins.receiveShadow.setValue(!0),this.floor.renderOrder=-1}get settingProperties(){return[this.ins.visible,this.ins.position,this.ins.radius,this.ins.color,this.ins.opacity,this.ins.receiveShadow,this.addIns.autoSize]}get snapshotProperties(){return[this.ins.opacity]}get sceneNode(){return this.getSystemComponent(g.Z)}create(){super.create(),this.sceneNode.outs.boundingBox.on("value",this.recalculateSize,this)}dispose(){this.sceneNode.outs.boundingBox.off("value",this.recalculateSize,this),super.dispose()}update(e){const t=this.addIns;return t.autoSize.changed&&t.autoSize.value&&this.recalculateSize(),super.update(e),!0}recalculateSize(){const{addIns:e}=this;if(e.autoSize.value){const e=this.sceneNode.outs.boundingBox.value;e.getSize(v);const t=Math.max(v.x,v.y,v.z),{min:n,max:i}=e;this.ins.radius.setValue(t),this.ins.position.setValue([(n.x+i.x)/2,n.y,(n.z+i.z)/2])}}fromData(e){e=e||{},this.ins.copyValues({visible:!!e.visible,position:e.position||[0,-25,0],radius:void 0!==e.size?e.size:50,color:e.color||[.6,.75,.8],opacity:void 0!==e.opacity?e.opacity:.5,receiveShadow:!!e.receiveShadow,autoSize:void 0===e.autoSize||e.autoSize})}toData(){const e=this.ins;return{visible:e.visible.value,position:e.position.cloneValue(),size:e.radius.value,color:e.color.cloneValue(),opacity:e.opacity.value,receiveShadow:e.receiveShadow.value,autoSize:this.addIns.autoSize.value}}}y.typeName="CVFloor",y.text="Floor",y.icon="",y.floorAddIns={autoSize:f.V5.Boolean("Floor.AutoSize",!0)}},6461:(e,t,n)=>{"use strict";n.d(t,{Z:()=>x});var i=n(19588),s=n(82587),r=n(93113),o=n(37840),a=n(28092),l=n(64026),c=n(75809),h=n(35322);class d extends a.e{constructor(e){super(d.generate(e),new l.n({color:4294967295,vertexColors:!0}))}set opacity(e){this.material.opacity=e,this.material.transparent=e<1}update(e){this.geometry&&this.geometry.dispose(),this.geometry=d.generate(e)}static generate(e){const t=new r.I(e.mainColor),n=new r.I(e.subColor),i=e.mainDivisions*e.subDivisions,s=e.size/i,o=.5*e.size,a=[],l=[];for(let r=0,c=0,h=-o;r<=i;++r,h+=s){a.push(-o,0,h,o,0,h),a.push(h,0,-o,h,0,o);const i=r%e.subDivisions==0?t:n;i.toArray(l,c),c+=3,i.toArray(l,c),c+=3,i.toArray(l,c),c+=3,i.toArray(l,c),c+=3}const d=new c.u;return d.setAttribute("position",new h.a$(a,3)),d.setAttribute("color",new h.a$(l,3)),d}}var u=n(80038),p=n(2837),m=n(1594),f=n(26629),g=n(29767);const v=new i.P,y=new i.P,b=(new s.y).makeRotationX(.5*Math.PI),_=new s.y;class x extends p.ZP{constructor(){super(...arguments),this.tape=null,this.ins=this.addInputs(x.gridIns),this.outs=this.addOutputs(x.gridOuts),this._lastViewport=null,this._gridProps={size:20,mainDivisions:2,subDivisions:10,mainColor:new r.I(.5,.7,.8),subColor:new r.I(.25,.35,.4)}}get settingProperties(){return[this.ins.visible,this.ins.color,this.ins.opacity]}get snapshotProperties(){return[this.ins.opacity]}get grid(){return this.object3D}create(){this.ins.pickable.setValue(!1),this.ins.visible.setValue(!1),this.tape=this.node.createComponent(g.Z),this.tape.ins.startPosition.setValue([0,0,0]),this.tape.ins.endPosition.setValue([0,0,0]),this.tape.ins.visible.setValue(!1),this.tape.addTag("no_settings"),super.create()}activate(){this.getGraphComponent(f.Z).outs.boundingBox.linkTo(this.ins.boundingBox)}update(){const e=this.ins;if(e.color.changed||e.boundingBox.changed){const t=this._gridProps;if(e.color.changed){const n=t.mainColor,i=t.subColor;n.fromArray(e.color.value),i.r=.5*n.r,i.g=.5*n.g,i.b=.5*n.b}if(e.boundingBox.changed){const e=this.getGraphComponent(f.Z),n=e.outs.boundingBox.value,i=e.ins.units.value;n.getSize(v);let s=Math.max(v.x,v.y,v.z),r=1;for(;s/r>5;)r*=10;s=Math.ceil(s/r)*r*2,t.size=s,this.outs.size.setValue(s),this.outs.units.setValue(i),t.mainDivisions=s/r,t.subDivisions=10,y.set(0,n.min.y,0),this.tape.ins.startPosition.setValue([-s/2,n.min.y+s/100,-s/2-s/100]),this.tape.ins.endPosition.setValue([-s/2+s/t.mainDivisions,n.min.y+s/100,-s/2-s/100])}this.object3D?this.grid.update(t):this.object3D=new d(t),e.boundingBox.changed&&(this.grid.position.copy(y),this.grid.updateMatrix())}return e.visible.changed&&(this.grid.visible=e.visible.value,this.tape.ins.visible.setValue(this.grid.visible&&e.labelEnabled.value)),e.opacity.changed&&(this.grid.opacity=e.opacity.value),e.labelEnabled.changed&&this.tape.ins.visible.setValue(this.grid.visible&&e.labelEnabled.value),!0}preRender(e){const t=e.viewport,n=this.object3D;if(t!==this._lastViewport){this._lastViewport=t;const i=e.viewport.camera;i?n.matrix.extractRotation(i.matrixWorld).multiply(b):n.matrix.extractRotation(_),n.updateMatrixWorld(!0)}}postRender(e){this.object3D.updateMatrix()}fromData(e){e=e||{},this.ins.copyValues({visible:!!e.visible,color:e.color||[.5,.7,.8]})}toData(){const e=this.ins;return{visible:e.visible.cloneValue(),color:e.color.cloneValue()}}}x.typeName="CVGrid",x.text="Grid",x.icon="",x.gridIns={color:u.V5.ColorRGB("Grid.Color",[.5,.7,.8]),opacity:u.V5.Percent("Grid.Opacity",1),boundingBox:u.V5.Object("Scene.BoundingBox",o.Z),labelEnabled:u.V5.Boolean("Grid.LabelEnabled",!0)},x.gridOuts={size:u.V5.Number("Size"),units:u.V5.Enum("Units",m.f_)}},40490:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r,p:()=>i});var i,s=n(80038);!function(e){e[e.none=0]="none",e[e.menu=1]="menu",e[e.title=2]="title",e[e.logo=4]="logo",e[e.language=8]="language",e[e.tour_exit=16]="tour_exit",e[e.help=32]="help"}(i||(i={}));class r extends s.ZP{constructor(){super(...arguments),this.ins=this.addInputs(r.ins),this.outs=this.addOutputs(r.outs)}update(e){return!0}fromData(e){e=e||{},this.ins.setValues({visible:void 0===e.visible||e.visible,logo:void 0===e.logo||e.logo,menu:void 0===e.menu||e.menu,tools:void 0===e.tools||e.tools})}toData(){const e=this.ins;return{visible:e.visible.value,logo:e.logo.value,menu:e.menu.value,tools:e.tools.value}}isShowing(e){return(e&this.ins.visibleElements.value)===e}}r.typeName="CVInterface",r.ins={visible:s.V5.Boolean("Interface.Visible",!0),logo:s.V5.Boolean("Interface.Logo",!0),menu:s.V5.Boolean("Interface.Menu",!0),tools:s.V5.Boolean("Interface.Tools",!0),visibleElements:s.V5.Number("Interface.VisibleElements",63)},r.outs={documentTitle:s.V5.String("Document.Title")}},93072:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(80038),s=n(1594),r=n(68327),o=n(82507);class a extends i.ZP{constructor(){super(...arguments),this._activeLanguages={},this._translations={},this.ins=this.addInputs(a.ins),this.outs=this.addOutputs(a.outs),this.updateLanguage=e=>{const{ins:t,outs:n}=this;t.language.value===e&&(n.language.setValue(e),this.emit({type:"tag-update"}))}}get assetReader(){return this.getMainComponent(r.Z)}get activeLanguages(){return Object.values(this._activeLanguages)}nameString(){return s.oS[s.PD[this.ins.language.value]]}codeString(){return s.PD[this.ins.language.value]}create(){super.create()}update(){const{ins:e,outs:t}=this;if(0==this.activeLanguages.length&&e.language.value==t.language.value&&this.addLanguage(t.language.value),e.language.changed&&e.language.value!=t.language.value){const t=e.language.value;this.addLanguage(t),this.assetReader.getSystemJSON("language/string.resources."+s.PD[this.ins.language.value].toLowerCase()+".json").then((e=>{this._translations=e,this.updateLanguage(t)}))}return!0}fromData(e){var t;const{ins:n,outs:i}=this;e=e||{};const r=null!==(t=s.PD[e.language||"EN"])&&void 0!==t?t:s.PD[s.k$];n.language.value<0&&n.language.setValue(r)}toData(){const e=this.ins;return{language:s.PD[e.language.getValidatedValue()]}}addLanguage(e){var t,n,i;null!==(t=(n=this._activeLanguages)[i=s.PD[e]])&&void 0!==t||(n[i]={id:e,name:s.oS[s.PD[e]]})}getLocalizedString(e){const t=this._translations;return void 0===t?e:t[e]||e}}a.typeName="CVLanguageManager",a.text="Language",a.icon="",a.isSystemSingleton=!0,a.ins={enabled:i.V5.Boolean("Language.Enabled",!1),language:i.V5.Enum("Interface.Language",s.PD,{preset:s.PD[s.k$],enum:s.PD,options:(0,o.q)(s.oS).map((e=>s.oS[e]))})},a.outs={language:i.V5.Enum("Interface.Language",s.PD,s.PD.EN)}},84678:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var i=n(82942);class s extends i.Z{constructor(e){super(),this.addEvent("update"),this._list=e||[],this._dict={},e&&e.forEach((e=>{e.id&&(this._dict[e.id]=e)}))}get length(){return this._list.length}get ids(){return Object.keys(this._dict)}get items(){return this._list}set items(e){this._list=e,this._dict={},e.forEach((e=>{e.id&&(this._dict[e.id]=e)})),this.emit({type:"update",item:null,what:"update"})}append(e){this._list.push(e),e.id&&(this._dict[e.id]=e),this.emit({type:"update",item:e,what:"add"})}insertBefore(e,t){const n=this._list.indexOf(t);n>=0&&this.insertAt(e,n)}insertAt(e,t){this._list.splice(t,0,e),e.id&&(this._dict[e.id]=e),this.emit({type:"update",item:e,what:"add"})}replaceItem(e,t){const n=this._list.indexOf(t);n>=0&&this.replaceAt(e,n)}replaceAt(e,t){const n=this._list[t];n.id&&delete this._dict[n.id],this._list[t]=e,e.id&&(this._dict[e.id]=e),this.emit({type:"update",item:e,what:"replace"})}moveItem(e,t){const n=this._list.indexOf(e);this.moveAt(n,t)}moveAt(e,t){const n=this._list;if(e+t<0||e+t>=n.length)return;const i=n[e];if(t>0){for(let i=0;it;--i)n[e+i]=n[e+i-1];n[e+t]=i}this.emit({type:"update",item:i,what:"move"})}removeById(e){const t=this._dict[e];return t&&this.removeItem(t),t}removeItem(e){const t=this._list.indexOf(e);return this.removeAt(t),t}removeAt(e){const t=this._list;if(e<0||e>=t.length)return;const n=t[e];return t.splice(e,1),n.id&&delete this._dict[n.id],this.emit({type:"update",item:n,what:"remove"}),n}getAt(e){return this._list[e]}getById(e){return this._dict[e]}getIndexOf(e){return this._list.indexOf(e)}copy(e){this.items=e.slice()}clone(){return this._list.slice()}}s.prototype[Symbol.iterator]=function(){return{index:0,list:this._list,next:function(){return this.index{e.id&&(this._dict[e.id]=e)}))}get length(){return this.ids.length}get items(){return this.ids.map((e=>this._dict[e]))}set items(e){e.forEach((e=>{e.id&&(this._dict[e.id]=e)})),this.emit({type:"update",item:null,what:"update"})}get ids(){return Object.keys(this._dict)}get dictionary(){return this._dict}set dictionary(e){this._dict=e,this.emit({type:"update",item:null,what:"update"})}insert(e,t){if(!(t=t||e.id))throw new Error("can't insert, missing id");this._dict[t]=e,this.emit({type:"update",item:e,what:"insert"})}remove(e){const t="string"==typeof e?e:e.id,n=this._dict[t];void 0!==n&&(delete this._dict[t],this.emit({type:"update",item:n,what:"remove"}))}get(e){return this._dict[e]}getOrCreate(e,t){let n=this._dict[e];return n||(n=this._dict[e]=t,this.emit({type:"update",item:n,what:"insert"})),n}copy(e){this.dictionary=Object.assign({},e)}clone(){return Object.assign({},this._dict)}}var o=n(80038),a=n(38112),l=n(1594),c=n(93072);class h extends o.ZP{constructor(){super(...arguments),this.collection=new r,this.process=new r,this.images=new r,this.articles=new s,this.leadArticle=null,this.notes=[],this.audio=new r}get language(){return this.getGraphComponent(c.Z,!0)}fromDocument(e,t){if(!isFinite(t.meta))throw new Error("info property missing in node");const n=e.metas[t.meta];if(n.collection&&(this.collection.dictionary=n.collection,this.collection.get("titles")&&Object.keys(this.collection.get("titles")).forEach((e=>{this.language.addLanguage(l.PD[e])}))),n.process&&(this.process.dictionary=n.process),n.images){const e={};n.images.forEach((t=>e[t.quality]=t)),this.images.dictionary=e}if(n.articles&&(this.articles.items=n.articles.map((e=>a.Z.fromJSON(e))),void 0!==n.leadArticle&&(this.leadArticle=this.articles.getAt(n.leadArticle)),this.articles.items.forEach((e=>{Object.keys(e.data.titles).forEach((e=>{this.language.addLanguage(l.PD[e])}))}))),n.audio){const e={};n.audio.forEach((t=>{t.captionUris=t.captionUris||{},t.durations={},e[t.id]=t})),this.audio.dictionary=e}return this.emit("load"),t.meta}toDocument(e,t){let n=null;if(this.collection.length>0&&(n={collection:this.collection.dictionary}),this.process.length>0&&(n=n||{},n.process=this.process.dictionary),this.images.length>0&&(n=n||{},n.images=this.images.items),this.articles.length>0){n=n||{};const e=this.articles.items;n.articles=e.map((e=>e.toJSON())),this.leadArticle&&(n.leadArticle=e.indexOf(this.leadArticle))}if(this.audio.length>0&&(n=n||{},n.audio=this.audio.items,n.audio.forEach((e=>{e.durations={}}))),n){e.metas=e.metas||[];const t=e.metas.length;return e.metas.push(n),t}}}h.typeName="CVMeta",h.text="Meta",h.icon="document"},3388:(e,t,n)=>{"use strict";n.d(t,{Z:()=>V});var i=n(19588),s=n(78943),r=n(37840),o=n(82587),a=n(29187),l=n(75544),c=n(28092),h=n(64026),d=n(35322),u=n(75809);class p extends c.e{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new u.u;i.setIndex(new d.Tl(n,1)),i.setAttribute("position",new d.a$([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new h.n({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}var m=n(10564),f=n(80038),g=n(2837),v=n(79961),y=n(43875),b=n(15577),_=n(10290),x=n(37117),w=n(38642);const S=[],M=[x.$l.Thumb,x.$l.AR,x.$l.Low,x.$l.Medium,x.$l.High,x.$l.Highest];class E{constructor(){this.derivatives={}}select(e,t){const n=x._U[e],i=x.$l[t],s=M.indexOf(t);if(s<0)return console.warn(`derivative quality not supported: '${i}'`),null;const r=this.get(e,t);if(r)return r;for(let t=s+1;t=0;--t){const n=this.get(e,M[t]);if(n)return console.warn(`derivative quality '${i}' not available, using lower quality`),n}return console.warn(`no suitable derivative found for quality '${i}' and usage '${n}'`),null}getByUsage(e){const t=x._U[e];return(this.derivatives[t]||S).sort(((e,t)=>e.data.qualityt.data.quality?1:0))}getByQuality(e){return this.getArray().filter((t=>t.data.quality===e))}getArray(){return Object.keys(this.derivatives).reduce(((e,t)=>e.concat(this.derivatives[t])),[])}get(e,t){const n=x._U[e],i=this.derivatives[n];if(i)for(let e=0,n=i.length;e-1&&t.splice(i,1)}}createModelAsset(e,t){t="string"==typeof t?x.$l[t]:t,t=isFinite(t)?t:x.$l.Medium;const n=this.getOrCreate(x._U.Web3D,t),i=new w.ZP;return i.setModel(e),n.addAsset(i),n}createMeshAsset(e,t,n,i,s){s="string"==typeof s?x.$l[s]:s,s=isFinite(s)?s:x.$l.Medium;const r=this.getOrCreate(x._U.Web3D,s),o=new w.ZP;if(o.setGeometry(e),r.addAsset(o),t){const e=new w.ZP;e.setTexture(t,w.xd.Color),r.addAsset(e)}if(n){const e=new w.ZP;e.setTexture(n,w.xd.Occlusion),r.addAsset(e)}if(i){const e=new w.ZP;e.setTexture(i,w.xd.Normal),r.addAsset(e)}return r}clear(){for(let e in this.derivatives)this.derivatives[e].forEach((e=>e.dispose()));this.derivatives={}}toJSON(){const e=[];for(let t in this.derivatives)this.derivatives[t].forEach((t=>e.push(t.toJSON())));return e}fromJSON(e){this.clear(),e.forEach((e=>{this.getOrCreateBin(x._U[e.usage]).push(new x.ZP(e))}))}toString(e=!1){const t=this.derivatives,n=Object.keys(t);return e?`Derivatives (${n.length}) \n `+n.map((e=>t[e].map((e=>e.toString(!0))).join("\n "))).join("\n "):`Derivatives (${n.length}) `+n.map((e=>`${e} (${t[e].length})`)).join(", ")}getOrCreateBin(e){const t=x._U[e];return this.derivatives[t]||(this.derivatives[t]=[])}}var T=n(51462),C=n(63872),A=n(68327),P=n(15271),R=n(24856),L=n(79815);const N=new i.P,D=new i.P,I=new s._,O=new s._,U=new r.Z,k=new o.y;class V extends g.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(V.ins),this.outs=this.addOutputs(V.outs),this._derivatives=new E,this._activeDerivative=null,this._visible=!0,this._boxFrame=null,this._localBoundingBox=new r.Z,this._prevPosition=new i.P(0,0,0),this._prevRotation=new i.P(0,0,0),this._materialCache={},this.object3D=new a.Z}get settingProperties(){return[this.ins.name,this.ins.visible,this.ins.quality,this.ins.localUnits,this.ins.tags,this.ins.renderOrder,this.ins.shadowSide,this.ins.shader,this.ins.overlayMap,this.ins.slicerEnabled,this.ins.override,this.ins.color,this.ins.opacity,this.ins.hiddenOpacity,this.ins.roughness,this.ins.metalness,this.ins.occlusion,this.ins.doubleSided]}get snapshotProperties(){return[this.ins.visible,this.ins.quality,this.ins.overlayMap,this.ins.override,this.ins.opacity,this.ins.roughness,this.ins.metalness,this.ins.color,this.ins.slicerEnabled]}get derivatives(){return this._derivatives}get activeDerivative(){return this._activeDerivative}get localBoundingBox(){return this._localBoundingBox}get assetManager(){return this.getMainComponent(C.Z)}get assetReader(){return this.getMainComponent(A.Z)}get renderer(){return this.getMainComponent(P.Z)}create(){super.create();this.node.createComponent(T.Z).ins.unitScale.linkFrom(this.outs.unitScale);const e=this.renderer.outs.maxTextureSize.value;e<2048?this.ins.quality.setValue(y.$l.Low):e<4096?this.ins.quality.setValue(y.$l.Medium):this.ins.quality.setValue(y.$l.High)}update(){const e=this.ins;if(e.name.changed&&(this.node.name=e.name.value),e.tags.changed||e.activeTags.changed||e.visible.changed){let t=e.visible.value;if(t){const n=e.tags.value.split(",").map((e=>e.trim())).filter((e=>e)),i=e.activeTags.value.split(",").map((e=>e.trim())).filter((e=>e));t=!n.length,i.forEach((e=>{n.indexOf(e)>=0&&(t=!0)}))}const n=this.ins.override.value;this._visible=t,t?(this.object3D.visible=!0,n&&this.updateMaterial()):e.visible.value&&n&&this.ins.hiddenOpacity.value>0?(this.object3D.visible=!0,this.updateMaterial()):this.object3D.visible=!1}if(e.tags.changed&&this.emit({type:"tag-update"}),!this.activeDerivative&&e.autoLoad.changed&&e.autoLoad.value)this.autoLoad(e.quality.value);else if(e.quality.changed){const t=this.derivatives.select(y._U.Web3D,e.quality.value);t&&t!==this.activeDerivative&&this.loadDerivative(t).catch((e=>{console.warn("Model.update - failed to load derivative"),console.warn(e)}))}return e.renderOrder.changed&&this.updateRenderOrder(this.object3D,e.renderOrder.value),(e.localUnits.changed||e.globalUnits.changed)&&this.updateUnitScale(),e.shader.changed&&this.updateShader(),e.overlayMap.changed&&this.updateOverlayMap(),e.shadowSide.changed&&this.updateShadowSide(),e.override.value&&e.shader.value===_.p.Default&&(e.override.changed||e.color.changed||e.opacity.changed||e.doubleSided.changed||e.roughness.changed||e.metalness.changed||e.occlusion.changed)?this.updateMaterial():e.override.changed&&!e.override.value&&e.shader.value===_.p.Default&&this.object3D.traverse((e=>{const t=e.material;if(t&&t.isUberPBRMaterial){const e=this._materialCache[t.uuid];t.aoMapMix.setScalar(e.occlusion),t.color.fromArray(e.color),t.opacity=e.opacity,t.transparent=e.transparent,t.roughness=e.roughness,t.metalness=e.metalness,t.side=e.doubleSided?l.ehD:l.Wl3,t.needsUpdate=!0}})),e.center.changed&&this.center(),(e.position.changed||e.rotation.changed)&&this.updateMatrixFromProps(),e.dumpDerivatives.changed&&console.log(this.derivatives.toString(!0)),!0}dispose(){this.derivatives.clear(),this._activeDerivative=null,super.dispose()}center(){const e=this.object3D,t=this.ins.position;e.matrix.decompose(N,I,D),e.matrix.makeRotationFromQuaternion(I),U.makeEmpty(),v.sN(e,U,e.parent),U.getCenter(N),N.multiplyScalar(-1).toArray(t.value),t.set()}setFromMatrix(e){const t=this.ins;e.decompose(N,I,D),N.multiplyScalar(1/this.outs.unitScale.value).toArray(t.position.value),t.position.set(),v.MO(I,V.rotationOrder,t.rotation.value),t.rotation.set()}fromDocument(e,t){const{ins:n,outs:i}=this;if(!isFinite(t.model))throw new Error("model property missing in node");const s=e.models[t.model];n.name.setValue(t.name);const r=y.f_[s.units||"cm"];n.localUnits.setValue(isFinite(r)?r:y.f_.cm),n.visible.setValue(void 0===s.visible||s.visible),n.tags.setValue(s.tags||""),n.renderOrder.setValue(void 0!==s.renderOrder?s.renderOrder:0);const o=y.id[s.shadowSide||"Back"];if(n.shadowSide.setValue(isFinite(o)?o:y.id.Back),n.position.reset(),n.rotation.reset(),s.translation&&(n.position.copyValue(s.translation),this._prevPosition.fromArray(s.translation)),s.rotation&&(I.fromArray(s.rotation),v.MO(I,V.rotationOrder,n.rotation.value),this._prevRotation.fromArray(n.rotation.value),n.rotation.set()),s.boundingBox){const e=this._localBoundingBox;e.min.fromArray(s.boundingBox.min),e.max.fromArray(s.boundingBox.max),this._boxFrame=new p(e,"#009cde"),this.addObject3D(this._boxFrame),this._boxFrame.updateMatrixWorld(!0);const t=this.getGraphComponent(L.Z,!0);t&&t.navigation.ins.autoZoom.value&&t.navigation.ins.zoomExtents.set(),i.updated.set(),this.updateUnitScale()}if(s.derivatives&&this.derivatives.fromJSON(s.derivatives),s.material){const e=s.material;n.copyValues({override:!0,color:e.color||n.color.schema.preset,opacity:void 0!==e.opacity?e.opacity:n.opacity.schema.preset,hiddenOpacity:void 0!==e.hiddenOpacity?e.hiddenOpacity:n.hiddenOpacity.schema.preset,roughness:void 0!==e.roughness?e.roughness:n.roughness.schema.preset,metalness:void 0!==e.metalness?e.metalness:n.metalness.schema.preset,occlusion:void 0!==e.occlusion?e.occlusion:n.occlusion.schema.preset,doubleSided:void 0!==e.doubleSided?e.doubleSided:n.doubleSided.schema.preset})}return s.overlayMap&&n.overlayMap.setValue(s.overlayMap),s.annotations&&this.getComponent(T.Z).fromData(s.annotations),this.emit({type:"tag-update"}),this.ins.autoLoad.set(),t.model}toDocument(e,t){const n={units:y.f_[this.ins.localUnits.getValidatedValue()]},i=this.ins;i.visible.value||(n.visible=!1),i.tags.value&&(n.tags=i.tags.value),0!==i.renderOrder.value&&(n.renderOrder=i.renderOrder.value),i.shadowSide.value!=y.id.Back&&(n.shadowSide=y.id[this.ins.shadowSide.getValidatedValue()]);const s=i.position.value;0===s[0]&&0===s[1]&&0===s[2]||(n.translation=i.position.value);const r=i.rotation.value;0===r[0]&&0===r[1]&&0===r[2]||(v.jU(r,V.rotationOrder,I),n.rotation=I.toArray()),i.override.value&&(n.material={color:i.color.value,opacity:i.opacity.value,hiddenOpacity:i.hiddenOpacity.value,roughness:i.roughness.value,metalness:i.metalness.value,occlusion:i.occlusion.value,doubleSided:i.doubleSided.value}),0!==i.overlayMap.value&&(n.overlayMap=i.overlayMap.value),n.boundingBox={min:this._localBoundingBox.min.toArray(),max:this._localBoundingBox.max.toArray()},n.derivatives=this.derivatives.toJSON();const o=this.getComponent(T.Z).toData();o&&o.length>0&&(n.annotations=o),e.models=e.models||[];const a=e.models.length;return e.models.push(n),a}updateShader(){const e=this.ins.shader.getValidatedValue();this.object3D.traverse((t=>{const n=t.material;n&&n.isUberPBRMaterial&&n.setShaderMode(e)}))}updateShadowSide(){this.object3D.traverse((e=>{const t=e.material;t&&t.isUberPBRMaterial&&(this.ins.shadowSide.value==y.id.Front?t.shadowSide=l.Wl3:t.shadowSide=l._Li,t.needsUpdate=!0)}))}updateOverlayMap(){const e=this.getGraphComponent(L.Z,!0);if(e&&e.snapshots.outs.tweening.value)return void e.snapshots.outs.end.once("value",(()=>{this.ins.overlayMap.set(),this.update()}));const t=this.ins.overlayMap.getOptionText();"None"!==t?this.assetReader.getTexture(t).then((e=>{this.object3D.traverse((t=>{const n=t.material;n&&n.isUberPBRMaterial&&(e.flipY=!1,n.zoneMap=e,n.enableZoneMap(!0))}))})):this.object3D.traverse((e=>{const t=e.material;t&&t.isUberPBRMaterial&&(t.enableZoneMap(!1),t.zoneMap=null)}))}updateMaterial(){const e=this.ins;this.object3D.traverse((t=>{const n=t.material;n&&n.isUberPBRMaterial&&(n.aoMapMix.setScalar(e.occlusion.value),n.color.fromArray(e.color.value),n.opacity=this._visible?e.opacity.value:e.hiddenOpacity.value,n.transparent=n.opacity<1||this._materialCache[n.uuid].transparent,n.roughness=e.roughness.value,n.metalness=e.metalness.value,n.side=e.doubleSided.value?l.ehD:l.Wl3,n.needsUpdate=!0)}))}updateUnitScale(){const e=this.ins.localUnits.getValidatedValue(),t=this.ins.globalUnits.getValidatedValue();this.outs.unitScale.setValue((0,b.Z)(e,t)),this.updateMatrixFromProps()}updateMatrixFromProps(){const e=this.ins,t=this.outs.unitScale.value,n=this.object3D;N.fromArray(e.position.value).multiplyScalar(t),v.jU(e.rotation.value,V.rotationOrder,I),D.setScalar(t),n.matrix.compose(N,I,D),n.matrixWorldNeedsUpdate=!0,v.jU([this._prevRotation.x,this._prevRotation.y,this._prevRotation.z],V.rotationOrder,O),O.invert(),D.setScalar(1),k.compose(N.fromArray(e.position.value),I,D);const i=this.getComponent(T.Z);i.getAnnotations().forEach((e=>{N.fromArray(e.data.position),N.sub(this._prevPosition),N.applyQuaternion(O),N.applyMatrix4(k),e.data.position=N.toArray(),N.fromArray(e.data.direction),N.applyQuaternion(O),N.applyQuaternion(I),e.data.direction=N.toArray(),e.update(),i.updateAnnotation(e,!0)})),this._prevPosition.copy(N.fromArray(e.position.value)),this._prevRotation.copy(N.fromArray(e.rotation.value)),this.outs.updated.set()}updateRenderOrder(e,t){e.renderOrder=t,e.children.forEach((e=>this.updateRenderOrder(e,t)))}autoLoad(e){const t=[],n=this.derivatives.select(y._U.Web3D,y.$l.Thumb);n&&t.push(n);const i=this.derivatives.select(y._U.Web3D,e);return i&&i!==n&&t.push(i),0===t.length?(m.ZP.show(`No 3D derivatives available for '${this.displayName}'.`),Promise.resolve()):t.reduce(((e,t)=>e.then((()=>{this.loadDerivative(t)}))),Promise.resolve())}loadDerivative(e){if(this.node&&this.assetReader)return e.load(this.assetReader).then((()=>{if(!e.model||!this.node||this._activeDerivative&&e.data.quality!=this.ins.quality.value)return void e.unload();this.assetManager.initialLoad||this._activeDerivative||(this.assetManager.initialLoad=!0),this._activeDerivative&&(this.removeObject3D(this._activeDerivative.model),this._activeDerivative.unload()),this._activeDerivative=e,this.addObject3D(e.model),this.renderer.activeSceneComponent.scene.updateMatrixWorld(!0),this._boxFrame&&(this.removeObject3D(this._boxFrame),this._boxFrame.geometry.dispose(),this._boxFrame=null),this._localBoundingBox.makeEmpty(),v.sN(e.model,this._localBoundingBox),this.outs.updated.set(),this.outs.quality.setValue(e.data.quality),this.object3D.traverse((e=>{const t=e.material;t&&t.isUberPBRMaterial&&(this._materialCache[t.uuid]={color:t.color.toArray(),opacity:t.opacity,hiddenOpacity:this.ins.hiddenOpacity.schema.preset,roughness:t.roughness,metalness:t.metalness,occlusion:t.aoMapMix.x,doubleSided:t.side==l.ehD,transparent:t.transparent})})),this.ins.override.value&&this.updateMaterial(),this.ins.shadowSide.value!=y.id.Back&&this.updateShadowSide(),this.getGraphComponent(R.Z).ins.dirty.set(),0!==this.ins.renderOrder.value&&this.updateRenderOrder(this.object3D,this.ins.renderOrder.value);const t=["None"];t.push(...e.findAssets(y.hH.Image).filter((e=>e.data.mapType===y.xd.Zone)).map((e=>e.data.uri))),this.ins.overlayMap.setOptions(t),0!==this.ins.overlayMap.value&&this.ins.overlayMap.set(),this.emit({type:"model-load",quality:e.data.quality})})).catch((e=>m.ZP.show(`Failed to load model derivative: ${e.message}`)));console.warn("Model load interrupted.")}addObject3D(e){this.object3D.add(e),this.object3D.traverse((e=>{"Mesh"===e.type&&this.registerPickableObject3D(e,!0)}))}}V.typeName="CVModel2",V.text="Model",V.icon="cube",V.rotationOrder="ZYX",V.ins={name:f.V5.String("Model.Name"),globalUnits:f.V5.Enum("Model.GlobalUnits",y.f_,y.f_.cm),localUnits:f.V5.Enum("Model.LocalUnits",y.f_,y.f_.cm),quality:f.V5.Enum("Model.Quality",y.$l,y.$l.High),tags:f.V5.String("Model.Tags"),renderOrder:f.V5.Number("Model.RenderOrder",0),shadowSide:f.V5.Enum("Model.ShadowSide",y.id,y.id.Back),activeTags:f.V5.String("Model.ActiveTags"),autoLoad:f.V5.Boolean("Model.AutoLoad",!0),position:f.V5.Vector3("Model.Position"),rotation:f.V5.Vector3("Model.Rotation"),center:f.V5.Event("Model.Center"),shader:f.V5.Enum("Material.Shader",_.p,_.p.Default),overlayMap:f.V5.Option("Material.OverlayMap",["None"],0),slicerEnabled:f.V5.Boolean("Material.SlicerEnabled",!0),override:f.V5.Boolean("Material.Override",!1),color:f.V5.ColorRGB("Material.BaseColor"),opacity:f.V5.Percent("Material.Opacity",1),hiddenOpacity:f.V5.Percent("Material.HiddenOpacity",0),roughness:f.V5.Percent("Material.Roughness",.8),metalness:f.V5.Percent("Material.Metalness",.1),occlusion:f.V5.Percent("Material.Occlusion",.25),doubleSided:f.V5.Boolean("Material.DoubleSided",!1),dumpDerivatives:f.V5.Event("Derivatives.Dump")},V.outs={unitScale:f.V5.Number("UnitScale",{preset:1,precision:5}),quality:f.V5.Enum("LoadedQuality",y.$l),updated:f.V5.Event("Updated")}},13227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var i=n(19588),s=n(82587),r=n(78943),o=n(82954),a=n(71050),l=n(92642);const c=new i.P,h=new i.P,d=new s.y,u=new r._,p=new o.U;class m extends l.ZP{get settingProperties(){return[this.ins.position,this.ins.rotation,this.ins.scale]}get snapshotProperties(){return[this.ins.position,this.ins.rotation,this.ins.scale]}fromData(e){const{position:t,rotation:n,order:i,scale:s}=this.ins,r=l.VZ[i.getValidatedValue()];e.matrix?(d.fromArray(e.matrix),d.decompose(c,u,h),c.toArray(t.value),p.setFromQuaternion(u,r),c.setFromEuler(p).multiplyScalar(a.M8.RAD2DEG).toArray(n.value),h.toArray(s.value),t.set(),n.set(),s.set()):(e.translation&&t.setValue(e.translation.slice()),e.rotation&&(u.fromArray(e.rotation),p.setFromQuaternion(u,r),c.setFromEuler(p).multiplyScalar(a.M8.RAD2DEG).toArray(n.value),n.set()),e.scale&&s.setValue(e.scale.slice()),this.transform.changed=!0)}toData(){this.object3D.matrix.decompose(c,u,h);const e={};return 0===c.x&&0===c.y&&0===c.z||(e.translation=c.toArray()),0===u.x&&0===u.y&&0===u.z&&1===u.w||(e.rotation=u.toArray()),1===h.x&&1===h.y&&1===h.z||(e.scale=h.toArray()),e}}m.typeName="CVNode",m.text="Transform",m.icon=""},27924:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(31491),s=n(80038),r=n(25864);class o extends s.ZP{constructor(){super(...arguments),this.activeDocument=null}get documentProvider(){return this.getGraphComponent(r.Z)}startObserving(){const e=this.documentProvider;e.on("active-component",this.onActiveDocumentEvent,this),e.activeComponent&&(this.activeDocument=e.activeComponent,this.onActiveDocument(null,e.activeComponent))}stopObserving(){const e=this.documentProvider;e.off("active-component",this.onActiveDocumentEvent,this),e.activeComponent&&(this.activeDocument=null,this.onActiveDocument(e.activeComponent,null))}onActiveDocument(e,t){}onActiveDocumentEvent(e){this.activeDocument=e.next,this.onActiveDocument(e.previous,e.next)}}o.typeName="CVDocumentObserver";class a extends o{constructor(){super(...arguments),this.activeNode=null}get nodeProvider(){return this.getGraphComponent(i.Z)}startObserving(){super.startObserving();const e=this.nodeProvider;e.on("active-node",this.onActiveNodeEvent,this),e.activeNode&&(this.activeNode=e.activeNode,this.onActiveNode(null,e.activeNode))}stopObserving(){const e=this.nodeProvider;e.off("active-node",this.onActiveNodeEvent,this),e.activeNode&&(this.activeNode=null,this.onActiveNode(e.activeNode,null)),super.stopObserving()}onActiveNode(e,t){}onActiveNodeEvent(e){this.activeNode=e.next,this.onActiveNode(e.previous,e.next)}}a.typeName="CVNodeObserver"},31491:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(80038),s=n(92989),r=n(75222),o=n(25864);class a extends s.Z{constructor(e,t){super(e,t),this.outs=this.addOutputs(a.outs),this.scope=s.F.Graph}get documentProvider(){return this.getComponent(o.Z)}create(){super.create(),this.documentProvider.on("active-component",this.onActiveDocument,this)}dispose(){this.documentProvider.off("active-component",this.onActiveDocument,this),super.dispose()}onActiveDocument(e){this.scopedGraph=e.next}onActiveNode(e,t){this.outs.activeNode.setValue(t);const n=this.selection;t?n.nodeContainsSelectedComponent(t)||n.selectNode(t):e&&n.clearSelection()}onScopedNodes(){this.outs.changedNodes.set()}}a.typeName="CVNodeProvider",a.nodeType=r.Z,a.followComponentSelection=!0,a.outs={activeNode:i.V5.Object("Nodes.Active",r.Z),changedNodes:i.V5.Event("Nodes.Changed")}},44661:(e,t,n)=>{"use strict";n.d(t,{LY:()=>i,ZP:()=>m,dT:()=>s});var i,s,r=n(2837),o=n(28097),a=n(92642),l=n(26775),c=n(26629),h=n(63872),d=n(30242);!function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Top=2]="Top",e[e.Bottom=3]="Bottom",e[e.Front=4]="Front",e[e.Back=5]="Back",e[e.None=6]="None"}(i||(i={})),function(e){e[e.Orbit=0]="Orbit",e[e.Zoom=1]="Zoom",e[e.Pan=2]="Pan"}(s||(s={}));const u=[];u[i.Left]=[0,-90,0],u[i.Right]=[0,90,0],u[i.Front]=[0,0,0],u[i.Back]=[0,180,0],u[i.Top]=[-90,0,0],u[i.Bottom]=[90,0,0];const p=function(e,t){for(let n=0,i=e.length;ne.outs.updated.changed))&&e.update(null),this._modelBoundingBox=e.outs.boundingBox.value,(!this._isAutoZooming||this.ins.autoZoom.value&&!this._modelBoundingBox.isEmpty())&&(t.camera&&(n.camera.aspect=t.camera.aspect),t.camera=n.camera,t.zoomExtents(this._modelBoundingBox),n.ins.zoom.set(),this._hasZoomed=!0),this._isAutoZooming=!1}return e.autoRotation.changed&&(this._autoRotationStartTime=e.autoRotation.value?performance.now():null),e.promptActive.changed&&!this._autoRotationStartTime&&(this._initYOrbit=t.orbit.y,this._autoRotationStartTime=e.promptActive.value?performance.now():null),!0}tick(){const e=this.ins,t=this._scene.activeCameraComponent;if(!e.enabled.value||!t)return;const n=this._controller;n.camera=t.camera;const s=t.transform,r=this.changed||e.autoRotation.value||e.promptActive.value;if((e.autoRotation.value||e.promptActive.value)&&this._autoRotationStartTime){const t=performance.now(),i=.001*(t-this._autoRotationStartTime);if(e.autoRotation.value)n.orbit.y=(n.orbit.y+e.autoRotationSpeed.value*i)%360,this._autoRotationStartTime=t;else{const e=this.arManager.shadowRoot.getElementById("prompt");if(e){const t=2,s=1.5,r=2*s,o=.2*s;let a=i%(r+t);a>r&&a{"use strict";n.d(t,{ZP:()=>d});var i=n(80038),s=n(60206),r=n(38112),o=n(84678),a=n(63872),l=n(68327),c=n(11359),h=n(93072);class d extends i.ZP{constructor(){super(...arguments),this.ins=this.addInputs(d.ins),this.outs=this.addOutputs(d.outs)}get settingProperties(){return[this.ins.enabled,this.ins.position]}get snapshotProperties(){return[this.ins.enabled,this.ins.position,this.ins.articleId]}get articles(){return Object.keys(this._articles).map((e=>this._articles[e]))}get activeArticle(){return this.outs.article.value}get assetManager(){return this.getMainComponent(a.Z)}get assetReader(){return this.getMainComponent(l.Z)}get analytics(){return this.getMainComponent(c.Z)}get language(){return this.getGraphComponent(h.Z)}create(){super.create(),this.getGraphComponents(o.Z).forEach((e=>e.on("update",this.updateArticles,this))),this.graph.components.on(o.Z,this.onMetaComponent,this),this.graph.components.on(h.Z,this.onLanguageComponent,this),this.updateArticles()}dispose(){this.graph.components.off(h.Z,this.onLanguageComponent,this),this.graph.components.off(o.Z,this.onMetaComponent,this),this.getGraphComponents(o.Z).forEach((e=>e.off("update",this.updateArticles,this))),super.dispose()}update(e){const t=this.ins,n=this.outs;if(t.enabled.changed,t.articleId.changed){const e=this._articles[t.articleId.value]||null,i=e&&e.article;n.article.setValue(i),n.content.setValue(""),i&&(this.readArticle(i),this.analytics.sendProperty("Reader_ArticleId",i.defaultTitle))}return t.refresh.changed&&this.refreshArticle(),!0}readArticle(e){const t=this.outs,n=e.uri;if(n)return this.assetReader.getText(n).then((e=>this.parseArticle(e,n))).then((e=>t.content.setValue(e))).catch((e=>t.content.setValue(`

Article not found at ${n}

`)));t.content.setValue("

Can't display article: no URI.

")}parseArticle(e,t){e=e.replace(/[\n\r]/g,"");const n=this.assetManager.getAssetBasePath(t);return e=e.replace(/(src=\")(.*?)(\")/g,((e,t,i,s)=>(i.startsWith("/")||i.startsWith("http")||(i=this.assetManager.getAssetUrl(n+i)),t+i+s))),Promise.resolve(e)}onMetaComponent(e){e.add&&e.object.articles.on("update",this.updateArticles,this),e.remove&&e.object.articles.off("update",this.updateArticles,this),this.updateArticles()}onLanguageComponent(e){e.add&&e.object.outs.language.on("value",this.updateLanguage,this),e.remove&&e.object.outs.language.off("value",this.updateLanguage,this)}refreshArticle(){const e=this._articles[this.ins.articleId.value]||null,t=e&&e.article;t&&this.readArticle(t)}updateArticles(){const e=this.getGraphComponents(o.Z),t=this._articles={};e.forEach((e=>{const n=e.articles,i=e.node;n.items.forEach((e=>{t[e.id]={article:e,node:i}}))}))}updateLanguage(){this.ins;this.articles.forEach((e=>{e.article.language=this.language.outs.language.value})),this.ins.refresh.set()}fromData(e){e=e||{},this.ins.setValues({enabled:!!e.enabled,position:s.we[e.position]||s.we.Overlay})}toData(){const e=this.ins;return{enabled:e.enabled.value,position:s.we[e.position.value]||"Overlay"}}}d.typeName="CVReader",d.text="Reader",d.icon="",d.ins={enabled:i.V5.Boolean("Reader.Enabled"),visible:i.V5.Boolean("Reader.Visible",!0),closed:i.V5.Event("Reader.Closed"),refresh:i.V5.Event("Reader.Refresh"),position:i.V5.Enum("Reader.Position",s.we),articleId:i.V5.String("Article.ID"),focus:i.V5.Boolean("Reader.Focus")},d.outs={article:i.V5.Object("Article.Active",r.Z),content:i.V5.String("Article.Content"),count:i.V5.Integer("Article.Count")}},26629:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var i=n(19588),s=n(37840),r=n(80038),o=n(1594),a=n(13227),l=n(3388),c=n(15577),h=n(92642),d=n(27884),u=n(79815),p=n(15271),m=n(41282),f=n(76288);const g=new i.P,v=new i.P;class y extends a.Z{constructor(){super(...arguments),this.ins=this.addInputs(y.ins),this.outs=this.addOutputs(y.outs),this.updateCameraHelper=()=>{const e=this.setup.navigation.ins.offset.value,t=g.set(e[0],e[1],e[2]).length();if(!this.system.getComponent("CVStoryApplication",!0)){const e=2.5*Math.max(t,this.outs.boundingRadius.value),n=this.setup.navigation.ins.maxOffset.value;this.setup.navigation.ins.maxOffset.setValue([n[0],n[1],e])}this.cameras.forEach((e=>{if(e.addIns.autoNearFar.value){const n=4*Math.max(t,this.outs.boundingRadius.value),i=Math.min(n/1e3,this.outs.boundingRadius.value/100);(n{e.ins.globalUnits.linkFrom(this.ins.units),this.ins.modelUpdated.linkFrom(e.outs.updated)}))}update(e){const t=this.ins,n=this.outs;return t.units.changed&&(this.updateTransformHierarchy(),this.updateModelBoundingBox(),this.updateLights(),this.updateCameras(),n.units.setValue(t.units.value)),t.modelUpdated.changed&&(this.updateModelBoundingBox(),this.updateLights(),this.updateCameras()),t.sceneTransformed.changed&&this.updateModelBoundingBox(),!0}dispose(){this.graph.components.off(l.Z,this.onModelComponent,this),super.dispose()}fromDocument(e,t){this.ins.units.setValue(o.f_[t.units]||0),this.outs.units.setValue(o.f_[t.units]||0)}toDocument(e,t){t.units=o.f_[this.ins.units.getValidatedValue()]}onModelComponent(e){const t=e.object;e.add&&(t.ins.globalUnits.linkFrom(this.ins.units),this.ins.modelUpdated.linkFrom(t.outs.updated))}updateModelBoundingBox(){const e=this.outs.boundingBox.value;e.makeEmpty(),this.models.forEach((t=>{t.object3D.visible&&e.expandByObject(t.object3D)})),e.getSize(g),g.length()>0?(this.outs.boundingBox.set(),this.outs.boundingRadius.setValue(.5*g.length())):this.outs.boundingRadius.setValue(10)}updateTransformHierarchy(){if(0===this.models.length)return;const{ins:e,outs:t}=this,n=(0,c.Z)(t.units.value,e.units.value),i=this.models[0].object3D.parent.parent;i.position.multiplyScalar(n),i.updateMatrix(),i.updateMatrixWorld(!0),this.models.forEach((e=>{const t=e.object3D.parent;t.position.multiplyScalar(n),t.updateMatrix(),t.updateMatrixWorld(!0)}))}updateLights(){const{ins:e,outs:t}=this,n=this.graph.findNodeByName("Lights");if(n){const i=n.getComponent(h.ZP,!0),s=(0,c.Z)(t.units.value,e.units.value);i.ins.scale.setValue([1,1,1]),i.children.forEach((e=>{const t=e.getComponents(m.f);for(let e of t){if(e instanceof f.Z){g.copy(e.light.position),v.copy(e.light.target.position);const t=v.sub(g).normalize();t.applyEuler(e.transform.object3D.rotation),g.copy(t.negate().multiplyScalar(1.2*this.outs.boundingRadius.value)),g.multiplyScalar(s),e.transform.ins.position.setValue(g.toArray()),g.setScalar(this.outs.boundingRadius.value*s*.2),e.transform.ins.scale.setValue(g.toArray()),e.light.updateMatrix()}e.ins.shadowEnabled.value&&("shadowSize"in e.ins&&e.ins.shadowSize.setValue(2*this.outs.boundingRadius.value),e.light.shadow.camera.far=4*this.outs.boundingRadius.value)}}))}}updateCameras(){this.renderer.views[0]&&this.renderer.views[0].renderer.xr.isPresenting||this.updateCameraHelper()}}y.typeName="CVScene",y.text="Scene",y.icon="hierarchy",y.ins={units:r.V5.Enum("Scene.Units",o.f_,o.f_.cm),modelUpdated:r.V5.Event("Scene.ModelUpdated"),sceneTransformed:r.V5.Event("Scene.Transformed")},y.outs={units:r.V5.Enum("Scene.Units",o.f_,o.f_.cm),boundingBox:r.V5.Object("Models.BoundingBox",s.Z),boundingRadius:r.V5.Number("Models.BoundingRadius")}},79815:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b});var i=n(80038),s=n(92642),r=n(40490),o=n(27643),a=n(5249),l=n(44661),c=n(71507),h=n(97322),d=n(6461),u=n(29767),p=n(63531),m=n(7134),f=n(74572),g=n(24856),v=n(93072),y=n(17467);class b extends i.ZP{constructor(){super(...arguments),this._savedSetupData={},this.ins=this.addInputs(b.ins)}get featureMap(){return this.constructor.featureMap}get transform(){return this.getComponent(s.ZP)}create(){super.create();const e=this.node,t=b.featureMap;for(const n in t)this[n]=e.createComponent(t[n]);this.snapshots=e.createComponent(f.Z)}update(){const e=this.ins;return e.saveState.changed&&this.cacheSetupState(),e.restoreState.changed&&this.restoreSetupState(),!0}fromDocument(e,t,n){const i=e.scenes[t];if(!isFinite(i.setup))throw new Error("setup property missing in node");const s=this._savedSetupData=e.setups[i.setup],r=b.featureMap;for(const e in r){n.set(`scenes/${t}/setup/${e}`,this[e]);const i=s[e];i&&this[e].fromData(i)}}toDocument(e,t,n){const i=this._savedSetupData,s=b.featureMap;for(const e in s)n.set(this[e],`scenes/${t}/setup/${e}`);const r=this.tours.toData();r?i.tours=r:i.tours&&delete i.tours;const o=this.snapshots.toData(n);if(o&&(i.snapshots=o),i){e.setups=e.setups||[];const n=e.setups.length;e.setups.push(i),e.scenes[t].setup=n}}cacheSetupState(){const e=b.featureMap;for(const t in e){const e=this[t].toData();e&&(this._savedSetupData[t]=e)}}restoreSetupState(){const e=this._savedSetupData,t=b.featureMap;for(const n in t){const t=e[n];t&&"tours"!==n&&this[n].fromData(t)}}}b.typeName="CVSetup",b.ins={saveState:i.V5.Event("Setup.SaveState"),restoreState:i.V5.Event("Setup.RestoreState")},b.featureMap={interface:r.Z,reader:a.ZP,viewer:o.Z,navigation:l.ZP,background:c.Z,environment:g.Z,language:v.Z,floor:h.Z,grid:d.Z,tape:u.Z,slicer:p.Z,tours:m.Z,audio:y.Z}},63531:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(37840),s=n(80038),r=n(60206),o=n(26629),a=n(3388);const l=[[-1,0,0,0],[0,-1,0,0],[0,0,-1,0],[1,0,0,0],[0,1,0,0],[0,0,1,0]];class c extends s.ZP{constructor(){super(...arguments),this.ins=this.addInputs(c.ins),this.plane=null,this.axisIndex=-1}get settingProperties(){return[this.ins.enabled,this.ins.color]}get snapshotProperties(){return[this.ins.enabled,this.ins.axis,this.ins.position,this.ins.inverted]}create(){super.create();const e=this.getGraphComponent(o.Z);this.ins.boundingBox.linkFrom(e.outs.boundingBox)}update(e){const t=this.ins;if(t.axis.changed){const e=t.axis.getValidatedValue();e===this.axisIndex?t.inverted.setValue(!t.inverted.value):(t.inverted.setValue(!1),this.axisIndex=e)}if(!t.enabled.value&&!t.enabled.changed)return!1;const n=t.axis.getValidatedValue(),i=t.inverted.value,s=n+(i?3:0),r=this.ins.boundingBox.value;if(!r)return!0;this.plane=l[s];const o=r.min.getComponent(n),c=r.max.getComponent(n),h=1-t.position.value;this.plane[3]=i?h*(c-o)-c:c-h*(c-o);return this.getGraphComponents(a.Z).forEach((e=>{if(e.ins.slicerEnabled.value){e.object3D.traverse((e=>{if(e.isMesh){const t=e.material;t.isUberPBRMaterial&&this.updateMaterial(t)}}))}})),!0}fromData(e){e=e||{},this.ins.setValues({enabled:e.enabled||!1,axis:r.fi[e.axis]||r.fi.X,position:e.position||0,inverted:e.inverted||!1,color:e.color||[0,.61,.87]})}toData(){const e=this.ins;return{enabled:e.enabled.value,axis:r.fi[e.axis.getValidatedValue()],position:e.position.value,inverted:e.inverted.value,color:e.color.value}}updateMaterial(e){const t=this.ins;t.enabled.changed&&(e.enableCutPlane(t.enabled.value),e.needsUpdate=!0),e.cutPlaneDirection.fromArray(this.plane),e.cutPlaneColor.fromArray(t.color.value)}}c.typeName="CVSlicer",c.text="Slicer",c.icon="",c.ins={enabled:s.V5.Boolean("Slice.Enabled"),axis:s.V5.Enum("Slice.Axis",r.fi),position:s.V5.Number("Slice.Position",{min:0,max:1,preset:.5}),inverted:s.V5.Boolean("Slice.Inverted"),color:s.V5.ColorRGB("Slice.Color",[0,.61,.87]),boundingBox:s.V5.Object("Scene.BoundingBox",i.Z)}},74572:(e,t,n)=>{"use strict";n.d(t,{P:()=>i.P,Z:()=>l});var i=n(403),s=n(16967),r=n(79815),o=n(3388),a=n(7134);class l extends i.Z{constructor(){super(...arguments),this.targetFeatures={}}create(){super.create();const e=this.getGraphComponent(r.Z);Object.keys(e.featureMap).forEach((e=>{this.targetFeatures[e]=!1})),this.targetFeatures.models=!1,this.targetFeatures.lights=!1,this.initializeTargetFeatures()}initializeTargetFeatures(){const e=this.targetFeatures;Object.keys(e).forEach((t=>e[t]=!1)),e.navigation=!0,e.reader=!0,e.viewer=!0,this.updateTargets()}updateTargets(){const e=this.targetFeatures,t=this.getGraphComponent(r.Z);Object.keys(e).forEach((n=>{const i=t[n],s=e[n];i&&this.updateComponentTarget(i,s)}));this.getGraphComponents(o.Z).forEach((t=>{this.updateComponentTarget(t.transform,!!e.models),this.updateComponentTarget(t,!!e.models)}));this.getGraphComponents(s.Z).forEach((t=>{this.updateComponentTarget(t.transform,!!e.lights),this.updateComponentTarget(t,!!e.lights)}))}updateComponentTarget(e,t){const n=e.snapshotProperties;n&&n.forEach((e=>{if(!e.schema.event&&"object"!==e.type){const n=this.hasTargetProperty(e);t&&!n?this.addTargetProperty(e):!t&&n&&this.removeTargetProperty(e)}}))}fromData(e,t){this.clear();const n=this.targetFeatures,s=Object.keys(n);e.features?s.forEach((t=>n[t]=e.features.indexOf(t)>=0)):this.initializeTargetFeatures();const r=new Set;e.targets.forEach(((e,n)=>{const i=e.lastIndexOf("/"),s=e.substr(0,i),o=e.substr(i+1),a=t.get(s),l=a?a.ins[o]:null;l?this.addTargetProperty(l):(console.warn(`missing snapshot target property for '${e}'`),r.add(n))})),e.states.forEach((e=>{e.id!==a.Z.sceneSnapshotId&&this.setState({id:e.id,curve:void 0!==e.curve?i.P[e.curve]:i.P.EaseQuad,duration:void 0!==e.duration?e.duration:2,threshold:void 0!==e.threshold?e.threshold:.5,values:e.values.filter(((e,t)=>!r.has(t)))})}))}toData(e){const t=this.targetFeatures,n={features:Object.keys(t).filter((e=>t[e])),targets:this.targets.map((t=>{const n=t.property.group.linkable,i=t.property.key,s=e.get(n);if(!s)throw new Error(`snapshot path not registered for component '${n.displayName}'`);return s+"/"+i})),states:Object.keys(this.states).map((e=>{const t=this.states[e],n={id:t.id,values:t.values};return t.curve!==i.P.EaseQuad&&(n.curve=i.P[t.curve]),2!==t.duration&&(n.duration=t.duration),.5!==t.threshold&&(n.threshold=t.threshold),n}))};return n.targets.length>0&&n.states.length>0?n:null}}l.typeName="CVSnapshots"},31105:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(28110),s=n(2837),r=(n(44466),n(41029));n(91013),n(13301),n(10160);class o extends s.ZP{constructor(e,t){super(e,t),this._annotations={},this._viewports=new Set,this._sprites={},this.object3D=new i.Z,this.object3D.setVisible(!1)}update(e){super.update(e);const t=this.ins,n=this.object3D;return t.visible.changed&&n.setVisible(t.visible.value),!0}tock(){if(this.updated)return!0}postRender(e){const t=e.viewport;this._viewports.has(t)||(t.on("dispose",this.onViewportDispose,this),this._viewports.add(t));this.object3D.render(t.overlay,e.camera)}dispose(){this.object3D.dispose(),this._viewports.forEach((e=>e.off("dispose",this.onViewportDispose,this))),this._viewports.clear(),super.dispose()}addAnnotation(e){this._annotations[e.id]=e,this.createSprite(e),this.changed=!0}removeAnnotation(e){Object.keys(this._annotations);delete this._annotations[e.id],this.removeSprite(e),this.changed=!0}updateAnnotation(e,t){t&&this.updateSprite(e),this.changed=!0}onViewportDispose(e){this.object3D.disposeHTMLElements(e.viewport.overlay)}createSprite(e){this.removeSprite(e);const t=r.Z.createInstance(e);this._sprites[e.id]=t,this.object3D.add(t)}removeSprite(e){const t=this._sprites[e.id];t&&(t.dispose(),this._sprites[e.id]=void 0,this.object3D.remove(t))}updateSprite(e){const t=this._sprites[e.id];t&&t.update()}}o.typeName="CVStaticAnnotationView"},29767:(e,t,n)=>{"use strict";n.d(t,{T:()=>P,Z:()=>R});var i=n(23130),s=n(19588),r=n(29187),o=n(75809),a=n(64026),l=n(93122),c=n(37840),h=n(2837),d=n(6965),u=n(8035),p=n(40693),m=n(35322),f=n(71050);class g extends o.u{constructor(e=[new p.F(0,-.5),new p.F(.5,0),new p.F(0,.5)],t=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=f.uZ(i,0,2*Math.PI);const r=[],o=[],a=[],l=[],c=[],h=1/t,d=new s.P,u=new p.F,g=new s.P,v=new s.P,y=new s.P;let b=0,_=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:b=e[t+1].x-e[t].x,_=e[t+1].y-e[t].y,g.x=1*_,g.y=-b,g.z=0*_,y.copy(g),g.normalize(),l.push(g.x,g.y,g.z);break;case e.length-1:l.push(y.x,y.y,y.z);break;default:b=e[t+1].x-e[t].x,_=e[t+1].y-e[t].y,g.x=1*_,g.y=-b,g.z=0*_,v.copy(g),g.x+=y.x,g.y+=y.y,g.z+=y.z,g.normalize(),l.push(g.x,g.y,g.z),y.copy(v)}for(let s=0;s<=t;s++){const r=n+s*h*i,p=Math.sin(r),m=Math.cos(r);for(let n=0;n<=e.length-1;n++){d.x=e[n].x*p,d.y=e[n].y,d.z=e[n].x*m,o.push(d.x,d.y,d.z),u.x=s/t,u.y=n/(e.length-1),a.push(u.x,u.y);const i=l[3*n+0]*p,r=l[3*n+1],h=l[3*n+0]*m;c.push(i,r,h)}}for(let n=0;n0)):(this.system.off("pointer-up",this.onPointerUp,this),this.annotationView.ins.visible.setValue(!1))),r.visible.changed)if(r.visible.value){const e=r.startPosition.value,t=r.endPosition.value;e[0]==t[0]&&e[1]==t[1]&&e[2]==t[2]||(n.visible=!0,i.visible=!0,s.visible=!0,this.annotationView.ins.visible.setValue(!0))}else this.annotationView.ins.visible.setValue(!1);if(r.globalUnits.changed&&this.updateUnitScale(),r.startPosition.changed||r.startDirection.changed){n.position.fromArray(r.startPosition.value),T.fromArray(r.startDirection.value),n.quaternion.setFromUnitVectors(A,T),n.updateMatrix();const e=t.attributes.position.array;e[0]=n.position.x,e[1]=n.position.y,e[2]=n.position.z,t.attributes.position.needsUpdate=!0,this.annotationView.ins.visible.setValue(!1)}if(r.endPosition.changed||r.endDirection.changed){i.position.fromArray(r.endPosition.value),T.fromArray(r.endDirection.value),i.quaternion.setFromUnitVectors(A,T),i.updateMatrix();const e=t.attributes.position.array;e[3]=i.position.x,e[4]=i.position.y,e[5]=i.position.z,t.attributes.position.needsUpdate=!0,T.fromArray(r.startPosition.value),C.fromArray(r.endPosition.value);const n=T.distanceTo(C);this.outs.distance.setValue(n);this.label.data.position=[(e[0]+e[3])/2,(e[1]+e[4])/2,(e[2]+e[5])/2];const s=this.ins.globalUnits.getOptionText();this.label.title=n.toFixed(2)+" "+s,this.annotationView.updateAnnotation(this.label,!0),n>0&&this.ins.visible.value&&this.annotationView.ins.visible.setValue(!0)}return!0}fromData(e){this.ins.copyValues({visible:e.enabled})}toData(){return{enabled:this.ins.visible.cloneValue()}}onPointerUp(e){if(e.isDragging||!e.component||!e.component.is(y.Z))return;const t=e.component,n=(0,w.k)(t.object3D,e.object3D),i=t.localBoundingBox.clone().applyMatrix4(n),s=e.object3D.matrixWorld;E.getNormalMatrix(s);const r=e.view.pickPosition(e,i).applyMatrix4(s),o=e.view.pickNormal(e).applyMatrix3(E).normalize(),{startPin:a,endPin:l,line:c,ins:h,outs:d}=this;d.state.value===P.SetStart?(r.toArray(h.startPosition.value),o.toArray(h.startDirection.value),h.startPosition.set(),h.startDirection.set(),a.visible=!0,l.visible=!1,c.visible=!1,d.state.setValue(P.SetEnd)):(r.toArray(h.endPosition.value),o.toArray(h.endDirection.value),h.endPosition.set(),h.endDirection.set(),a.visible=!0,l.visible=!0,c.visible=!0,d.state.setValue(P.SetStart))}updateUnitScale(){const e=this.ins,t=e.localUnits.getValidatedValue(),n=e.globalUnits.getValidatedValue();this.outs.unitScale.setValue((0,x.Z)(t,n)),T.fromArray(e.startPosition.value),e.startPosition.setValue(T.multiplyScalar(this.outs.unitScale.value).toArray()),T.fromArray(e.endPosition.value),e.endPosition.setValue(T.multiplyScalar(this.outs.unitScale.value).toArray()),e.localUnits.setValue(n)}}R.typeName="CVTape",R.text="Tape",R.icon="",R.tapeIns={startPosition:h.V5.Vector3("Start.Position"),startDirection:h.V5.Vector3("Start.Direction"),endPosition:h.V5.Vector3("End.Position"),endDirection:h.V5.Vector3("End.Direction"),boundingBox:h.V5.Object("Scene.BoundingBox",c.Z),globalUnits:h.V5.Enum("Model.GlobalUnits",_.f_,_.f_.cm),localUnits:h.V5.Enum("Model.LocalUnits",_.f_,_.f_.cm),enabled:h.V5.Boolean("Tape.Enabled",!1)},R.tapeOuts={state:h.V5.Enum("Tape.State",P),distance:h.V5.Number("Tape.Distance"),unitScale:h.V5.Number("UnitScale",{preset:1,precision:5})}},97008:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>o.Mo,V5:()=>i.V5,ZP:()=>l,dy:()=>o.dy,v5:()=>c});var i=n(80038),s=n(27924),r=n(11359),o=n(11598),a=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class l extends s.Z{constructor(){super(...arguments),this.ins=this.addInputs(l.toolIns),this.outs=this.addOutputs(l.toolOuts),this._isActiveTool=!1}get isActiveTool(){return this._isActiveTool}dispose(){this._isActiveTool&&this.deactivateTool(),super.dispose()}createView(){throw new Error("must override")}activateTool(){this._isActiveTool=!0,this.startObserving()}deactivateTool(){this.stopObserving(),this._isActiveTool=!1}}l.typeName="CVTool",l.toolIns={},l.toolOuts={};class c extends o.ZP{constructor(e){super(e.system),this.tool=null,this.needsFocus=!1,this.tool=e}get analytics(){return this.system.getMainComponent(r.Z)}firstConnected(){this.classList.add("sv-group","sv-tool-view"),this.needsFocus=!0}connected(){super.connected(),this.tool.on("update",this.onUpdate,this)}disconnected(){this.tool.off("update",this.onUpdate,this),super.disconnected()}updated(e){super.updated(e),this.needsFocus&&(this.setFocus(),this.needsFocus=!1)}setFocus(){}}a([(0,o.Cb)({attribute:!1})],c.prototype,"tool",void 0)},22040:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(80038),s=n(63833),r=n(97008),o=n(11359);class a extends s.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(a.ins),this.scope=s.$.Node}get analytics(){return this.getMainComponent(o.Z)}update(e){return this.ins.visible.changed,!0}activateComponent(e){e.activateTool(),this.analytics.sendProperty("Tools_ActiveTool",e.text)}deactivateComponent(e){e.deactivateTool()}onActiveComponent(e,t){}}a.typeName="CVToolProvider",a.isSystemSingleton=!0,a.componentType=r.ZP,a.ins={visible:i.V5.Boolean("Tools.Visible"),closed:i.V5.Event("Tools.Closed")}},7134:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(80038),s=n(1594),r=n(74572),o=n(11359),a=n(93072),l=n(79815);class c extends i.ZP{constructor(){super(...arguments),this.ins=this.addInputs(c.ins),this.outs=this.addOutputs(c.outs),this._tours=[]}get analytics(){return this.getMainComponent(o.Z)}get language(){return this.getGraphComponent(a.Z)}get setup(){return this.getGraphComponent(l.Z)}get snapshots(){return this.getComponent(r.Z)}get tours(){return this._tours}get activeSteps(){const e=this.activeTour;return e?e.steps:null}get activeTour(){return this._tours[this.outs.tourIndex.value]}get activeStep(){const e=this.activeTour;return e?e.steps[this.outs.stepIndex.value]:null}get title(){const e=this.activeTour;return 0===Object.keys(e.titles).length&&(e.titles[s.k$]=e.title),e.titles[s.PD[this.language.outs.language.value]]||"undefined"}set title(e){this.activeTour.titles[s.PD[this.language.outs.language.value]]=e}get lead(){const e=this.activeTour;return 0===Object.keys(e.leads).length&&(e.leads[s.k$]=e.lead),e.leads[s.PD[this.language.outs.language.value]]||""}set lead(e){this.activeTour.leads[s.PD[this.language.outs.language.value]]=e}get taglist(){const e=this.activeTour;return 0===Object.keys(e.taglist).length&&e.tags.length>0&&(e.taglist[s.k$]=e.tags),e.taglist[s.PD[this.language.outs.language.value]]||[]}set taglist(e){this.activeTour.taglist[s.PD[this.language.outs.language.value]]=e}get stepTitle(){const e=this.activeStep;return e?(0===Object.keys(e.titles).length&&(e.titles[s.k$]=e.title),e.titles[s.PD[this.language.outs.language.value]]||"undefined"):null}set stepTitle(e){const t=this.activeStep;t&&(t.titles[s.PD[this.language.outs.language.value]]=e)}create(){super.create(),this.language.outs.language.on("value",this.update,this)}dispose(){this.language.outs.language.off("value",this.update,this),super.dispose()}update(e){const{ins:t,outs:n}=this,i=this._tours,s=this.snapshots,o=this.setup.navigation;if(t.enabled.changed){if(!t.enabled.value)return n.tourIndex.set(),this.normalizeViewOrbit(c.sceneSnapshotId),s.tweenTo(c.sceneSnapshotId,e.secondsElapsed),s.deleteState(c.sceneSnapshotId),!0;{const e={id:c.sceneSnapshotId,curve:r.P.EaseOutQuad,duration:1,threshold:0,values:s.getCurrentValues()};s.setState(e)}}const a=Math.min(i.length-1,Math.max(-1,t.tourIndex.value)),l=i[a],h=l?l.steps.length:0;n.stepCount.setValue(h);let d=-1;if((t.tourIndex.changed||t.enabled.changed)&&(a!==n.tourIndex.value&&(d=0),n.tourIndex.setValue(a),n.tourTitle.setValue(l?this.title:""),n.tourLead.setValue(l?this.lead:"")),0===h)return n.stepIndex.setValue(-1),n.stepTitle.setValue(""),!0;let u=!0;if(t.enabled.changed&&(d=n.stepIndex.value),t.stepIndex.changed&&(d=Math.min(l.steps.length-1,Math.max(0,t.stepIndex.value)),u=!1),t.first.changed&&(d=0),t.next.changed&&(d=n.stepIndex.value+1,d>=h&&(n.ending.setValue(!0),n.tourIndex.setValue(-1),n.tourTitle.setValue(""),n.tourLead.setValue(""),n.stepIndex.set(),d=-1)),t.previous.changed&&(d=(n.stepIndex.value+h-1)%h),0===d&&this.normalizeViewOrbit(l.steps[0].id),d>=0){o.setChanged(!0);const e=l.steps[d];n.stepIndex.setValue(d),n.stepTitle.setValue(this.stepTitle||"undefined"),s.ins.id.setValue(e.id),u?s.ins.tween.set():s.ins.recall.set()}return!0}fromData(e){this._tours=e.map((e=>({title:e.title,titles:e.titles||{},steps:e.steps.map((e=>({title:e.title,titles:e.titles||{},id:e.id}))),lead:e.lead||"",leads:e.leads||{},tags:e.tags||[],taglist:e.taglist||{}}))),this._tours.forEach((e=>{Object.keys(e.titles).forEach((e=>{this.language.addLanguage(s.PD[e])})),e.steps.forEach((e=>{0==Object.keys(e.titles).length&&(e.titles[s.k$]=e.title||null)}))})),this.ins.tourIndex.setValue(-1),this.outs.count.setValue(this._tours.length)}toData(){return 0===this._tours.length?null:this._tours.map((e=>{const t={steps:e.steps.map((e=>{const t={};return t.id=e.id,Object.keys(e.titles).length>0?t.titles=e.titles:e.title&&(t.title=e.title),t}))};return Object.keys(e.titles).length>0?t.titles=e.titles:e.title&&(t.title=e.title),Object.keys(e.leads).length>0?t.leads=e.leads:e.lead&&(t.lead=e.lead),Object.keys(e.taglist).length>0?t.taglist=e.taglist:e.tags.length>0&&(t.tags=e.tags),t}))}normalizeViewOrbit(e){const t=this.snapshots.getTargetProperties().findIndex((e=>"Orbit"==e.name)),n=this.snapshots.getState(e),i=this.snapshots.getCurrentValues()[t];n&&i.forEach(((e,i)=>{const s=Math.round((n.values[t][i]-e)/360);this.snapshots.getTargetProperties()[t].value[i]+=360*s}))}}c.typeName="CVTours",c.sceneSnapshotId="scene-default",c.ins={enabled:i.V5.Boolean("Tours.Enabled"),tourIndex:i.V5.Integer("Tours.Index",-1),closed:i.V5.Event("Tours.Closed"),stepIndex:i.V5.Integer("Step.Index"),next:i.V5.Event("Step.Next"),previous:i.V5.Event("Step.Previous"),first:i.V5.Event("Step.First")},c.outs={count:i.V5.Integer("Tours.Count"),tourIndex:i.V5.Integer("Tour.Index",-1),tourTitle:i.V5.String("Tour.Title"),tourLead:i.V5.String("Tour.Lead"),stepCount:i.V5.Integer("Tour.Steps"),ending:i.V5.Boolean("Tour.Ending"),stepIndex:i.V5.Integer("Step.Index"),stepTitle:i.V5.String("Step.Title")}},27643:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var i=n(75544),s=n(80038),r=n(15271),o=n(60206),a=n(43875),l=n(3388),c=n(51462),h=n(11359),d=n(93072),u=n(30242);class p extends s.ZP{constructor(){super(...arguments),this._rootElement=null,this.ins=this.addInputs(p.ins),this.outs=this.addOutputs(p.outs)}get settingProperties(){return[this.ins.annotationsVisible,this.ins.activeTags,this.ins.sortedTags,this.ins.radioTags,this.ins.shader,this.ins.toneMapping,this.ins.exposure,this.ins.gamma,this.ins.isWallMountAR,this.ins.arScale]}get snapshotProperties(){return[this.ins.annotationsVisible,this.ins.activeAnnotation,this.ins.activeTags,this.ins.shader,this.ins.exposure]}get analytics(){return this.getMainComponent(h.Z)}get renderer(){return this.getMainComponent(r.Z)}get ar(){return this.getMainComponent(u.Z)}get rootElement(){return this._rootElement}set rootElement(e){this._rootElement=e}create(){super.create(),this.graph.components.on(l.Z,this.onModelComponent,this),this.graph.components.on(c.Z,this.onAnnotationsComponent,this),this.graph.components.on(d.Z,this.onLanguageComponent,this),this.ar.ins.wallMount.linkFrom(this.ins.isWallMountAR),this.ar.ins.arScale.linkFrom(this.ins.arScale)}dispose(){this.graph.components.off(l.Z,this.onModelComponent,this),this.graph.components.off(c.Z,this.onAnnotationsComponent,this),this.graph.components.off(d.Z,this.onLanguageComponent,this),super.dispose()}update(e){const t=this.ins;if(t.shader.changed){const e=t.shader.getValidatedValue();this.getGraphComponents(l.Z).forEach((t=>t.ins.shader.setValue(e)))}if(t.exposure.changed&&this.renderer.ins.exposure.setValue(t.exposure.value),t.toneMapping.changed){this.renderer.views.forEach((e=>e.renderer.toneMapping=t.toneMapping.value?i.LY2:i.uL9));const e=this.renderer.activeScene;e&&e.traverse((e=>{const t=e;t.isMesh&&(Array.isArray(t.material)?t.material.forEach((e=>e.needsUpdate=!0)):t.material.needsUpdate=!0)}))}if(t.gamma.changed,t.quality.changed){const e=t.quality.getValidatedValue();this.getGraphComponents(l.Z).forEach((t=>t.ins.quality.setValue(e)))}if(t.activeAnnotation.changed){const e=t.activeAnnotation.value;this.getGraphComponents(c.Z).forEach((t=>t.setActiveAnnotationById(e)))}if(t.annotationsVisible.changed){const e=t.annotationsVisible.value;this.getGraphComponents(c.Z).forEach((t=>t.ins.visible.setValue(e)))}if(t.activeTags.changed){const e=t.activeTags.value;this.getGraphComponents(c.Z).forEach((t=>t.ins.activeTags.setValue(e))),this.getGraphComponents(l.Z).forEach((t=>t.ins.activeTags.setValue(e)))}return t.sortedTags.changed&&this.refreshTagCloud(),!0}fromData(e){const t=this.ins;t.copyValues({shader:o.pH[e.shader]||o.pH.Default,exposure:void 0!==e.exposure?e.exposure:t.exposure.schema.preset,toneMapping:e.toneMapping||!1,gamma:void 0!==e.gamma?e.gamma:t.gamma.schema.preset,isWallMountAR:e.isWallMountAR||!1,arScale:e.arScale||1,annotationsVisible:!!e.annotationsVisible,activeTags:e.activeTags||"",sortedTags:e.sortedTags||"",radioTags:void 0!==e.radioTags?!!e.radioTags:t.radioTags.schema.preset})}toData(){const e=this.ins,t={shader:o.pH[e.shader.value],exposure:e.exposure.value,toneMapping:e.toneMapping.value,gamma:e.gamma.value,isWallMountAR:e.isWallMountAR.value,arScale:e.arScale.value};return e.annotationsVisible.value&&(t.annotationsVisible=!0),e.activeTags.value&&(t.activeTags=e.activeTags.value),e.sortedTags.value&&(t.sortedTags=e.sortedTags.value),e.radioTags.value&&(t.radioTags=e.radioTags.value),t}refreshTagCloud(){const e=new Set;this.getGraphComponents(l.Z).forEach((t=>{t.ins.tags.value.split(",").map((e=>e.trim())).filter((e=>e)).forEach((t=>e.add(t)))}));this.getGraphComponents(c.Z).forEach((t=>{t.getAnnotations().forEach((t=>{t.tags.forEach((t=>{e.add(t)}))}))}));const t=Array.from(e),n=this.ins.sortedTags.value.split(",").map((e=>e.trim())).filter((e=>e));t.sort(((e,t)=>{const i=n.indexOf(e),s=n.indexOf(t);return is?1:0})),this.outs.tagCloud.setValue(t.join(", ")),this.ins.activeTags.set(),this.ins.annotationsVisible.set()}onAnnotationClick(e){const t=e.annotation?e.annotation.id:"";this.ins.activeAnnotation.setValue(t),this.rootElement.dispatchEvent(new CustomEvent("annotation-active",{detail:t}))}onModelComponent(e){const t=e.object;e.add?(t.on("tag-update",this.refreshTagCloud,this),t.on("model-load",this.onModelLoad,this)):e.remove&&(t.off("tag-update",this.refreshTagCloud,this),t.off("model-load",this.onModelLoad,this))}onAnnotationsComponent(e){const t=e.object;e.add?(t.on("tag-update",this.refreshTagCloud,this),t.on("click",this.onAnnotationClick,this),t.ins.visible.setValue(this.ins.annotationsVisible.value)):e.remove&&(t.off("tag-update",this.refreshTagCloud,this),t.off("click",this.onAnnotationClick,this))}onLanguageComponent(e){const t=e.object;e.add?t.on("tag-update",this.refreshTagCloud,this):e.remove&&t.off("tag-update",this.refreshTagCloud,this)}onModelLoad(e){this.rootElement.dispatchEvent(new CustomEvent("model-load",{detail:a.$l[e.quality]})),this.refreshTagCloud()}}p.typeName="CVViewer",p.text="Viewer",p.icon="",p.ins={annotationsVisible:s.V5.Boolean("Annotations.Visible"),activeAnnotation:s.V5.String("Annotations.ActiveId"),activeTags:s.V5.String("Tags.Active"),sortedTags:s.V5.String("Tags.Sorted"),radioTags:s.V5.Boolean("Tags.Radio"),shader:s.V5.Enum("Renderer.Shader",o.pH),toneMapping:s.V5.Boolean("Renderer.ToneMapping",!1),exposure:s.V5.Number("Renderer.Exposure",1),gamma:s.V5.Number("Renderer.Gamma",2),quality:s.V5.Enum("Models.Quality",a.$l,a.$l.High),isWallMountAR:s.V5.Boolean("AR.IsWallMount",!1),arScale:s.V5.Number("AR.Scale",1)},p.outs={tagCloud:s.V5.String("Tags.Cloud")}},53414:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(76288),s=n(16967);class r extends i.Z{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.shadowEnabled,this.ins.shadowSize,this.ins.shadowResolution,this.ins.shadowBlur]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){this.ins.shadowEnabled.value&&this.light.shadow.map&&this.light.shadow.map.dispose(),super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if("directional"!==n.type)throw new Error("light type mismatch: not a directional light");return i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,target:i.target.schema.preset,shadowEnabled:n.shadowEnabled||!1,shadowSize:void 0!==n.shadowSize?n.shadowSize:i.shadowSize.schema.preset,shadowResolution:void 0!==n.shadowResolution?s.B[n.shadowResolution]||0:i.shadowResolution.schema.preset,shadowBlur:void 0!==n.shadowBlur?n.shadowBlur:i.shadowBlur.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value};i.type=r.type,n.shadowEnabled.value&&(i.shadowEnabled=!0,n.shadowSize.isDefault()||(i.shadowSize=n.shadowSize.value),n.shadowBlur.isDefault()||(i.shadowBlur=n.shadowBlur.value),n.shadowResolution.isDefault()||(i.shadowResolution=s.B[n.shadowResolution.value])),e.lights=e.lights||[];const o=e.lights.length;return e.lights.push(i),o}}r.typeName="CVDirectionalLight",r.type="directional",r.text="Directional Light",r.icon="sun"},41282:(e,t,n)=>{"use strict";n.d(t,{f:()=>s.Z});var i,s=n(16967);!function(e){e[e.directional=0]="directional",e[e.point=1]="point",e[e.spot=2]="spot",e[e.ambient=3]="ambient",e[e.hemisphere=4]="hemisphere",e[e.rect=5]="rect"}(i||(i={}))},44466:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(2627),s=n(41029),r=n(1594);class o extends i.Z{constructor(){super(...arguments),this._language=r.PD.EN,this._leadChanged=!1}get title(){return 0===Object.keys(this.data.titles).length&&(this.data.titles[r.k$]=this.data.title),this.data.titles[r.PD[this.language]]||"undefined"}set title(e){this.data.titles[r.PD[this.language]]=e,this.update()}get lead(){return 0===Object.keys(this.data.leads).length&&(this.data.leads[r.k$]=this.data.lead),this.data.leads[r.PD[this.language]]||""}set lead(e){this.data.leads[r.PD[this.language]]=e,this.update()}get tags(){return 0===Object.keys(this.data.taglist).length&&this.data.tags.length>0&&(this.data.taglist[r.k$]=this.data.tags),this.data.taglist[r.PD[this.language]]||[]}set tags(e){this.data.taglist[r.PD[this.language]]=e,this.update()}get language(){return this._language}set language(e){this._language=e}get imageCredit(){return this.data.imageCredit[r.PD[this.language]]||""}set imageCredit(e){this.data.imageCredit[r.PD[this.language]]=e,this.update()}get imageAltText(){return this.data.imageAltText[r.PD[this.language]]||""}set imageAltText(e){this.data.imageAltText[r.PD[this.language]]=e,this.update()}get leadChanged(){return this._leadChanged}set leadChanged(e){this._leadChanged=e}static fromJSON(e){return new o(e)}init(){return{id:i.Z.generateId(),title:"New Annotation",titles:{},lead:"",leads:{},marker:"",tags:[],taglist:{},articleId:"",imageUri:"",imageCredit:{},imageAltText:{},audioId:"",viewId:"",style:s.Z.defaultTypeName,visible:!0,expanded:!1,position:null,direction:null,scale:1,offset:0,tilt:0,azimuth:0,color:[0,.61,.87],zoneIndex:-1}}deflate(e,t){t.id=e.id,Object.keys(this.data.titles).length>0?(t.titles={},Object.keys(this.data.titles).forEach((n=>{t.titles[n]=e.titles[n]}))):e.title&&(t.title=e.title),Object.keys(this.data.leads).length>0?(t.leads={},Object.keys(this.data.leads).forEach((n=>{t.leads[n]=e.leads[n]}))):e.lead&&(t.lead=e.lead),e.marker&&(t.marker=e.marker),Object.keys(this.data.taglist).length>0?(t.taglist={},Object.keys(this.data.taglist).forEach((n=>{t.taglist[n]=e.taglist[n].slice()}))):e.tags.length>0&&(t.tags=e.tags),e.articleId&&(t.articleId=e.articleId),e.imageUri&&(t.imageUri=e.imageUri),e.imageUri&&(t.imageUri=e.imageUri),Object.keys(this.data.imageCredit).length>0&&(t.imageCredit={},Object.keys(this.data.imageCredit).forEach((n=>{t.imageCredit[n]=e.imageCredit[n]}))),Object.keys(this.data.imageAltText).length>0&&(t.imageAltText={},Object.keys(this.data.imageAltText).forEach((n=>{t.imageAltText[n]=e.imageAltText[n]}))),e.audioId&&(t.audioId=e.audioId),e.viewId&&(t.viewId=e.viewId),e.style!==s.Z.defaultTypeName&&(t.style=e.style),!1===e.visible&&(t.visible=e.visible),e.position&&(t.position=e.position.slice()),e.direction&&(t.direction=e.direction.slice()),1!==e.scale&&(t.scale=e.scale),0!==e.offset&&(t.offset=e.offset),0!==e.tilt&&(t.tilt=e.tilt),0!==e.azimuth&&(t.azimuth=e.azimuth);const n=e.color;return!n||0===n[0]&&.61===n[1]&&.87===n[2]||(t.color=n.slice()),e.zoneIndex>-1&&(t.zoneIndex=e.zoneIndex),e}inflate(e,t){t.id=e.id,t.title=e.title||"",t.titles=e.titles||{},t.lead=e.lead||"",t.leads=e.leads||{},t.marker=e.marker||"",t.tags=e.tags||[],t.taglist=e.taglist||{},t.articleId=e.articleId||"",t.imageUri=e.imageUri||"",t.imageCredit=e.imageCredit||{},t.imageAltText=e.imageAltText||{},t.audioId=e.audioId||"",t.viewId=e.viewId||"",t.style=e.style||s.Z.defaultTypeName,t.visible=void 0===e.visible||e.visible,t.expanded=!1,t.position=e.position.slice(),t.direction=e.direction.slice(),t.scale=void 0!==e.scale?e.scale:1,t.offset=e.offset||0,t.tilt=e.tilt||0,t.azimuth=e.azimuth||0,t.color=e.color||o.defaultColor.slice(),t.zoneIndex=void 0!==e.zoneIndex?e.zoneIndex:-1}}o.defaultColor=[0,.61,.87]},38112:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(2627),s=n(1594);class r extends i.Z{constructor(){super(...arguments),this._language=s.PD.EN}static fromJSON(e){return new r(e)}toString(){return this.title}get title(){return 0===Object.keys(this.data.titles).length&&(this.data.titles[s.k$]=this.data.title),this.data.titles[s.PD[this.language]]||"undefined"}set title(e){this.data.titles[s.PD[this.language]]=e,this.update()}get defaultTitle(){return 0===Object.keys(this.data.titles).length&&(this.data.titles[s.k$]=this.data.title),this.data.titles[s.k$]||"undefined"}get uri(){return 0===Object.keys(this.data.uris).length&&(this.data.uris[s.k$]=this.data.uri),this.data.uris[s.PD[this.language]]}set uri(e){this.data.uris[s.PD[this.language]]=e,this.update()}get lead(){return 0===Object.keys(this.data.leads).length&&(this.data.leads[s.k$]=this.data.lead),this.data.leads[s.PD[this.language]]||""}set lead(e){this.data.leads[s.PD[this.language]]=e,this.update()}get tags(){return 0===Object.keys(this.data.taglist).length&&this.data.tags.length>0&&(this.data.taglist[s.k$]=this.data.tags),this.data.taglist[s.PD[this.language]]||[]}set tags(e){this.data.taglist[s.PD[this.language]]=e,this.update()}get language(){return this._language}set language(e){this._language=e}init(){return{id:i.Z.generateId(),title:"New Article",titles:{},lead:"",leads:{},tags:[],taglist:{},uri:"",uris:{},mimeType:"",thumbnailUri:""}}deflate(e,t){t.id=e.id,Object.keys(this.data.uris).length>0?(t.uris={},Object.keys(this.data.uris).forEach((n=>{t.uris[n]=e.uris[n]}))):e.uri&&(t.uri=e.uri),Object.keys(this.data.titles).length>0?(t.titles={},Object.keys(this.data.titles).forEach((n=>{t.titles[n]=e.titles[n]}))):e.title&&(t.title=e.title),Object.keys(this.data.leads).length>0?(t.leads={},Object.keys(this.data.leads).forEach((n=>{t.leads[n]=e.leads[n]}))):e.lead&&(t.lead=e.lead),Object.keys(this.data.taglist).length>0?(t.taglist={},Object.keys(this.data.taglist).forEach((n=>{t.taglist[n]=e.taglist[n].slice()}))):e.tags.length>0&&(t.tags=e.tags.slice()),e.mimeType&&(t.mimeType=e.mimeType),e.thumbnailUri&&(t.thumbnailUri=e.thumbnailUri)}inflate(e,t){t.id=e.id,t.uri=e.uri||"",t.uris=e.uris||{},t.title=e.title||"",t.titles=e.titles||{},t.lead=e.lead||"",t.leads=e.leads||{},t.tags=e.tags||[],t.taglist=e.taglist||{},t.mimeType=e.mimeType||"",t.thumbnailUri=e.thumbnailUri||""}}},38642:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>r,hH:()=>s.hH,xd:()=>s.xd});var i=n(2627),s=n(43875);class r extends i.Z{setModel(e){this.data.uri=e,this.data.type=s.hH.Model,this.data.mimeType=this.guessAssetMimeType()}setGeometry(e){this.data.uri=e,this.data.type=s.hH.Geometry,this.data.mimeType=this.guessAssetMimeType()}setTexture(e,t){this.data.uri=e,this.data.type=s.hH.Image,this.data.mimeType=this.guessAssetMimeType(),this.data.mapType=t}isValid(){return!!this.data.uri&&void 0!==this.data.type}toString(){const e=this.data;return`Asset - type: '${s.hH[e.type]}', uri: '${e.uri}', mime type: '${e.mimeType||"(not set)"}'`}init(){return{uri:"",mimeType:"",type:void 0,mapType:void 0,byteSize:0,numFaces:0,numVertices:0,imageSize:0}}deflate(e,t){t.uri=e.uri,t.type=s.hH[e.type],e.mimeType&&(t.mimeType=e.mimeType),void 0!==e.mapType&&(t.mapType=s.xd[e.mapType]),e.byteSize>0&&(t.byteSize=e.byteSize),e.type!==s.hH.Model&&e.type!==s.hH.Geometry||e.numFaces>0&&(t.numFaces=e.numFaces),e.type!==s.hH.Model&&e.type!==s.hH.Image&&e.type!==s.hH.Texture||e.imageSize>0&&(t.imageSize=e.imageSize)}inflate(e,t){t.uri=e.uri,t.mimeType=e.mimeType||"",t.type=s.hH[e.type],t.mapType=s.xd[e.mapType],t.byteSize=e.byteSize||0,t.numFaces=e.numFaces||0,t.imageSize=e.imageSize||0,void 0===t.type&&(t.type=this.guessAssetType(),void 0===t.type&&console.warn(`failed to determine asset type from asset: ${t.uri}`))}guessAssetType(){const e=this.data;if(void 0!==e.type&&s.hH[e.type])return e.type;if(e.mimeType){if(e.mimeType===r.mimeType.gltfJson||e.mimeType===r.mimeType.gltfBinary)return s.hH.Model;if(e.mimeType===r.mimeType.imageJpeg||e.mimeType===r.mimeType.imagePng)return s.hH.Image}const t=e.uri.split(".").pop().toLowerCase();return"gltf"===t||"glb"===t?s.hH.Model:"obj"===t||"ply"===t?s.hH.Geometry:"jpg"===t||"png"===t?s.hH.Image:void 0}guessAssetMimeType(){const e=this.data;if(e.mimeType)return e.mimeType;const t=e.uri.split(".").pop().toLowerCase();return"gltf"===t?r.mimeType.gltfJson:"glb"===t?r.mimeType.gltfBinary:"jpg"===t?r.mimeType.imageJpeg:"png"===t?r.mimeType.imagePng:""}}r.mimeType={gltfJson:"model/gltf+json",gltfBinary:"model/gltf-binary",imageJpeg:"image/jpeg",imagePng:"image/png"}},37117:(e,t,n)=>{"use strict";n.d(t,{$l:()=>o.$l,ZP:()=>c,_U:()=>o._U,hH:()=>l.hH});var i=n(8035),s=n(79961),r=n(2627),o=n(43875),a=n(10290),l=n(38642);class c extends r.Z{constructor(){super(...arguments),this.model=null}static fromJSON(e){return new c(e)}dispose(){this.unload(),super.dispose()}load(e){if(this.data.usage!==o._U.Web3D)throw new Error("can't load, not a Web3D derivative");const t=this.findAsset(l.hH.Model);if(t)return e.getModel(t.data.uri).then((e=>(this.model&&(0,s.D7)(this.model),this.model=e,e)));const n=this.findAsset(l.hH.Geometry),r=this.findAssets(l.hH.Image);return n?e.getGeometry(n.data.uri).then((t=>(this.model=new i.K(t,new a.Z),Promise.all(r.map((t=>e.getTexture(t.data.uri)))).catch((e=>(console.warn("failed to load texture files"),[])))))).then((e=>{const t=this.model.material;return this.assignTextures(r,e,t),t.map||(t.color.setScalar(.5),t.roughness=.8,t.metalness=0),this.model})):void 0}unload(){this.model&&((0,s.D7)(this.model),this.model=null)}createAsset(e,t){const n=new l.ZP;return n.data.type=e,n.data.uri=t,this.addAsset(n),n}addAsset(e){if(!e.data.uri)throw new Error("uri must be specified");this.data.assets.push(e),this.update()}removeAsset(e){const t=this.data.assets.indexOf(e);t>=0&&this.data.assets.splice(t,1)}findAsset(e){return this.data.assets.find((t=>t.data.type===e))}findAssets(e){return this.data.assets.filter((t=>t.data.type===e))}toString(e=!1){const t=this.data;return e?`Derivative - usage: '${o._U[t.usage]}', quality: '${o.$l[t.quality]}'\n `+t.assets.map((e=>e.toString())).join("\n "):`Derivative - usage: '${o._U[t.usage]}', quality: '${o.$l[t.quality]}', #assets: ${t.assets.length})`}init(){return{usage:o._U.Web3D,quality:o.$l.Medium,assets:[]}}deflate(e,t){t.usage=o._U[e.usage],t.quality=o.$l[e.quality],t.assets=e.assets.map((e=>e.toJSON()))}inflate(e,t){if(t.usage=o._U[e.usage],void 0===t.usage)throw new Error(`unknown derivative usage: ${e.usage}`);if(t.quality=o.$l[e.quality],void 0===t.quality)throw new Error(`unknown derivative quality: ${e.quality}`);t.assets=e.assets.map((e=>new l.ZP(e)))}assignTextures(e,t,n){for(let i=0;i{"use strict";n.d(t,{Z:()=>a});var i=n(90199),s=n(36283),r=n(25864),o=n(31491);class a extends i.Z{get scene(){return this.components.get(s.Z)}get documentProvider(){return this.components.get(r.Z)}get nodeProvider(){return this.components.get(o.Z)}createComponents(){this.createComponent(s.Z,"Master Scene"),this.createComponent(r.Z),this.createComponent(o.Z)}}a.typeName="NVDocuments"},38303:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i=n(90199),s=n(26220),r=n(15271),o=n(18345),a=n(38080),l=n(63872),c=n(68327),h=n(11359),d=n(30242);class u extends i.Z{get pulse(){return this.components.get(s.Z)}get renderer(){return this.components.get(r.Z)}get fullscreen(){return this.components.get(a.Z)}get selection(){return this.components.get(o.Z)}get assetManager(){return this.components.get(l.Z)}get assetReader(){return this.components.get(c.Z)}get analytics(){return this.components.get(h.Z)}get arManager(){return this.components.get(d.Z)}createComponents(){this.createComponent(s.Z),this.createComponent(r.Z),this.createComponent(a.Z),this.createComponent(l.Z),this.createComponent(c.Z),this.createComponent(h.Z),this.createComponent(d.Z);this.createComponent(o.Z).ins.viewportBrackets.setValue(!1)}}u.typeName="NVEngine"},75222:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var i=n(90199),s=n(13227),r=n(27884),o=n(41282),a=n(84678),l=n(3388),c=n(26629),h=n(89167);class d extends i.Z{get transform(){return this.components.get(s.Z)}get meta(){return this.components.get(a.Z,!0)}get model(){return this.components.get(l.Z,!0)}get camera(){return this.components.get(r.Z,!0)}get light(){return this.components.get(o.f,!0)}get scene(){return this.components.get(c.Z,!0)}createComponents(){this.name="Node",this.createComponent(s.Z)}createModel(){this.name="Model",this.createComponent(a.Z),this.createComponent(l.Z)}fromDocument(e,t,n){const i=e.nodes[t];this.transform.fromData(i),n.set(`node/${t}`,this.transform);let s="Node";if(isFinite(i.meta)&&(this.createComponent(a.Z).fromDocument(e,i),n.set(`meta/${i.meta}`,this.meta),s="Meta"),isFinite(i.model)&&(this.createComponent(l.Z).fromDocument(e,i),n.set(`model/${i.model}`,this.model),s="Model"),isFinite(i.camera)&&(this.addTag("controlled"),this.createComponent(r.Z).fromDocument(e,i),n.set(`camera/${i.camera}`,this.camera),s="Camera"),isFinite(i.light)){this.addTag("controlled");const t=e.lights[i.light].type;let r=h.J.find((e=>e.type==t));if(!r)throw new Error(`unknown light type: '${t}'`);this.createComponent(r).fromDocument(e,i),s=r.text,n.set(`light/${i.light}`,this.light)}this.name=i.name||s;const o=i.children;o&&o.forEach((t=>{const i=this.graph.createCustomNode(d);this.transform.addChild(i.transform),i.fromDocument(e,t,n)}))}toDocument(e,t,n){n=n||{meta:!0,setup:!0,model:!0,camera:!0,light:!0},e.nodes=e.nodes||[];const i=e.nodes.length,s=this.transform.toData();e.nodes.push(s),t.set(this.transform,`node/${i}`),this.name&&(s.name=this.name),this.model&&n.model&&(s.model=this.model.toDocument(e,s),t.set(this.model,`model/${s.model}`)),this.camera&&n.camera&&(s.camera=this.camera.toDocument(e,s),t.set(this.camera,`camera/${s.camera}`)),this.light&&n.light&&(s.light=this.light.toDocument(e,s),t.set(this.light,`light/${s.light}`)),this.meta&&n.meta&&(s.meta=this.meta.toDocument(e,s),t.set(this.meta,`info/${s.meta}`));const r=this.transform.children.map((e=>e.node)).filter((e=>e.is(d)));return r.forEach((i=>{if(i.hasNodeComponents(n)){const r=i.toDocument(e,t,n);s.children=s.children||[],s.children.push(r)}})),i}hasNodeComponents(e){if(!e)return!0;const t=this.transform,n=this.components;return!(!e.model||!n.has(l.Z)&&!t.hasChildComponents(l.Z,!0))||(!(!e.camera||!n.has(r.Z)&&!t.hasChildComponents(r.Z,!0))||!(!e.light||!n.has(o.f)&&!t.hasChildComponents(o.f,!0)))}}d.typeName="NVNode"},82567:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(75222),s=n(26629),r=n(79815),o=n(84678);class a extends i.Z{get setup(){return this.components.get(r.Z,!0)}createComponents(){this.createComponent(s.Z),this.createComponent(r.Z),this.createComponent(o.Z)}fromDocument(e,t,n){const s=e.scenes[t];s.name&&(this.name=s.name),this.scene.fromDocument(e,s),isFinite(s.meta)&&(this.meta.fromDocument(e,s),n.set(`meta/${s.meta}`,this.meta)),isFinite(s.setup)&&this.setup.fromDocument(e,t,n);const r=s.nodes;if(r&&r.forEach((t=>{const s=this.graph.createCustomNode(i.Z);this.transform.addChild(s.transform),s.fromDocument(e,t,n)})),isFinite(s.setup)){const t=e.setups[s.setup];t.snapshots&&this.setup.snapshots.fromData(t.snapshots,n)}}toDocument(e,t,n){e.scenes=e.scenes||[];const s=e.scenes.length,r={units:"cm"};e.scenes.push(r),this.name&&(r.name=this.name),this.scene.toDocument(e,r);return this.transform.children.map((e=>e.node)).filter((e=>e.is(i.Z))).forEach((i=>{if(i.hasNodeComponents(n)){const s=i.toDocument(e,t,n);r.nodes=r.nodes||[],r.nodes.push(s)}})),n&&!n.setup||(this.meta&&(r.meta=this.meta.toDocument(e,r),t.set(this.meta,`meta/${r.meta}`)),this.setup&&this.setup.toDocument(e,s,t)),s}}a.typeName="NVScene"},1594:(e,t,n)=>{"use strict";var i,s,r;n.d(t,{PD:()=>s,f_:()=>i,k$:()=>o,oS:()=>r}),function(e){e[e.mm=0]="mm",e[e.cm=1]="cm",e[e.m=2]="m",e[e.km=3]="km",e[e.in=4]="in",e[e.ft=5]="ft",e[e.yd=6]="yd",e[e.mi=7]="mi"}(i||(i={})),function(e){e[e.EN=0]="EN",e[e.ES=1]="ES",e[e.DE=2]="DE",e[e.NL=3]="NL",e[e.JA=4]="JA",e[e.FR=5]="FR",e[e.HAW=6]="HAW"}(s||(s={})),function(e){e.EN="English",e.ES="Spanish (Español)",e.DE="German (Deutsch)",e.NL="Dutch (Nederlands)",e.JA="Japanese (日本語)",e.FR="French (Français)",e.HAW="Hawaiian (ʻŌlelo Hawaiʻi)"}(r||(r={}));const o="EN"},43875:(e,t,n)=>{"use strict";n.d(t,{$l:()=>s,_U:()=>i,f_:()=>l.f_,hH:()=>r,id:()=>a,xd:()=>o});var i,s,r,o,a,l=n(1594);!function(e){e[e.Image2D=0]="Image2D",e[e.Web3D=1]="Web3D",e[e.App3D=2]="App3D",e[e.iOSApp3D=3]="iOSApp3D",e[e.Print3D=4]="Print3D",e[e.Editorial3D=5]="Editorial3D"}(i||(i={})),function(e){e[e.Thumb=0]="Thumb",e[e.Low=1]="Low",e[e.Medium=2]="Medium",e[e.High=3]="High",e[e.Highest=4]="Highest",e[e.AR=5]="AR"}(s||(s={})),function(e){e[e.Model=0]="Model",e[e.Geometry=1]="Geometry",e[e.Image=2]="Image",e[e.Texture=3]="Texture",e[e.Points=4]="Points",e[e.Volume=5]="Volume"}(r||(r={})),function(e){e[e.Color=0]="Color",e[e.Emissive=1]="Emissive",e[e.Occlusion=2]="Occlusion",e[e.Normal=3]="Normal",e[e.MetallicRoughness=4]="MetallicRoughness",e[e.Zone=5]="Zone"}(o||(o={})),function(e){e[e.Front=0]="Front",e[e.Back=1]="Back",e[e.Double=2]="Double"}(a||(a={}))},60206:(e,t,n)=>{"use strict";var i,s,r,o,a;n.d(t,{fi:()=>a,pH:()=>i,u6:()=>s,we:()=>o}),function(e){e[e.Default=0]="Default",e[e.Clay=1]="Clay",e[e.XRay=2]="XRay",e[e.Normals=3]="Normals",e[e.Wireframe=4]="Wireframe"}(i||(i={})),function(e){e[e.Solid=0]="Solid",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient"}(s||(s={})),function(e){e[e.Orbit=0]="Orbit",e[e.Walk=1]="Walk"}(r||(r={})),function(e){e[e.Overlay=0]="Overlay",e[e.Left=1]="Left",e[e.Right=2]="Right"}(o||(o={})),function(e){e[e.X=0]="X",e[e.Y=1]="Y",e[e.Z=2]="Z"}(a||(a={}))},10290:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p,p:()=>h.pH});var i=n(6965),s=n(93113),r=n(75544),o=n(8173),a=n(17393),l=n(19588),c=n(84538),h=n(60206);const d=n(8669).Z,u=n(9849).Z;class p extends i.W{constructor(e){super(),this._clayColor=new s.I("#a67a6c").convertLinearToSRGB(),this._wireColor=new s.I("#004966").convertLinearToSRGB(),this._wireEmissiveColor=new s.I("#004966").convertLinearToSRGB(),this._objectSpaceNormalMap=!1,this._paramCopy={},this._sideCopy=r.Wl3,this.type="UberPBRMaterial",this.isUberPBRMaterial=!0,this.isMeshStandardMaterial=!0,this.isMeshPhysicalMaterial=!1,this.defines={STANDARD:!0,PHYSICAL:!1,OBJECTSPACE_NORMALMAP:!1,MODE_NORMALS:!1,MODE_XRAY:!1,CUT_PLANE:!1,USE_ZONEMAP:!1},this.uniforms=o.rD.merge([a.V.standard.uniforms,{aoMapMix:{value:new l.P(.25,.25,.25)},cutPlaneDirection:{value:new c.L(0,0,-1,0)},cutPlaneColor:{value:new l.P(1,0,0)},zoneMap:{value:null}}]),this._aoMapMix=this.uniforms.aoMapMix.value,this._cutPlaneDirection=this.uniforms.cutPlaneDirection.value,this._cutPlaneColor=this.uniforms.cutPlaneColor.value,this._zoneMap=this.uniforms.zoneMap.value,this.vertexShader=u,this.fragmentShader=d,this.color=new s.I(16777215),this.roughness=.7,this.metalness=0,e&&this.setValues(e)}set cutPlaneDirection(e){this._cutPlaneDirection.copy(e)}get cutPlaneDirection(){return this._cutPlaneDirection}set cutPlaneColor(e){this._cutPlaneColor.copy(e)}get cutPlaneColor(){return this._cutPlaneColor}set aoMapMix(e){this._aoMapMix.copy(e)}get aoMapMix(){return this._aoMapMix}set zoneMap(e){this._zoneMap=e,this.uniforms.zoneMap.value=e,this.needsUpdate=!0}get zoneMap(){return this._zoneMap}setShaderMode(e){switch(Object.assign(this,this._paramCopy),this.defines.MODE_NORMALS=!1,this.defines.MODE_XRAY=!1,this.defines.OBJECTSPACE_NORMALMAP=!(!this.normalMap||!this._objectSpaceNormalMap),this.side=this.defines.CUT_PLANE?r.ehD:this.side,this.needsUpdate=!0,e){case h.pH.Clay:this._paramCopy={color:this.color,map:this.map,roughness:this.roughness,metalness:this.metalness,aoMapIntensity:this.aoMapIntensity,blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite},this.color=this._clayColor,this.map=null,this.roughness=1,this.metalness=0,this.aoMapIntensity*=1,this.blending=r.jFi,this.transparent=!1,this.depthWrite=!0;break;case h.pH.Normals:this._paramCopy={blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite},this.defines.MODE_NORMALS=!0,this.blending=r.jFi,this.transparent=!1,this.depthWrite=!0;break;case h.pH.XRay:this._paramCopy={side:this.side,blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite},this.defines.MODE_XRAY=!0,this.side=r.ehD,this.blending=r.WMw,this.transparent=!0,this.depthWrite=!1;break;case h.pH.Wireframe:this._paramCopy={color:this.color,emissive:this.emissive,roughness:this.roughness,metalness:this.metalness,wireframe:this.wireframe,map:this.map,aoMap:this.aoMap,emissiveMap:this.emissiveMap,normalMap:this.normalMap},this.color=this._wireColor,this.emissive=this._wireEmissiveColor,this.roughness=.8,this.metalness=.1,this.wireframe=!0,this.map=null,this.aoMap=null,this.emissiveMap=null,this.normalMap=null,this.defines.OBJECTSPACE_NORMALMAP=!1}}enableCutPlane(e){this.defines.CUT_PLANE=e,e?(this._sideCopy=this.side,this.side=r.ehD):this.side=this._sideCopy}enableObjectSpaceNormalMap(e){e!==this._objectSpaceNormalMap&&(this._objectSpaceNormalMap=e),this.normalMap&&(this.normalMapType=r.PA7,this.needsUpdate=!0)}enableZoneMap(e){this.defines.USE_ZONEMAP=e}}},97010:(e,t,n)=>{"use strict";var i=n(51120),s=(n(98595),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let r=class extends i.ZP{constructor(){super(...arguments),this.property=null,this.name="",this.text=null,this.language=null,this.disabled=!1,this.customLabelStyle=""}firstConnected(){this.classList.add("sv-property","sv-property-boolean")}update(e){if(!this.property)throw new Error("missing property attribute");if("boolean"!==this.property.type)throw new Error("not a boolean property");if(e.has("property")){const t=e.get("property");t&&t.off("value",this.onUpdate,this),this.property&&this.property.on("value",this.onUpdate,this)}super.update(e)}render(){const e=this.property,t=this.name||e.name,n=t.replace(/\s/g,""),s=this.text,r=this.language,o=this.customLabelStyle;let a=e.value?Array.isArray(s)?s[1]:s||"On":Array.isArray(s)?s[0]:s||"Off";return i.dy` -
`}onButtonClick(e){this.property.setValue(!this.property.value)}};s([(0,i.Cb)({attribute:!1})],r.prototype,"property",void 0),s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({attribute:!1})],r.prototype,"text",void 0),s([(0,i.Cb)({attribute:!1})],r.prototype,"language",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"disabled",void 0),s([(0,i.Cb)({type:String})],r.prototype,"customLabelStyle",void 0),r=s([(0,i.Mo)("sv-property-boolean")],r)},46436:(e,t,n)=>{"use strict";var i=n(47855),s=n(51120),r=(n(98595),n(34834),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let o=class extends s.ZP{constructor(){super(),this.property=null,this.name="",this.color=new i.ZP}firstConnected(){super.firstConnected(),this.classList.add("sv-property","sv-property-color")}update(e){if(!this.property)throw new Error("missing property attribute");if("number"!==this.property.type||3!==this.property.elementCount)throw new Error(`not an color property: '${this.property.path}'`);if(e.has("property")){const t=e.get("property");t&&t.off("value",this.onPropertyChange,this),this.property&&(this.property.on("value",this.onPropertyChange,this),this.color.fromArray(this.property.value))}super.update(e)}render(){const e=this.property,t=this.name||e.name,n=this.color.toString();return s.dy` - - `}onColorChange(e){this.color=new i.ZP(e.target.value),this.property.setValue(this.color.toRGBArray())}onPropertyChange(e){this.color.fromArray(e),this.requestUpdate()}};r([(0,s.Cb)({attribute:!1})],o.prototype,"property",void 0),r([(0,s.Cb)({type:String})],o.prototype,"name",void 0),o=r([(0,s.Mo)("sv-property-color")],o)},85203:(e,t,n)=>{"use strict";var i=n(51120),s=(n(98595),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let r=class extends i.ZP{constructor(){super(...arguments),this.property=null,this.name="",this.text="",this.icon=""}firstConnected(){this.classList.add("sv-property","sv-property-event")}update(e){if(!this.property)throw new Error("missing property attribute");if(!this.property.schema.event)throw new Error(`not an event property: '${this.property.path}'`);if(e.has("property")){const t=e.get("property");t&&t.off("value",this.onUpdate,this),this.property&&this.property.on("value",this.onUpdate,this)}super.update(e)}render(){const e=this.property,t=this.name||e.name,n=this.text,s=this.icon;return i.dy` -
- -
`}onButtonClick(e){this.property.set()}};s([(0,i.Cb)({attribute:!1})],r.prototype,"property",void 0),s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({type:String})],r.prototype,"text",void 0),s([(0,i.Cb)({type:String})],r.prototype,"icon",void 0),r=s([(0,i.Mo)("sv-property-event")],r)},18257:(e,t,n)=>{"use strict";var i=n(53868);const s=(0,i.XM)((e=>t=>{let n;if(t instanceof i.K1||t instanceof i.nt)throw new Error("The `live` directive is not allowed on text or event bindings");if(t instanceof i.JG)r(t.strings),n=t.element.hasAttribute(t.name),t.value=n;else{const{element:s,name:o,strings:a}=t.committer;if(r(a),t instanceof i.sL){if(n=s[o],n===e)return}else t instanceof i._l&&(n=s.getAttribute(o));if(n===String(e))return}t.setValue(e)})),r=e=>{if(2!==e.length||""!==e[0]||""!==e[1])throw new Error("`live` bindings can only contain a single expression")};var o=n(51120),a=(n(98595),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let l=class extends o.ZP{constructor(){super(...arguments),this.property=null,this.name="",this.options=null,this.indexMap=null,this.language=null,this.dropdown=!1}firstConnected(){this.classList.add("sv-property","sv-property-options")}update(e){if(!this.property)throw new Error("missing property attribute");if("number"!==this.property.type||!this.property.schema.options)throw new Error("not an options property");if(e.has("property")){const t=e.get("property");t&&(t.off("value",this.onUpdate,this),t.off("change",this.onUpdate,this)),this.property&&(this.property.on("value",this.onUpdate,this),this.property.on("change",this.onUpdate,this))}super.update(e)}render(){return this.dropdown?this.renderDropdown():this.renderButtons()}renderDropdown(){const e=this.property,t=this.indexMap,n=this.name||e.name,i=this.options||e.schema.options,r=e.value,a=this.language;let l;return l=t?t.map((e=>o.dy``)):i.map(((e,t)=>e?o.dy``:null)),o.dy` - - - `}renderButtons(){const e=this.property,t=this.indexMap,n=this.name||e.name,i=this.options||e.schema.options,s=(e.value,this.language);let r;return r=t?t.map((e=>o.dy` - `)):i.map(((e,t)=>e?o.dy` - `:null)),o.dy` - -
this.onKeyDown(e)} title=${n} class="sv-options"> - ${r} -
`}isSelected(e){return this.property.isMulti()?this.property.value.includes(e):this.property.value==e}onButtonClick(e){const t=e.target.index;if(this.property.isMulti()){let e=this.property.value.slice();-1!==e.indexOf(t)?e=e.filter((e=>e!==t)):e.push(t),this.property.setValue(e)}else this.property.setValue(t)}onKeyDown(e){if("ArrowUp"===e.code||"ArrowLeft"===e.code){const t=this.getElementsByTagName("ff-button"),n=Array.from(t).findIndex((t=>e.target===t));n>0&&(t[n].setAttribute("tabIndex","-1"),t[n-1].setAttribute("tabIndex","0"),t[n-1].focus())}else if("ArrowDown"===e.code||"ArrowRight"===e.code){const t=this.getElementsByTagName("ff-button"),n=Array.from(t).findIndex((t=>e.target===t));n0===e.tabIndex)),0)].focus()}tabReset(e){const t=this.getElementsByTagName("ff-button"),n=Array.from(t),i=n.findIndex((e=>0===e.tabIndex)),s=n.findIndex((e=>"true"===e.getAttribute("aria-checked")));if(i!=s){t[i].setAttribute("tabIndex","-1");t[s>-1?s:0].setAttribute("tabIndex","0")}}};a([(0,o.Cb)({attribute:!1})],l.prototype,"property",void 0),a([(0,o.Cb)({type:String})],l.prototype,"name",void 0),a([(0,o.Cb)({attribute:!1})],l.prototype,"options",void 0),a([(0,o.Cb)({attribute:!1})],l.prototype,"indexMap",void 0),a([(0,o.Cb)({attribute:!1})],l.prototype,"language",void 0),a([(0,o.Cb)({type:Boolean,reflect:!0})],l.prototype,"dropdown",void 0),l=a([(0,o.Mo)("sv-property-options")],l)},90470:(e,t,n)=>{"use strict";var i=n(51120),s=(n(61497),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let r=class extends i.ZP{constructor(){super(...arguments),this.property=null,this.name="",this.min=void 0,this.max=void 0}firstConnected(){super.firstConnected(),this.classList.add("sv-property","sv-property-slider")}update(e){if(!this.property)throw new Error("missing property attribute");if("number"!==this.property.type)throw new Error(`not a number property: '${this.property.path}'`);if(e.has("property")){const t=e.get("property");t&&t.off("value",this.onUpdate,this),this.property&&this.property.on("value",this.onUpdate,this)}super.update(e)}render(){const e=this.property,t=this.name||e.name,n=e.getValidatedValue(),s=isFinite(this.min)?this.min:e.schema.min,r=isFinite(this.max)?this.max:e.schema.max,o=(n-s)/(r-s);return i.dy` - `}onSliderChange(e){const t=this.property,n=isFinite(this.min)?this.min:t.schema.min,i=isFinite(this.max)?this.max:t.schema.max,s=n+e.detail.value*(i-n);t.setValue(s)}onKeyDown(e){const t=this.property;"ArrowRight"===e.code||"ArrowUp"===e.code||"PageUp"===e.code?t.setValue(this.clamp("PageUp"===e.code?t.value+.1:t.value+.01)):"ArrowLeft"!==e.code&&"ArrowDown"!==e.code&&"PageDown"!==e.code||t.setValue(this.clamp("PageDown"===e.code?t.value-.1:t.value-.01))}clamp(e){const t=this.property,n=isFinite(this.min)?this.min:t.schema.min,i=isFinite(this.max)?this.max:t.schema.max;return Math.min(Math.max(e,n),i)}};s([(0,i.Cb)({attribute:!1})],r.prototype,"property",void 0),s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"min",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"max",void 0),r=s([(0,i.Mo)("sv-property-slider")],r)},77804:(e,t,n)=>{"use strict";var i=n(51120),s=(n(98595),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let r=class extends i.ZP{constructor(){super(...arguments),this.property=null,this.name="",this.onChange=e=>{const t=e.target.value;this.property.setValue(t)}}firstConnected(){this.classList.add("sv-property","sv-property-string")}update(e){if(!this.property)throw new Error("missing property attribute");if("string"!==this.property.type)throw new Error(`not a string property: '${this.property.path}'`);if(e.has("property")){const t=e.get("property");t&&t.off("value",this.onUpdate,this),this.property&&this.property.on("value",this.onUpdate,this)}super.update(e)}render(){const e=this.property,t=this.name||e.name,n=e.value;return i.dy`${t?i.dy``:null} - {e.target.select()}}} - @keypress=${e=>{"Enter"===e.key&&e.target.blur()}} - > - `}};s([(0,i.Cb)({attribute:!1})],r.prototype,"property",void 0),s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),r=s([(0,i.Mo)("sv-property-string")],r)},47425:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>i.Mo,ZP:()=>o,dy:()=>i.dy});var i=n(51120),s=n(67695),r=n(25864);class o extends s.ZP{constructor(){super(...arguments),this.activeDocument=null}get documentProvider(){return this.system.getMainComponent(r.Z)}connected(){const e=this.documentProvider;e.on("active-component",this.onActiveDocumentEvent,this);const t=e.activeComponent;t&&(this.activeDocument=t,this.onActiveDocument(null,t))}disconnected(){this.documentProvider.off("active-component",this.onActiveDocumentEvent,this);const e=this.activeDocument;e&&(this.activeDocument=null,this.onActiveDocument(e,null))}onActiveDocument(e,t){}onActiveDocumentEvent(e){this.activeDocument=e.next,this.onActiveDocument(e.previous,e.next)}}},94860:(e,t,n)=>{"use strict";n.d(t,{Z:()=>qe});var i=n(38080),s=n(30242),r=n(27643),o=n(51120),a=n(1239),l=n(10564),c=n(13772),h=n(25976),d=n(60206),u=n(11359),p=n(63872);class m{constructor(e){this.next=null,this.activePositions=[],this.activeType="",this.centerX=0,this.centerY=0,this.startX=0,this.startY=0,this.isDragging=!1,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUpOrCancel=this.onPointerUpOrCancel.bind(this),this.onDoubleClick=this.onDoubleClick.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.onWheel=this.onWheel.bind(this),this.onKeyDown=this.onKeyDown.bind(this),e&&(e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUpOrCancel),e.addEventListener("pointercancel",this.onPointerUpOrCancel),e.addEventListener("contextmenu",this.onContextMenu),e.addEventListener("wheel",this.onWheel),e.addEventListener("keydown",this.onKeyDown))}onPointerDown(e){if(this.activeType&&e.pointerType!==this.activeType)return;0===this.activePositions.length&&(this.startX=e.clientX,this.startY=e.clientY,this.isDragging=!1),this.activeType=e.pointerType,this.activePositions.push({id:e.pointerId,clientX:e.clientX,clientY:e.clientY});const t=this.createManipPointerEvent(e,"pointer-down");this.sendPointerEvent(t)&&e.stopPropagation()}onPointerMove(e){const t=this.activePositions;for(let n=0,i=t.length;n0&&!this.isDragging){Math.abs(e.clientX-this.startX)+Math.abs(e.clientY-this.startY)>4&&(this.isDragging=!0)}const n=t.length?"pointer-move":"pointer-hover",i=this.createManipPointerEvent(e,n);this.sendPointerEvent(i)&&e.stopPropagation()}onPointerUpOrCancel(e){const t=this.activePositions;let n=!1;for(let i=0,s=t.length;i0){for(let e=0;e=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});!function(e){e[e.Single=0]="Single",e[e.HorizontalSplit=1]="HorizontalSplit",e[e.VerticalSplit=2]="VerticalSplit",e[e.Quad=3]="Quad"}(f||(f={}));let b=class extends o.ZP{constructor(){super(...arguments),this.layout=f.Single,this.horizontalPosition=.5,this.verticalPosition=.5}firstConnected(){this.classList.add("ff-quad-splitter")}render(){const e=this.layout;if(e===f.Single)return o.dy``;const t=[];return e!==f.HorizontalSplit&&e!==f.Quad||t.push(o.dy` -
-
- -
-
- `),e!==f.VerticalSplit&&e!==f.Quad||t.push(o.dy` -
-
- -
-
- `),o.dy`${t}`}onSplitterChange(e){"horizontal"===e.detail.direction?this.horizontalPosition=e.detail.position:this.verticalPosition=e.detail.position,this.onChange&&this.onChange({layout:this.layout,horizontalSplit:this.horizontalPosition,verticalSplit:this.verticalPosition,isDragging:e.detail.isDragging})}};y([(0,o.Cb)({attribute:!1})],b.prototype,"layout",void 0),y([(0,o.Cb)({attribute:!1})],b.prototype,"horizontalPosition",void 0),y([(0,o.Cb)({attribute:!1})],b.prototype,"verticalPosition",void 0),b=y([(0,o.Mo)("ff-quad-splitter")],b);const _=b;var x=n(25864),w=n(44661),S=n(79815),M=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let E=class extends v.ZP{constructor(e){super(e),this.view=null,this.canvas=null,this.overlay=null,this.srAnnouncement=null,this.splitter=null,this.resizeObserver=null,this.pointerEventsEnabled=!1,this.measuring=!1,this.onPointerUpOrCancel=this.onPointerUpOrCancel.bind(this),this.manipTarget=new m,this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointermove",this.manipTarget.onPointerMove),this.addEventListener("pointerup",this.onPointerUpOrCancel),this.addEventListener("pointercancel",this.onPointerUpOrCancel),this.ownerDocument.addEventListener("pointermove",this.manipTarget.onPointerMove),this.ownerDocument.addEventListener("pointerup",this.onPointerUpOrCancel),this.ownerDocument.addEventListener("pointercancel",this.onPointerUpOrCancel),this.addEventListener("wheel",this.manipTarget.onWheel),this.addEventListener("contextmenu",this.manipTarget.onContextMenu),this.addEventListener("keydown",this.manipTarget.onKeyDown),this.pointerEventsEnabled=!0}getView(){return this.view}firstConnected(){this.classList.add("sv-scene-view"),this.style.touchAction="none",this.setAttribute("touch-action","none"),this.tabIndex=0,this.id="sv-scene",this.ariaLabel="Interactive 3D Model. Use mouse, touch, or arrow keys to rotate.",this.setAttribute("role","application"),this.srAnnouncement=this.appendElement("div"),this.srAnnouncement.classList.add("sr-only"),this.srAnnouncement.setAttribute("aria-live","polite"),this.canvas=this.appendElement("canvas",{display:"block",width:"100%",height:"100%"}),this.overlay=this.appendElement("div",{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",overflow:"hidden"}),this.overlay.classList.add("sv-content-overlay"),this.splitter=this.appendElement(_,{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",overflow:"hidden"}),this.splitter.onChange=e=>{this.view.horizontalSplit=e.horizontalSplit,this.view.verticalSplit=e.verticalSplit},this.view=new g.Z(this.system,this.canvas,this.overlay),this.view.on("layout",(e=>{this.splitter.layout=e.layout,this.dispatchEvent(new CustomEvent("layout"))})),this.view.layout=f.Single,this.splitter.layout=f.Single,this.manipTarget.next=this.view}connected(){this.view.attach(),this.resizeObserver||(this.resizeObserver=new ResizeObserver((()=>this.view.resize()))),this.resizeObserver.observe(this.view.renderer.domElement),this.system.getMainComponent(x.Z).activeComponent.setup.navigation.ins.pointerEnabled.on("value",this.enablePointerEvents,this),this.system.getComponent(w.ZP).ins.keyNavActive.on("value",this.onKeyboardNavigation,this),this.system.getComponent(S.Z).tape.ins.enabled.on("value",this.onMeasure,this)}disconnected(){this.resizeObserver.disconnect(),this.system.getComponent(S.Z).tape.ins.enabled.off("value",this.onMeasure,this),this.system.getComponent(w.ZP).ins.keyNavActive.off("value",this.onKeyboardNavigation,this),this.system.getMainComponent(x.Z).activeComponent.setup.navigation.ins.pointerEnabled.off("value",this.enablePointerEvents,this),this.view.detach()}enablePointerEvents(){const e=this.system.getMainComponent(x.Z).activeComponent.setup.navigation.ins.pointerEnabled.value;e&&!this.pointerEventsEnabled?(this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointermove",this.manipTarget.onPointerMove),this.addEventListener("pointerup",this.onPointerUpOrCancel),this.addEventListener("pointercancel",this.onPointerUpOrCancel),this.ownerDocument.addEventListener("pointermove",this.manipTarget.onPointerMove),this.ownerDocument.addEventListener("pointerup",this.onPointerUpOrCancel),this.ownerDocument.addEventListener("pointercancel",this.onPointerUpOrCancel),this.addEventListener("wheel",this.manipTarget.onWheel),this.addEventListener("contextmenu",this.manipTarget.onContextMenu),this.addEventListener("keydown",this.manipTarget.onKeyDown),this.style.touchAction="none",this.setAttribute("touch-action","none"),this.pointerEventsEnabled=!0):!e&&this.pointerEventsEnabled&&(this.removeEventListener("pointerdown",this.onPointerDown),this.removeEventListener("pointermove",this.manipTarget.onPointerMove),this.removeEventListener("pointerup",this.onPointerUpOrCancel),this.removeEventListener("pointercancel",this.onPointerUpOrCancel),this.ownerDocument.removeEventListener("pointermove",this.manipTarget.onPointerMove),this.ownerDocument.removeEventListener("pointerup",this.onPointerUpOrCancel),this.ownerDocument.removeEventListener("pointercancel",this.onPointerUpOrCancel),this.removeEventListener("wheel",this.manipTarget.onWheel),this.removeEventListener("contextmenu",this.manipTarget.onContextMenu),this.removeEventListener("keydown",this.manipTarget.onKeyDown),this.style.touchAction="auto",this.setAttribute("touch-action","auto"),this.pointerEventsEnabled=!1,this.style.cursor="default")}onPointerDown(e){this.pointerEventsEnabled&&(this.style.cursor="default"==this.style.cursor?"default":"grabbing",this.manipTarget.onPointerDown(e))}onPointerUpOrCancel(e){this.pointerEventsEnabled&&(this.style.cursor="default"==this.style.cursor?"default":"grab",this.manipTarget.onPointerUpOrCancel(e))}onKeyboardNavigation(){const e=this.system.getComponent(w.ZP).ins;switch(e.keyNavActive.value){case w.dT.Orbit:this.srAnnouncement.textContent="Orbit "+e.orbit.value[0].toFixed(0)+", "+e.orbit.value[1].toFixed(0)+", "+e.orbit.value[2].toFixed(0);break;case w.dT.Pan:case w.dT.Zoom:this.srAnnouncement.textContent="Offset "+e.offset.value[0].toFixed(0)+", "+e.offset.value[1].toFixed(0)+", "+e.offset.value[2].toFixed(0)}}onMeasure(){this.measuring=this.system.getComponent(S.Z).tape.ins.enabled.value,this.style.cursor=this.measuring?"default":"grab"}};E=M([(0,v.Mo)("sv-scene-view")],E);const T=E;var C,A=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let P=C=class extends o.ZP{constructor(){super(...arguments),this.visible=!1,this.assetPath=""}firstConnected(){super.firstConnected(),this.classList.add("sv-spinner")}render(){const e=o.dy`
- ${C.template} -
`;return this.style.visibility=this.visible?"visible":"hidden",e}};P.template=o.dy`
`,A([(0,o.Cb)({type:Boolean})],P.prototype,"visible",void 0),A([(0,o.Cb)({type:String})],P.prototype,"assetPath",void 0),P=C=A([(0,o.Mo)("sv-spinner")],P);var R,L=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let N=R=class extends o.ZP{firstConnected(){super.firstConnected(),this.classList.add("sv-action-prompt")}render(){return o.dy`
${R.icon}
`}};N.icon=o.dy``,N=R=L([(0,o.Mo)("sv-action-prompt")],N);var D=n(98595),I=n(47425),O=n(53310),U=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let k=class extends I.ZP{constructor(){super(...arguments),this.reader=null,this.tours=null,this.language=null,this.firstRender=!0}firstConnected(){super.firstConnected(),this.classList.add("sv-reader-view")}renderMenuEntry(e,t){const n=e.article;return I.dy`
this.onKeyDown(e,n.id)} class="sv-entry" @click=${e=>this.onClickArticle(e,n.id)}> -
-

${n.title}

- -
-

${n.lead}

-
`}render(){const e=this.reader,t=this.language;this.tours;if(!e)return I.dy`
Please select a document to display its articles.
`;const n=this.tours.ins.enabled.value?null:I.dy``;if(!e.activeArticle){const n=e.articles;return I.dy`
- - ${n.map(((e,t)=>this.renderMenuEntry(e,t)))} -
`}return I.dy`
this.onKeyDown(t,e.activeArticle.id)} > - - ${n} -
-
`}onClickMenu(e){e.stopPropagation(),this.reader.ins.articleId.setValue(""),this.reader.ins.focus.setValue(!0)}onClickClose(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("close"))}onClickArticle(e,t){this.reader.ins.articleId.setValue(t)}updated(e){super.updated(e);const t=this.reader;if(t){if(t.activeArticle){const e=this.getElementsByClassName("sv-container").item(0);e.innerHTML=t.outs.content.value,this.firstRender&&(setTimeout((()=>{e.insertAdjacentHTML("beforeend","
-end of article-
")}),200),this.firstRender=!1)}t.ins.focus.value&&(this.setFocus(),t.ins.focus.setValue(!1,!0))}}onActiveDocument(e,t){e&&(e.setup.language.outs.language.off("value",this.onUpdate,this),this.reader.outs.content.off("value",this.onUpdate,this),this.reader.outs.article.off("value",this.onUpdate,this),this.tours=null,this.language=null,this.reader=null),t&&(this.reader=t.setup.reader,this.language=t.setup.language,this.tours=t.setup.tours,this.reader.outs.content.on("value",this.onUpdate,this),this.reader.outs.article.on("value",this.onUpdate,this),t.setup.language.outs.language.on("value",this.onUpdate,this))}onKeyDown(e,t){const n=this.reader;if("Space"!==e.code&&"Enter"!==e.code||!n||n.activeArticle){if("Escape"===e.code)e.preventDefault(),n.activeArticle?(n.ins.articleId.setValue(""),n.ins.focus.setValue(!0)):this.dispatchEvent(new CustomEvent("close"));else if("Tab"===e.code)(0,O.e)((0,O.G)(this),e);else if(("ArrowUp"===e.code||"ArrowDown"===e.code)&&n&&!n.activeArticle){const t=e.target instanceof Element?e.target:null;if(t){const n="ArrowUp"===e.code?t.previousElementSibling:t.nextElementSibling;n&&(t.setAttribute("tabIndex","-1"),n.setAttribute("tabIndex","0"),n.focus())}}}else e.preventDefault(),this.reader.ins.articleId.setValue(t),this.reader.ins.focus.setValue(!0)}setFocus(){(this.reader.activeArticle?this.getElementsByClassName("sv-nav-button").item(1):this.getElementsByClassName("sv-entry").item(0)).focus()}};k=U([(0,I.Mo)("sv-reader-view")],k);var V=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let z=class extends I.ZP{constructor(){super(...arguments),this.audioManager=null,this.documentProps=new h.Z("value",this.onUpdate,this)}firstConnected(){super.firstConnected(),this.classList.add("sv-caption-view")}render(){const e=this.audioManager,t=e.ins.activeCaption.value,n=e.ins.captionsEnabled.value;return t.length>0&&n?I.dy`
${t}
`:null}onActiveDocument(e,t){if(e&&this.documentProps.off(),t){const e=t.setup;this.audioManager=t.setup.audio,this.documentProps.on(e.audio.ins.captionsEnabled,e.audio.ins.activeCaption)}this.requestUpdate()}};z=V([(0,I.Mo)("sv-caption-view")],z);const F=z;var B=n(15271),$=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let j=class extends I.ZP{get arManager(){return this.system.getMainComponent(s.Z)}firstConnected(){super.firstConnected()}render(){const e=this.arManager,t=e.outs,n=!0===e.ins.wallMount.value?"a wall":"the floor";return!t.isPlaced.value&&t.isPresenting.value?I.dy`
-
-
- Point your device at ${n} and move it around to place your Smithsonian object!

**BETA** -
-
`:null}onActiveDocument(e,t){e&&(this.arManager.outs.isPlaced.off("value",this.onUpdate,this),this.arManager.outs.isPresenting.off("value",this.onUpdate,this)),t&&(this.arManager.outs.isPlaced.on("value",this.onUpdate,this),this.arManager.outs.isPresenting.on("value",this.onUpdate,this)),this.requestUpdate()}};j=$([(0,I.Mo)("sv-ar-prompt-container")],j);const H=j;var G=n(51462),Z=n(26629),W=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let q=class extends I.ZP{constructor(){super(...arguments),this.documentProps=new h.Z("value",this.onUpdate,this),this.shareButtonSelected=!1}get analytics(){return this.system.getMainComponent(u.Z)}get arManager(){return this.system.getMainComponent(s.Z)}get sceneNode(){return this.system.getComponent(Z.Z)}firstConnected(){super.firstConnected(),this.classList.add("sv-ar-menu-container")}connected(){super.connected()}disconnected(){super.disconnected()}render(){const e=this.activeDocument;if(!e)return I.dy``;const t=this.arManager.outs,n=e.setup,i=this.sceneNode.getGraphComponents(G.Z).some((e=>e.hasAnnotations)),s=n.viewer.ins.annotationsVisible.value,r=n.audio.outs.narrationEnabled.value,o=n.audio.outs.narrationPlaying.value;return t.isPlaced.value&&t.isPresenting.value?I.dy`
- ${i?I.dy``:null} - ${r?I.dy``:null} -
`:null}onToggleReader(){const e=this.activeDocument.setup.reader.ins;e.enabled.setValue(!e.enabled.value),this.analytics.sendProperty("Reader_Enabled",e.enabled.value)}onToggleNarration(){const e=this.activeDocument.setup.audio;e.setupAudio(),e.ins.playNarration.set()}onToggleAnnotations(){const e=this.activeDocument.setup.viewer.ins;e.annotationsVisible.setValue(!e.annotationsVisible.value),this.analytics.sendProperty("Annotations_Visible",e.annotationsVisible.value)}onActiveDocument(e,t){if(e&&(this.documentProps.off(),this.arManager.outs.isPlaced.off("value",this.onUpdate,this),this.arManager.outs.isPresenting.off("value",this.onUpdate,this)),t){const e=t.setup;this.documentProps.on(e.viewer.ins.annotationsVisible,e.audio.outs.narrationPlaying),this.arManager.outs.isPlaced.on("value",this.onUpdate,this),this.arManager.outs.isPresenting.on("value",this.onUpdate,this)}this.requestUpdate()}};q=W([(0,I.Mo)("sv-ar-menu")],q);const X=q;var Y=n(68327),K=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let J=class extends I.ZP{constructor(){super(...arguments),this.sceneView=null,this.captionView=null,this.documentProps=new h.Z("value",this.onUpdate,this),this.isMobile=null,this.assetPath=""}get analytics(){return this.system.getMainComponent(u.Z)}get assetManager(){return this.system.getMainComponent(p.Z)}get reader(){return this.activeDocument?this.activeDocument.setup.reader:null}get tours(){return this.activeDocument?this.activeDocument.setup.tours:null}get navigation(){return this.activeDocument?this.activeDocument.setup.navigation:null}get renderer(){return this.system.getMainComponent(B.Z)}get arManager(){return this.system.getMainComponent(s.Z)}get assetReader(){return this.system.getMainComponent(Y.Z)}firstConnected(){this.classList.add("sv-content-view"),this.sceneView=new T(this.system),this.captionView=new F(this.system),this.isMobile=this.mobileCheck()}connected(){super.connected(),this.assetManager.outs.busy.on("value",this.onUpdate,this),this.sceneView.on("layout",(()=>this.onUpdate())),this.assetPath=this.assetReader.getSystemAssetUrl("")}disconnected(){this.sceneView.off("layout",(()=>this.onUpdate())),this.assetManager.outs.busy.off("value",this.onUpdate,this),super.disconnected()}render(){const e=this.system,t=this.assetManager.outs.busy.value,n=this.assetManager.initialLoad;let i=!1,s=d.we.Overlay,r=!1,o=!1;const a=this.reader,l=this.tours,c=this.navigation,h=this.arManager.shadowRoot.querySelector("ff-viewport-overlay");if(h&&(null===this.arManager.shadowRoot.querySelector("sv-ar-prompt-container")&&h.append(new H(this.system)),null===this.arManager.shadowRoot.querySelector("sv-ar-menu")&&h.append(new X(this.system))),l&&(r=l.ins.enabled.value&&-1===l.outs.tourIndex.value),a&&(i=!r&&a.ins.enabled.value&&a.ins.visible.value,s=a.ins.position.value,!0===this.isMobile&&(s=d.we.Overlay)),c){const e=c.ins.pointerEnabled.value,s=c.ins.promptEnabled.value;if(e&&s){const e=c.ins.isInUse.value;o=!t&&n&&!e&&!i,c.ins.promptActive.setValue(o)}}const u=this.sceneView,p=this.captionView;if((i&&s===d.we.Overlay||r)&&this.sceneView.getView().layout==g.t.Single?u.classList.contains("sv-blur")||setTimeout((()=>{u.classList.add("sv-blur"),this.renderer.views[0].render()}),1):u.classList.remove("sv-blur"),!t&&n&&(this.analytics.sendProperty("Loading_Time",this.analytics.getTimerTime()/1e3),this.analytics.resetTimer(),this.assetManager.initialLoad=!1),i){if(s===d.we.Right)return I.dy`
-
- ${u} -
- -
-
- -
-
-
- - ${p}`;if(s===d.we.Overlay)return I.dy`
${u} -
- -
- - ${p} -
`}return I.dy`
${u}
- - ${p} - ${o?I.dy``:null}`}onReaderClose(){this.reader.ins.enabled.setValue(!1),this.reader.ins.closed.set()}onActiveDocument(e,t){e&&this.documentProps.off(),t&&this.documentProps.on(t.setup.reader.ins.position,t.setup.reader.ins.enabled,t.setup.tours.outs.tourIndex,t.setup.navigation.ins.isInUse),this.requestUpdate()}mobileCheck(){var e,t=!1;return e=navigator.userAgent||navigator.vendor,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t}};J=K([(0,I.Mo)("sv-content-view")],J);const Q=J;var ee=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let te=class extends o.ZP{constructor(){super(),this.mode="radio",this.selectionIndex=-1,this.observer=new MutationObserver(this.onObserver),this.selectedButton=null,this.addEventListener("click",(e=>this.onClick(e)))}firstConnected(){this.classList.add("ff-button-group"),this.parseChildren()}connected(){this.observer.observe(this,{childList:!0})}disconnected(){this.observer.disconnect()}onObserver(e){e.forEach((e=>{"childList"===e.type&&this.parseChildren()}))}onClick(e){let t=e.target;for(;t&&t!==this&&!(t instanceof D.Z);)t=t.parentElement;t instanceof D.Z&&(t.selected?"exclusive"===this.mode&&(t.selected=!1,this.selectedButton=null,this.selectionIndex=-1):(this.selectedButton&&(this.selectedButton.selected=!1),this.selectedButton=t,this.selectedButton.selected=!0,this.selectionIndex=this.getButtons().indexOf(t)))}parseChildren(){const e=this.getButtons();this.selectedButton&&(this.selectionIndex=e.indexOf(this.selectedButton),this.selectionIndex<0&&(this.selectedButton.selected=!1,this.selectedButton=null)),(this.selectionIndex<0||this.selectionIndex>=e.length)&&(this.selectionIndex="radio"===this.mode?0:-1),this.selectionIndex>=0&&(this.selectedButton=e[this.selectionIndex],this.selectedButton.selected=!0)}getButtons(){return this.getChildrenArray().filter((e=>e instanceof D.Z))}};ee([(0,o.Cb)({type:String})],te.prototype,"mode",void 0),ee([(0,o.Cb)({type:Number})],te.prototype,"selectionIndex",void 0),te=ee([(0,o.Mo)("ff-button-group")],te);var ne,ie=n(22040),se=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let re=ne=class extends o.ZP{constructor(){super(...arguments),this.assetPath=""}firstConnected(){super.firstConnected(),this.classList.add("sv-logo")}render(){const e=o.dy`
- ${ne.defaultSmall} -
`,t=o.dy`
- ${ne.defaultFull} -
`;return o.dy`
${e}
${t}
`}};re.defaultSmall=o.dy`voyager-75grey`,re.defaultFull=o.dy`voyager-75grey`,se([(0,o.Cb)({type:String})],re.prototype,"assetPath",void 0),re=ne=se([(0,o.Mo)("sv-logo")],re);var oe,ae=n(3388),le=n(43875),ce=n(34287),he=(n(13470),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let de=oe=class extends ce.ZP{constructor(e){super(),this.language=null,this.needsFocus=!1,this.language=e,this.position="center",this.modal=!0,this.url=window.location.href}static show(e,t){const n=new oe(t);return e.appendChild(n),new Promise(((e,t)=>{n.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-share-menu"),this.needsFocus=!0}render(){const e=encodeURIComponent(this.url),t=encodeURI("Check out this interactive 3D model with Smithsonian Voyager:"),n=this.language,i=`http://twitter.com/share?text=${t}&url=${e}`,s=`https://www.facebook.com/sharer/sharer.php?u=${e}`,r=`https://www.linkedin.com/shareArticle?url=${e}&mini=true&title=${t}`,o=``,a=`mailto:?subject=${t}&body=${e}`,l=n.getLocalizedString("Share Experience");return ce.dy` -
this.onKeyDown(e)}> -
-
${l}
- -
-
- - - - -
-
${n.getLocalizedString("Embed Link")}
- -
- `}update(e){if(super.update(e),this.needsFocus){this.getElementsByClassName("sv-share-button-twitter").item(0).focus(),this.needsFocus=!1}}onClickCopy(){this.getElementsByTagName("ff-text-edit").item(0).select(),document.execCommand("copy")}onKeyDown(e){"Escape"===e.code?(e.preventDefault(),this.close()):"Tab"===e.code&&(0,O.e)((0,O.G)(this),e)}};de=oe=he([(0,ce.Mo)("sv-share-menu")],de);const ue=de;var pe,me=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let fe=pe=class extends ce.ZP{constructor(e,t){super(),this.language=null,this.imageUri=null,this.needsFocus=!1,this.language=e,this.imageUri=t,this.position="center",this.modal=!0,this.url=window.location.href}static show(e,t,n){const i=new pe(t,n);return e.appendChild(i),new Promise(((e,t)=>{i.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-ar-code"),this.needsFocus=!0}render(){const e=this.language,t=e.getLocalizedString("AR Experience");return ce.dy` -
this.onKeyDown(e)}> -
-
${t}
- -
-
${e.getLocalizedString("1. Scan the code with your mobile device to return here.")}
-
- -
-
${e.getLocalizedString("2. Tap ")}${e.getLocalizedString(" to launch an AR experience! ")}
-
- `}update(e){if(super.update(e),this.needsFocus){this.getElementsByClassName("ff-close-button").item(0).focus(),this.needsFocus=!1}}onKeyDown(e){"Escape"===e.code?(e.preventDefault(),this.close()):"Tab"===e.code&&(0,O.e)((0,O.G)(this),e)}};fe=pe=me([(0,ce.Mo)("sv-ar-code")],fe);const ge=fe;var ve=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let ye=class extends I.ZP{constructor(){super(...arguments),this.documentProps=new h.Z("value",this.onUpdate,this),this.shareButtonSelected=!1,this.resizeObserver=null,this.isClipped=!1}get fullscreen(){return this.system.getMainComponent(i.Z)}get toolProvider(){return this.system.getMainComponent(ie.Z)}get analytics(){return this.system.getMainComponent(u.Z)}get arManager(){return this.system.getMainComponent(s.Z)}get sceneNode(){return this.system.getComponent(Z.Z)}firstConnected(){super.firstConnected(),this.classList.add("sv-main-menu")}connected(){super.connected(),this.fullscreen.outs.fullscreenActive.on("value",this.onUpdate,this),this.toolProvider.ins.visible.on("value",this.onUpdate,this),this.activeDocument.setup.language.outs.language.on("value",this.onUpdate,this),this.activeDocument.setup.audio.outs.narrationEnabled.on("value",this.onUpdate,this),this.activeDocument.setup.tours.ins.closed.on("value",this.setTourFocus,this),this.activeDocument.setup.reader.ins.closed.on("value",this.setReaderFocus,this),this.toolProvider.ins.closed.on("value",this.setToolsFocus,this),this.resizeObserver||(this.resizeObserver=new ResizeObserver((()=>this.onResize()))),this.resizeObserver.observe(this)}disconnected(){this.resizeObserver.disconnect(),this.toolProvider.ins.closed.off("value",this.setToolsFocus,this),this.activeDocument.setup.reader.ins.closed.off("value",this.setReaderFocus,this),this.activeDocument.setup.tours.ins.closed.off("value",this.setTourFocus,this),this.activeDocument.setup.audio.outs.narrationEnabled.off("value",this.onUpdate,this),this.activeDocument.setup.language.outs.language.off("value",this.onUpdate,this),this.toolProvider.ins.visible.off("value",this.onUpdate,this),this.fullscreen.outs.fullscreenActive.off("value",this.onUpdate,this),super.disconnected()}render(){const e=this.activeDocument;if(!e)return I.dy``;const t=!!this.system.getComponent("CVStoryApplication",!0),n=e.setup,i=this.sceneNode,s=n.tours.outs.count.value>0,r=n.tours.ins.enabled.value,o=r&&!t,a=n.reader.articles.length>0,l=n.reader.ins.enabled.value,c=i.getGraphComponents(G.Z).some((e=>e.hasAnnotations)),h=n.viewer.ins.annotationsVisible.value,d=this.fullscreen,u=d.outs.fullscreenAvailable.value,p=d.outs.fullscreenActive.value,m=n.interface.ins.tools.value,f=this.toolProvider.ins.visible.value,g=n.audio.outs.narrationEnabled.value,v=n.audio.outs.narrationPlaying.value,y=n.language,b=i.getGraphComponents(ae.Z);let _=!1;b.forEach((e=>{_=e.derivatives.getByQuality(le.$l.AR).length>0||_}));const x=(this.arManager.outs.available.value||this.arManager.arCodeImage)&&_&&b.length>=1;return I.dy` - ${x?I.dy``:null} - ${g?I.dy``:null} - ${s?I.dy``:null} - ${a?I.dy``:null} - ${c?I.dy``:null} - - ${u?I.dy``:null} - ${m?I.dy``:null}`}onToggleReader(){const e=this.activeDocument.setup.reader,t=e.ins;t.enabled.setValue(!t.enabled.value),t.focus.setValue(t.enabled.value),t.enabled.value&&t.articleId.setValue(1===e.articles.length?e.articles[0].article.id:""),this.analytics.sendProperty("Reader_Enabled",t.enabled.value)}onToggleTours(){const e=this.activeDocument.setup.tours.ins,t=this.activeDocument.setup.reader.ins;e.enabled.value?e.enabled.setValue(!1):(t.enabled.value&&t.enabled.setValue(!1),e.enabled.setValue(!0),e.tourIndex.setValue(-1)),this.analytics.sendProperty("Tours_Enabled",e.enabled.value)}onToggleAnnotations(){const e=this.toolProvider.ins,t=this.activeDocument.setup.viewer.ins;e.visible.value&&e.visible.setValue(!1),t.annotationsVisible.setValue(!t.annotationsVisible.value),this.analytics.sendProperty("Annotations_Visible",t.annotationsVisible.value)}onToggleShare(){this.shareButtonSelected||(this.shareButtonSelected=!0,this.requestUpdate(),ue.show(this,this.activeDocument.setup.language).then((()=>{this.shareButtonSelected=!1,this.requestUpdate(),this.setElementFocus("share-btn")})),this.analytics.sendProperty("Menu_Share"))}onToggleFullscreen(){this.fullscreen.toggle(),this.analytics.sendProperty("Menu_Fullscreen")}onToggleTools(){const e=this.toolProvider.ins,t=this.activeDocument.setup.viewer.ins;t.annotationsVisible.value&&t.annotationsVisible.setValue(!1),e.visible.setValue(!e.visible.value),this.analytics.sendProperty("Tools_Visible",e.visible.value)}onEnterAR(){const e=this.arManager,t=e.ins;e.outs.available.value?t.enabled.setValue(!0):ge.show(this.parentElement.parentElement.parentElement,this.activeDocument.setup.language,e.arCodeImage).then((()=>{this.setElementFocus("ar-btn")}))}onToggleNarration(){const e=this.activeDocument.setup.audio;e.setupAudio(),e.ins.playNarration.set()}setTourFocus(){this.setElementFocus("tour-btn")}setReaderFocus(){this.setElementFocus("reader-btn")}setToolsFocus(){this.setElementFocus("tools-btn")}setElementFocus(e){const t=this.getElementsByTagName("ff-button"),n=Array.from(t).find((t=>t.id===e));void 0!==n?n.focus():console.warn("Can't focus. Element ["+e+"] not found.")}onActiveDocument(e,t){if(e&&this.documentProps.off(),t){const e=t.setup;this.documentProps.on(e.interface.ins.tools,e.reader.ins.enabled,e.reader.outs.count,e.tours.ins.enabled,e.tours.outs.count,e.viewer.ins.annotationsVisible,e.audio.outs.narrationPlaying,this.toolProvider.ins.visible)}this.requestUpdate()}onResize(){const e=this.scrollHeight>this.clientHeight;this.isClipped!==e&&(e&&this.scrollTo({top:this.scrollTop+this.scrollHeight,behavior:"smooth"}),this.isClipped=e)}};ye=ve([(0,I.Mo)("sv-main-menu")],ye);var be=n(93072),_e=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let xe=class extends v.ZP{constructor(){super(...arguments),this.needsFocus=!1}get toolProvider(){return this.system.getMainComponent(ie.Z)}get language(){return this.system.getComponent(be.Z)}firstConnected(){super.firstConnected(),this.classList.add("sv-bottom-bar-container","sv-tool-bar"),this.needsFocus=!0}connected(){super.connected(),this.toolProvider.on("active-component",this.onUpdate,this),this.language.outs.language.on("value",this.onUpdate,this)}disconnected(){this.language.outs.language.off("value",this.onUpdate,this),this.toolProvider.off("active-component",this.onUpdate,this),super.disconnected()}render(){const e=this.toolProvider.scopedComponents,t=this.toolProvider.activeComponent,n=this.language,i=(t&&v.dy`
`,e.map((e=>v.dy`this.onSelectTool(e)}>`)));return v.dy`
this.onKeyDownTool(e)}>${t?t.createView():null}
-
`}onSelectTool(e){this.toolProvider.activeComponent=e}onClose(e){this.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}update(e){if(super.update(e),this.needsFocus){this.getElementsByClassName("sv-tool-button").item(0).focus(),this.needsFocus=!1}}onKeyDownMain(e){if("Escape"===e.code)e.preventDefault(),this.dispatchEvent(new CustomEvent("close"));else if("Tab"===e.code){const t=Array.from(this.getElementsByTagName("div")).find((e=>"mainmenu"===e.id));(0,O.e)((0,O.G)(t),e)}}onKeyDownTool(e){if("Escape"===e.code)e.preventDefault(),this.closeTool();else if("Tab"===e.code){const t=Array.from(this.getElementsByTagName("div")).find((e=>"toolmenu"===e.id));(0,O.e)((0,O.G)(t),e)}}closeTool(){const e=this.getElementsByTagName("ff-button");Array.from(e).find((e=>e.getAttribute("text")===this.language.getLocalizedString(this.toolProvider.activeComponent.text))).focus(),this.toolProvider.activeComponent=null}};xe=_e([(0,v.Mo)("sv-tool-bar")],xe);var we=n(40490),Se=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let Me=class extends I.ZP{constructor(){super(...arguments),this.needsFocus=!1,this.firstRender=!0,this.stepTitle=""}firstConnected(){super.firstConnected(),this.classList.add("sv-bottom-bar-container","sv-tour-navigator"),this.needsFocus=!0}render(){const e=this.tours,t=this.language,n=this.interface,i=e.activeTour;let s,r;if(e&&i){const n=e.outs.stepIndex.value+1,i=e.outs.stepCount.value;s=i>0?e.stepTitle:e.title,r=i>0?`${t.getLocalizedString("Step")} ${n} ${t.getLocalizedString("of")} ${i}`:t.getLocalizedString("No tour steps defined")}else s=t.getLocalizedString("No tour selected"),r="---";this.stepTitle=s,this.firstRender&&(s="");const o=n.isShowing(we.p.tour_exit)?I.dy``:null;return I.dy`
this.onKeyDown(e)}>
- ${o} -
-
${s}
-
${r}
-
- - - -
`}updated(e){if(super.updated(e),this.needsFocus){this.getElementsByClassName("sv-section-trail").item(2).focus(),this.needsFocus=!1}const t=this.getElementsByClassName("sv-title").item(0);t&&(this.firstRender?(setTimeout((()=>{t.innerText=this.stepTitle}),100),this.firstRender=!1):t.innerText=this.stepTitle)}onClickExit(){this.tours.ins.enabled.setValue(!1),this.tours.ins.closed.set()}onClickMenu(){this.tours.ins.tourIndex.setValue(-1)}onClickPrevious(){this.tours.ins.previous.set();this.querySelector("#title-inner").classList.remove("sv-text-scroll")}onClickNext(){this.tours.ins.next.set();this.querySelector("#title-inner").classList.remove("sv-text-scroll")}onClickTitle(){this.textHelper()}onActiveDocument(e,t){e&&(this.tours.outs.tourIndex.off("value",this.onUpdate,this),this.tours.outs.stepIndex.off("value",this.onUpdate,this),this.language.outs.language.off("value",this.onUpdate,this)),t&&(this.tours=t.setup.tours,this.language=t.setup.language,this.interface=t.setup.interface,this.tours.outs.tourIndex.on("value",this.onUpdate,this),this.tours.outs.stepIndex.on("value",this.onUpdate,this),this.language.outs.language.on("value",this.onUpdate,this)),this.requestUpdate()}onKeyDown(e){"Escape"===e.code?(e.preventDefault(),this.tours.ins.tourIndex.setValue(-1)):"Tab"===e.code&&(0,O.e)((0,O.G)(this),e)}textHelper(){const e=this.querySelector("#title-inner"),t=e.scrollWidth-e.offsetWidth+12;if(t>12){const n=this.querySelector("#title-area"),i=t/30;e.classList.remove("ff-ellipsis"),e.style.setProperty("animation-duration",i.toString()+"s"),e.style.setProperty("--x-offset","-"+t+"px"),n.style.setProperty("pointer-events","none"),e.classList.add("sv-text-scroll"),e.addEventListener("animationend",(()=>{e.classList.remove("sv-text-scroll"),e.classList.add("ff-ellipsis"),n.style.setProperty("pointer-events","auto")})),e.addEventListener("animationcancel",(()=>{e.classList.remove("sv-text-scroll"),e.classList.add("ff-ellipsis"),n.style.setProperty("pointer-events","auto")}))}}};Me=Se([(0,I.Mo)("sv-tour-navigator")],Me);var Ee=n(1594),Te=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let Ce=class extends o.ZP{constructor(){super(...arguments),this.needsFocus=!1,this.focusableElements=[]}firstConnected(){super.firstConnected(),this.classList.add("sv-document-overlay","sv-article","sv-tour-menu"),this.needsFocus=!0}renderEntry(e,t){return o.dy`
this.onKeyDown(e,t)} class="sv-entry" @click=${e=>this.onClickTour(e,t)}> -
-

${Object.keys(e.titles).length>0?e.titles[Ee.PD[this.activeLanguage]]||"undefined":e.title}

- -
-

${Object.keys(e.leads).length>0?e.leads[Ee.PD[this.activeLanguage]]:e.lead}

-
`}render(){const e=this.tours;return 0===e.length?o.dy`
-

No tours available.

-
`:o.dy`
- ${e.map(((e,t)=>this.renderEntry(e,t)))} -
`}update(e){if(super.update(e),this.needsFocus){this.getElementsByClassName("sv-entry").item(0).focus(),this.needsFocus=!1}}onClickTour(e,t){e.stopPropagation(),this.dispatchEvent(new CustomEvent("select",{detail:{index:t}}))}onKeyDown(e,t){if("Space"===e.code||"Enter"===e.code)e.preventDefault(),this.dispatchEvent(new CustomEvent("select",{detail:{index:t}}));else if("Escape"===e.code)e.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{index:t}}));else if("Tab"===e.code)0===this.focusableElements.length&&(this.focusableElements=(0,O.G)(this)),(0,O.e)(this.focusableElements,e);else if("ArrowUp"===e.code||"ArrowDown"===e.code){const t=e.target instanceof Element?e.target:null;if(t){const n="ArrowUp"===e.code?t.previousElementSibling:t.nextElementSibling;n&&(t.setAttribute("tabIndex","-1"),n.setAttribute("tabIndex","0"),n.focus())}}}};Te([(0,o.Cb)({attribute:!1})],Ce.prototype,"tours",void 0),Te([(0,o.Cb)({attribute:!1})],Ce.prototype,"activeLanguage",void 0),Ce=Te([(0,o.Mo)("sv-tour-menu")],Ce);var Ae,Pe=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let Re=Ae=class extends ce.ZP{constructor(e){super(),this.language=null,this.language=e,this.position="center",this.modal=!0,this.url=window.location.href}static show(e,t){const n=new Ae(t);return e.appendChild(n),new Promise(((e,t)=>{n.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-language-menu","sv-option-menu")}renderEntry(e,t){const n=e.name===this.language.nameString();return ce.dy`
this.onClickLanguage(e,t)} @keydown=${e=>this.onKeyDownEntry(e,t)} ?selected=${n}> - ${e.name} -
`}render(){const e=this.language;return ce.dy` -
this.onKeyDownMain(e)}> -
-
${e.getLocalizedString("Set Language")}
- -
-
-
- ${e.activeLanguages.map(((e,t)=>this.renderEntry(e,t)))} -
-
-
- `}firstUpdated(e){super.firstUpdated(e),Array.from(this.getElementsByClassName("sv-entry")).find((e=>"0"===e.getAttribute("tabIndex"))).focus()}onClickLanguage(e,t){const n=this.language;e.stopPropagation(),n.ins.language.setValue(n.activeLanguages[t].id),this.close()}onKeyDownEntry(e,t){const n=this.language;if("Space"===e.code||"Enter"===e.code)e.preventDefault(),e.stopPropagation(),n.ins.language.setValue(n.activeLanguages[t].id),this.close();else if("ArrowUp"===e.code||"ArrowDown"===e.code){const t=e.target instanceof Element?e.target:null;if(t){const n="ArrowUp"===e.code?t.previousElementSibling:t.nextElementSibling;n&&(t.setAttribute("tabIndex","-1"),n.setAttribute("tabIndex","0"),n.focus())}}else"Tab"===e.code&&this.addEventListener("blur",this.tabReset,{once:!0,capture:!0})}onKeyDownMain(e){"Escape"===e.code?this.close():"Tab"===e.code&&(0,O.e)((0,O.G)(this),e)}tabReset(e){const t=e.target instanceof Element?e.target:null;if(t){const e=Array.from(t.parentElement.children).find((e=>e.hasAttribute("selected")));e!==t&&(t.setAttribute("tabIndex","-1"),e.setAttribute("tabIndex","0"))}}};Re=Ae=Pe([(0,ce.Mo)("sv-language-menu")],Re);const Le=Re;var Ne=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let De=class extends I.ZP{get activeTags(){return this.viewer?this.viewer.ins.activeTags.value.split(",").map((e=>e.trim())).filter((e=>!!e)):[]}get tagCloud(){return this.viewer?this.viewer.outs.tagCloud.value.split(",").map((e=>e.trim())).filter((e=>!!e)):[]}firstConnected(){super.firstConnected(),this.classList.add("sv-bottom-bar-container","sv-tag-cloud","sv-transition"),setTimeout((()=>this.classList.remove("sv-transition")),1)}render(){const e=this.activeTags,t=this.tagCloud.map((t=>I.dy`=0} - @click=${e=>this.onSelectTag(t)}>`));return I.dy`
- -
${t}
-
`}onClickClose(){this.viewer.ins.annotationsVisible.setValue(!1)}onSelectTag(e){let t=this.activeTags;const n=this.viewer.ins.radioTags.value,i=t.indexOf(e);i>=0&&!n?t.splice(i,1):i<0&&(n?t=[e]:t.push(e)),this.viewer.ins.activeTags.setValue(t.join(", "))}onActiveDocument(e,t){e&&(this.viewer.ins.activeTags.off("value",this.onUpdate,this),this.viewer.outs.tagCloud.off("value",this.onUpdate,this)),t&&(this.viewer=t.setup.viewer,this.viewer.ins.activeTags.on("value",this.onUpdate,this),this.viewer.outs.tagCloud.on("value",this.onUpdate,this))}};De=Ne([(0,I.Mo)("sv-tag-cloud")],De);var Ie,Oe,Ue=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};!function(e){e[e.Nav=0]="Nav",e[e.Menu=1]="Menu"}(Oe||(Oe={}));let ke=Ie=class extends ce.ZP{constructor(e){super(),this.language=null,this.helpView=Oe.Nav,this.language=e,this.position="center",this.modal=!0,this.url=window.location.href}static show(e,t){const n=new Ie(t);return e.appendChild(n),new Promise(((e,t)=>{n.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-main-help")}render(){const e=this.language,t=this.helpView,n=!!this.parentElement.querySelector("#ar-btn"),i=!!this.parentElement.querySelector("#audio-btn"),s=!!this.parentElement.querySelector("#tour-btn"),r=!!this.parentElement.querySelector("#reader-btn"),o=!!this.parentElement.querySelector("#anno-btn"),a=!!this.parentElement.querySelector("#fullscreen-btn"),l=!!this.parentElement.querySelector("#tools-btn"),c=ce.dy`
-
- -
Orbit
-
${Ie.leftClick}Left-click and drag
-
${Ie.oneFinger}One-finger drag
-
-
- -
Pan
-
${Ie.rightClick}Right-click and drag
-
${Ie.twoFinger}Two-finger drag
-
-
- -
Zoom
-
${Ie.mouseWheel}Mouse wheel
-
${Ie.pinch}Two-finger pinch
-
-
`,h=ce.dy`
The tools below can be accessed by clicking the corresponding icons on the menu bar to the left of the screen.
-
- ${n?ce.dy`
- -
Launch an augmented
reality experience
-
`:""} - ${i?ce.dy`
- -
Hear an audio
narration of the scene
-
`:""} - ${s?ce.dy`
- -
Take a curated guided
tour of the scene
-
`:""} - ${r?ce.dy`
- -
Read articles about
the scene content
-
`:""} - ${o?ce.dy`
- -
Show annotations
highlighting key points
-
`:""} -
- -
Share the experience
with a friend!
-
- ${a?ce.dy`
- -
View the experience
in fullscreen mode
-
`:""} - ${l?ce.dy`
- -
Open the advanced
tool menu
-
`:""} -
`;return ce.dy` -
this.onKeyDownMain(e)}> -
-
${e.getLocalizedString("Introduction to Voyager")}
- -
-
- - -
- ${t===Oe.Nav?c:h} -
- `}firstUpdated(e){super.firstUpdated(e)}onClickSection(e){this.helpView=e.target.index,this.requestUpdate()}onKeyDownMain(e){"Escape"===e.code?this.close():"Tab"===e.code&&(0,O.e)((0,O.G)(this),e)}tabReset(e){const t=e.target instanceof Element?e.target:null;if(t){const e=Array.from(t.parentElement.children).find((e=>e.hasAttribute("selected")));e!==t&&(t.setAttribute("tabIndex","-1"),e.setAttribute("tabIndex","0"))}}};ke.leftClick=ce.dy``,ke.rightClick=ce.dy``,ke.mouseWheel=ce.dy``,ke.pinch=ce.dy` - - - `,ke.oneFinger=ce.dy` - - - `,ke.twoFinger=ce.dy` - - - `,ke=Ie=Ue([(0,ce.Mo)("sv-main-help")],ke);const Ve=ke;var ze,Fe=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let Be=ze=class extends ce.ZP{constructor(e,t){super(),this.language=null,this.content="",this.language=e,this.content=t,this.position="center",this.modal=!0,this.url=window.location.href}static show(e,t,n){const i=new ze(t,n);return e.appendChild(i),new Promise(((e,t)=>{i.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.contentElement=this.createElement("div",null),this.classList.add("sv-splash")}render(){const e=this.language,t=this.contentElement;return t.innerHTML=this.content,ce.dy` -
this.onKeyDownMain(e)}> -
-
${e.getLocalizedString("Welcome to Voyager")}
- -
-
- ${t} -
-
- `}firstUpdated(e){super.firstUpdated(e),this.querySelector("#main").focus()}onKeyDownMain(e){"Escape"===e.code?this.close():"Tab"===e.code&&(0,O.e)((0,O.G)(this),e)}};Be=ze=Fe([(0,ce.Mo)("sv-splash")],Be);const $e=Be;var je=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let He=class extends I.ZP{constructor(){super(...arguments),this.documentProps=new h.Z("value",this.onUpdate,this),this.assetPath="",this.needsSplash=!0}get toolProvider(){return this.system.getMainComponent(ie.Z)}get assetReader(){return this.system.getMainComponent(Y.Z)}firstConnected(){this.style.pointerEvents="none",this.setAttribute("pointer-events","none"),this.classList.add("sv-chrome-view")}connected(){super.connected(),this.toolProvider.ins.visible.on("value",this.onUpdate,this),this.activeDocument.setup.language.outs.language.on("value",this.onUpdate,this),this.activeDocument.setup.audio.outs.isPlaying.on("value",this.onUpdate,this),this.activeDocument.setup.audio.outs.narrationPlaying.on("value",this.onUpdate,this),this.activeDocument.setup.audio.ins.captionsEnabled.on("value",this.onUpdate,this),this.titleElement=this.createElement("div",null),this.titleElement.classList.add("ff-ellipsis"),this.assetPath=this.assetReader.getSystemAssetUrl("")}disconnected(){this.activeDocument.setup.audio.ins.captionsEnabled.off("value",this.onUpdate,this),this.activeDocument.setup.audio.outs.narrationPlaying.off("value",this.onUpdate,this),this.activeDocument.setup.audio.outs.isPlaying.off("value",this.onUpdate,this),this.activeDocument.setup.language.outs.language.off("value",this.onUpdate,this),this.toolProvider.ins.visible.off("value",this.onUpdate,this),super.disconnected()}render(){const e=this.activeDocument,t=this.titleElement;if(!e)return I.dy``;const n=e.setup,i=n.interface.ins.visible.value,s=n.interface.ins.logo.value&&n.interface.isShowing(we.p.logo),r=n.interface.ins.menu.value&&n.interface.isShowing(we.p.menu),o=n.interface.ins.visibleElements.value&&n.interface.isShowing(we.p.title),a=n.interface.ins.visibleElements.value&&n.interface.isShowing(we.p.help),l=n.reader.ins.enabled.value,c=n.tours.tours,h=n.tours.ins.enabled.value,d=n.tours.outs.tourIndex.value>=0,u=n.language,p=u.activeLanguages,m=u.outs.language.value,f=p.length>1&&n.interface.isShowing(we.p.language),g=n.audio.outs.isPlaying.value,v=n.audio.ins.captionsEnabled.value,y=n.audio.outs.narrationPlaying.value,b=!!this.system.getComponent("CVStoryApplication",!0)||!h,_=n.viewer.ins.annotationsVisible.value&&n.viewer.outs.tagCloud.value,x=!l&&this.toolProvider.ins.visible.value,w=this.activeDocument.setup.tours.outs.ending.value;this.activeDocument.setup.tours.outs.ending.setValue(!1);const S=this.activeDocument.outs.intro.value;if(S&&(this.needsSplash&&S.length>0&&$e.show(this,this.activeDocument.setup.language,S).then((()=>{this.getRootNode().getElementById("sv-scene").focus()})),this.needsSplash=!1),!i)return I.dy``;let M;return M=h?d?u.getLocalizedString("Tour")+": "+n.tours.outs.tourTitle.value:u.getLocalizedString("Interactive Tours"):e.outs.title.value||"Missing Title",t.innerHTML=M,I.dy`${w?I.dy``:null} - ${y?I.dy`
${n.audio.getPlayerById(n.audio.narrationId)}
`:null} -
-
- ${r?I.dy``:null} -
-
- ${o?I.dy`
${t}
`:null} - ${s?I.dy``:null} -
-
-
- ${h&&d?I.dy``:null} - ${h&&!d?I.dy``:null} - ${_&&b?I.dy``:null} - ${x&&b?I.dy`
`:null} - `}onSelectTour(e){this.activeDocument.setup.tours.ins.tourIndex.setValue(e.detail.index)}closeTours(){const e=this.activeDocument.setup.tours;e.ins.enabled.setValue(!1),e.ins.closed.set()}updateCaptions(){const e=this.activeDocument.setup.audio.ins;e.captionsEnabled.setValue(!e.captionsEnabled.value)}openLanguageMenu(){const e=this.activeDocument.setup.language;e.ins.enabled.value||(e.ins.enabled.setValue(!0),Le.show(this,this.activeDocument.setup.language).then((()=>{e.ins.enabled.setValue(!1),this.querySelector("#language").focus()})))}openHelp(){this.activeDocument.setup.language;Ve.show(this,this.activeDocument.setup.language).then((()=>{this.querySelector("#main-help").focus()}))}closeTools(){const e=this.toolProvider.ins;e.visible.setValue(!1),e.closed.set()}onActiveDocument(e,t){if(e&&this.documentProps.off(),t){const e=t.setup;this.documentProps.on(t.outs.title,t.outs.assetPath,e.interface.ins.visible,e.interface.ins.logo,e.interface.ins.menu,e.viewer.ins.annotationsVisible,e.reader.ins.enabled,e.tours.ins.enabled,e.tours.outs.tourIndex)}this.requestUpdate()}};He=je([(0,I.Mo)("sv-chrome-view")],He);const Ge=He;var Ze=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};a.Z.add("globe",o.dy``),a.Z.add("cog",o.dy``),a.Z.add("eye",o.dy``),a.Z.add("palette",o.dy``),a.Z.add("comment",o.dy``),a.Z.add("article",o.dy``),a.Z.add("document",o.dy``),a.Z.add("share",o.dy``),a.Z.add("expand",o.dy``),a.Z.add("zoom",o.dy``),a.Z.add("tools",o.dy``),a.Z.add("environment",o.dy``),a.Z.add("bulb",o.dy``),a.Z.add("spot",o.dy``),a.Z.add("area",o.dy``),a.Z.add("sun",o.dy``),a.Z.add("half-sun",o.dy``),a.Z.add("tape",o.dy``),a.Z.add("knife",o.dy``),a.Z.add("bars",o.dy``),a.Z.add("triangle-left",o.dy``),a.Z.add("triangle-right",o.dy``),a.Z.add("twitter",o.dy``),a.Z.add("facebook",o.dy``),a.Z.add("instagram",o.dy``),a.Z.add("linkedin",o.dy``),a.Z.add("email",o.dy``),a.Z.add("copy",o.dy``),a.Z.add("ar",o.dy``),a.Z.add("device-move",o.dy``),a.Z.add("audio",o.dy``),a.Z.add("help",o.dy`?`),a.Z.add("move",o.dy``),a.Z.add("rotate",o.dy``),a.Z.add("pause",o.dy``),a.Z.add("caption",o.dy``);let We=class extends o.ZP{constructor(e){super(),this.application=null,e&&(this.application=e),this.addEventListener("focus",this.onFocus)}static get observedAttributes(){return["root","document"]}get fullscreen(){return this.application.system.getMainComponent(i.Z)}get arManager(){return this.application.system.getMainComponent(s.Z)}get viewer(){return this.application.system.getComponent(r.Z)}firstConnected(){if(super.firstConnected(),!this.application){const e={root:this.getAttribute("root"),dracoRoot:this.getAttribute("dracoRoot"),resourceRoot:this.getAttribute("resourceRoot"),document:this.getAttribute("document"),model:this.getAttribute("model"),geometry:this.getAttribute("geometry"),texture:this.getAttribute("texture"),quality:this.getAttribute("quality"),uiMode:this.getAttribute("uiMode"),bgColor:this.getAttribute("bgColor"),bgStyle:this.getAttribute("bgStyle"),controls:this.getAttribute("controls"),prompt:this.getAttribute("prompt"),reader:this.getAttribute("reader"),lang:this.getAttribute("lang")};this.application=new c.Z(null,e)}this.attachShadow({mode:"open"});const e=this.shadowRoot;var t=document.createElement("style");t.innerText='/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:normal;-webkit-text-size-adjust:100%}body{margin:0}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace, monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.ff-fullsize{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box}.ff-container{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;overflow:hidden}.ff-fullsize{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box}.ff-caret-down{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #a0a0a0;transform:rotate(180deg);transition:transform 0.05s}.ff-caret-up{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #a0a0a0;transform:rotate(0deg);transition:transform 0.05s}.ff-caret-right{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #a0a0a0;transform:rotate(90deg);transition:transform 0.05s}.ff-caret-left{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #a0a0a0;transform:rotate(270deg);transition:transform 0.05s}html{color:#c8c8c8}button,input{display:block;padding:0;margin:0;border:none;background-color:inherit;color:inherit;font-size:inherit;cursor:inherit}*:focus{outline:1px solid #0089bf;outline-offset:0}*:focus:not(:focus-visible){outline:0}*:focus-visible{outline:1px solid #0089bf;outline-offset:0}.ff-fullscreen{position:fixed;left:0;right:0;top:0;bottom:0}.ff-noselect{user-select:none;-moz-user-select:none;-webkit-user-select:none}.ff-off{user-select:none;-moz-user-select:none;-webkit-user-select:none;pointer-events:none}.ff-on{user-select:auto;-webkit-user-select:none;pointer-events:auto}.ff-focusable{tab-index:0}.ff-flex-row{display:flex}.ff-flex-column{display:flex;flex-direction:column}.ff-flex-wrap{flex-wrap:wrap}.ff-flex-centered{align-items:center}.ff-flex-item-fixed{flex:0 0 auto;position:relative}.ff-flex-item-stretch,.ff-flex-spacer{flex:1 1 auto;position:relative}.ff-scroll-y{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;overflow-y:auto}.ff-position-above{position:absolute;bottom:0}.ff-position-below{position:absolute;top:100%}.ff-position-left{position:absolute;right:0}.ff-position-right{position:absolute;left:100%}.ff-position-above.ff-align-left,.ff-position-below.ff-align-left{left:0}.ff-position-above.ff-align-right,.ff-position-below.ff-align-right{right:0}.ff-position-left.ff-align-top,.ff-position-right.ff-align-top{top:0}.ff-position-left.ff-align-bottom,.ff-position-right.ff-align-bottom{bottom:0}.ff-ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ff-placeholder{flex:1 1 auto;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.ff-splitter-section{flex:1 1 auto;position:relative;box-sizing:border-box;overflow:hidden}.ff-splitter[direction="vertical"]+.ff-splitter-section{border-top:2px solid #1b1b1b}.ff-splitter:not([direction="vertical"])+.ff-splitter-section{border-left:2px solid #1b1b1b}.ff-frame{padding:4px}.ff-frame .ff-control{margin:4px}.ff-icon{display:inline-block;position:relative;height:1rem;fill:#a0a0a0}.ff-icon svg{width:inherit;height:inherit}.ff-button{cursor:pointer}.ff-button[vertical]{flex-direction:column}.ff-button.ff-inline .ff-icon+.ff-text{padding-left:0.5em}.ff-button.ff-inline .ff-icon{display:inline}.ff-button.ff-inline .ff-text{display:inline}.ff-button.ff-transparent{position:relative;display:flex;justify-content:center;align-items:center;flex:0 1 auto;flex-wrap:wrap;padding:5px;background:transparent;fill:#a0a0a0;transition:fill 0.2s}.ff-button.ff-transparent:hover,.ff-button.ff-transparent:focus{fill:#c8c8c8}.ff-button.ff-transparent[selected]{fill:#c8c8c8}.ff-button.ff-transparent>.ff-text{margin:3px;white-space:nowrap}.ff-button.ff-transparent>.ff-icon{margin:3px;height:1.3em}.ff-button.ff-transparent>.ff-caret-down{margin:3px}.ff-button.ff-transparent.ff-disabled{color:gray;fill:#606060;user-select:none;pointer-events:none}.ff-button.ff-control{position:relative;display:flex;justify-content:center;align-items:center;flex:1 1 auto;flex-wrap:wrap;padding:5px;background:#4e4e4e;transition:background-color 0.2s}.ff-button.ff-control:hover,.ff-button.ff-control:focus{background-color:#676767}.ff-button.ff-control[selected]{background-color:#0089bf}.ff-button.ff-control[selected]:hover,.ff-button.ff-control[selected]:focus{background-color:#00a6e8}.ff-button.ff-control>.ff-text{margin:3px;white-space:nowrap}.ff-button.ff-control>.ff-icon{margin:3px;height:1.3em}.ff-button.ff-control>.ff-caret-down{margin:3px}.ff-button.ff-control.ff-disabled{color:gray;fill:#606060;user-select:none;pointer-events:none}.ff-button.ff-control.ff-disabled>.ff-icon{fill:#606060}.ff-menu{background-color:#4e4e4e;z-index:100;display:flex;flex-direction:column}.ff-menu .ff-divider{height:1px;padding:0;background:#a0a0a0}.ff-menu .ff-button{justify-content:flex-start;margin:0;padding:4px 4px}.ff-menu .ff-button .ff-icon{height:1.2em;width:2.2em;margin-right:4px}.ff-dropdown .ff-menu{min-width:100%;margin-top:3px}.ff-modal-plane{position:fixed;left:0;right:0;top:0;bottom:0;background-color:rgba(0,0,0,0.6);opacity:0;transition:opacity .3s;z-index:990;pointer-events:auto}.ff-modal-plane.ff-transition{opacity:1}ff-dialog{box-sizing:border-box;background:#343434;border:1px solid #4e4e4e;box-shadow:3px 3px 24px rgba(0,0,0,0.4)}ff-title-bar{background:#1b1b1b;padding:2px}ff-title-bar .ff-text{flex:1 1 auto;padding-right:8px}ff-title-bar .ff-icon{padding:2px}ff-popup-button .ff-content{transition:opacity .15s}.ff-line-edit{display:block;overflow:hidden;background-color:#1b1b1b;min-height:1.2em}.ff-line-edit input{padding:2px}.ff-text-edit{box-sizing:border-box;flex:1 1 auto;display:flex;background-color:#1b1b1b}.ff-text-edit textarea{display:block;box-sizing:border-box;width:100%;padding:2px;resize:none;background:transparent;color:inherit;border:none}.ff-color-edit{font-size:0.8rem}.ff-color-edit .ff-control{margin:0}.ff-color-edit .ff-slider-controls{align-items:stretch;flex:1 1 auto}.ff-color-edit .ff-numeric-controls{flex:0 0 auto;align-items:center;margin-top:6px}.ff-color-edit .ff-text{color:#a0a0a0;margin:0 3px}.ff-color-edit .ff-line-edit{flex:4 5 auto}.ff-color-edit .ff-line-edit.ff-wide{flex:5 4 auto}.ff-color-edit .ff-knob{margin:-2px 0 0 -2px;border:2px solid white;box-shadow:0 0 5px rgba(0,0,0,0.5)}.ff-color-edit .ff-vector-slider{flex:1 0 auto;padding:0 10px 10px 0;background-image:linear-gradient(to bottom, transparent, black),linear-gradient(to right, white, red)}.ff-color-edit .ff-vector-slider .ff-knob{width:10px;height:10px}.ff-color-edit .ff-linear-slider{flex:0 0 24px;margin-left:6px;padding-bottom:10px}.ff-color-edit .ff-linear-slider .ff-knob{width:100%;height:10px}.ff-color-edit .ff-hue-slider{background:linear-gradient(to bottom, red, #ff0, lime, cyan, blue, #f0f, red)}.ff-color-edit .ff-alpha-slider{color:#4e4e4e}.ff-quad-splitter .ff-left{box-sizing:border-box;border-right:1px solid #343434}.ff-quad-splitter .ff-top{box-sizing:border-box;border-bottom:1px solid #343434}#ff-notification-stack{position:fixed;z-index:100;bottom:0;right:0;width:30%;min-width:250px;max-width:500px}.ff-notification{position:relative;left:0;display:flex;margin:8px;padding:4px;background:#4e4e4e;box-shadow:0 0 20px rgba(0,0,0,0.35)}.ff-notification.ff-info>.ff-icon{fill:#73adff}.ff-notification.ff-success>.ff-icon{fill:#8ae65c}.ff-notification.ff-warning>.ff-icon{fill:#e6a345}.ff-notification.ff-error>.ff-icon{fill:#e64545}.ff-notification>.ff-icon{height:2em;padding:8px}.ff-notification.ff-out{transition:left 0.5s ease-in;left:100%}.ff-notification .ff-text{flex:1;padding:8px;text-overflow:ellipsis;overflow:hidden}.ff-notification .ff-button{flex:0;padding:8px}.ff-message-box{position:relative;min-width:350px;max-width:450px;width:90%;padding:16px;background:#343434;box-shadow:0 0 20px rgba(0,0,0,0.35);opacity:0;transition:opacity .15s}.ff-message-box.ff-transition{opacity:1}.ff-message-box .ff-title{align-items:flex-start}.ff-message-box .ff-title .ff-type-icon{margin:0 16px 0 0;height:2.5em}.ff-message-box .ff-title .ff-type-icon[name="prompt"]{fill:#e6cf5c}.ff-message-box .ff-title .ff-type-icon[name="info"]{fill:#73adff}.ff-message-box .ff-title .ff-type-icon[name="warning"]{fill:#e6a345}.ff-message-box .ff-title .ff-type-icon[name="error"]{fill:#e64545}.ff-message-box .ff-title .ff-content{flex:1 1 auto;margin:0 0 2em 0}.ff-message-box .ff-title .ff-caption{font-size:1.5em}.ff-message-box .ff-title .ff-text{margin:2em 0 1em 0}.ff-message-box .ff-title .ff-line-edit{margin:0 0 1em 0}.ff-message-box .ff-title .ff-line-edit input{padding:4px}.ff-message-box .ff-title .ff-close-button{margin:0 0 0 16px;padding:0}.ff-message-box .ff-button+.ff-button{margin-left:8px}.ff-popup-options{box-sizing:border-box;background:#343434;border:1px solid #4e4e4e;box-shadow:3px 3px 24px rgba(0,0,0,0.4);min-width:6rem}.ff-popup-options button{padding:4px 8px;text-align:start;user-select:none}.ff-popup-options button+button{margin-top:1px}.ff-popup-options button:hover{background-color:#4e4e4e}.ff-popup-options button:focus{outline:none;background-color:#0089bf}.ff-list{flex:1 1 auto;background-color:#272727}.ff-list .ff-list-item{cursor:pointer;user-select:none;padding:2px}.ff-list .ff-list-item:hover{background-color:#343434}.ff-list .ff-list-item[selected]{background-color:#0089bf}.ff-list .ff-list-item+.ff-list-item{border-top:1px solid #343434}.ff-table{position:relative;box-sizing:border-box;width:100%}.ff-table table{box-sizing:border-box;width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}.ff-table tr[selected]{background-color:#0089bf}.ff-table th,.ff-table td{padding:4px}.ff-table th{background-color:#1b1b1b;color:#a0a0a0;text-align:start}.ff-table .ff-table-sort-icon{height:0.8em;margin-left:4px;color:#a0a0a0}.ff-tree{position:relative;overflow-y:auto}.ff-tree .ff-tree-node-container{margin-left:-501px;border-top:1px solid #3e3e3e;border-bottom:1px solid #3e3e3e;margin-bottom:-1px}.ff-tree .ff-tree-node{margin-left:500px}.ff-tree .ff-tree-node.ff-inner{background-color:#2f2f2f}.ff-tree .ff-tree-node.ff-leaf{background-color:#3c3c3c}.ff-tree .ff-tree-node.ff-root{background-color:#272727}.ff-tree .ff-tree-node[selected]{background-color:#0089bf}.ff-tree .ff-tree-node .ff-header{position:relative;cursor:pointer;padding-left:14px}.ff-tree .ff-tree-node .ff-header .ff-text{user-select:none}.ff-tree .ff-tree-node.ff-drop-target>.ff-header{outline:1px dashed #0089bf}.ff-tree .ff-tree-node.ff-inner[expanded]>.ff-header:before{content:\'\';position:absolute;top:0.6em;left:3px;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid #a0a0a0;transform:rotate(180deg);transition:transform 0.05s}.ff-tree .ff-tree-node.ff-inner:not([expanded])>.ff-header:before{content:\'\';position:absolute;top:0.6em;left:3px;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid #a0a0a0;transform:rotate(90deg);transition:transform 0.05s}.ff-tree .ff-tree-node.ff-leaf .ff-header{cursor:default}.ff-tree .ff-tree-node .ff-content{margin-left:10px}.ff-tree .ff-tree-node:not([expanded])>.ff-content{display:none}ff-tab-container{background:#343434}ff-tab-container,ff-dock-stack{background:#272727;border:1px solid #1b1b1b}ff-tab-container header,ff-dock-stack header{background:#1b1b1b}ff-tab-header,ff-dock-panel-header{background:#1b1b1b;color:#c8c8c8;padding:1px 3px 2px 2px}ff-tab-header[active],ff-dock-panel-header[active]{background:linear-gradient(#626262, #343434);color:#c8c8c8}ff-tab-header label,ff-dock-panel-header label{pointer-events:none}ff-tab-header .ff-text,ff-dock-panel-header .ff-text{padding:0 1px}ff-tab-header .ff-icon,ff-dock-panel-header .ff-icon{top:1px;height:0.8rem;padding:0 1px}.ff-dock-drop-marker{box-sizing:border-box;background:rgba(0,137,191,0.3);border:1px solid #0089bf}.ff-viewport-overlay{padding:6px;font-size:0.75rem}.ff-viewport-overlay .ff-row{display:flex;justify-content:space-between}.ff-viewport-overlay .ff-labels{display:flex;flex-direction:column}.ff-viewport-overlay .ff-top-left,.ff-viewport-overlay .ff-bottom-left{align-items:flex-start}.ff-viewport-overlay .ff-top-center,.ff-viewport-overlay .ff-bottom-center{align-items:center}.ff-viewport-overlay .ff-top-right,.ff-viewport-overlay .ff-bottom-right{align-items:flex-end}.ff-viewport-overlay .ff-label-box{box-sizing:border-box;padding:1px 8px 2px 8px;background:rgba(0,0,0,0.5);border-radius:2em}.sv-article h1{margin:0.3em 0;font-family:"Amiri", serif;font-size:2.3em;font-weight:normal;color:#e8e8e8}.sv-article h1:before{content:"";position:absolute;top:0;left:0;width:75px;height:5px;background-color:#0089bf}.sv-article p,.sv-article h2,.sv-article h3,.sv-article h4,.sv-article h5,.sv-article h6,.sv-article ul,.sv-article ol,.sv-article li{font-family:"Hind Siliguri", sans-serif;color:#c8c8c8}.sv-article h2,.sv-article h3,.sv-article h4,.sv-article h5,.sv-article h6{font-size:1.3em;margin:1.2em 0 0.8em 0}.sv-article p,.sv-article ul,.sv-article ol{font-size:1.15em;margin:0.8em 0}.sv-article p{line-height:1.55em}.sv-article ul{padding-inline-start:2.5em;list-style:disc outside}.sv-article ol{padding-inline-start:2.5em;list-style:decimal outside}.sv-article a:link,.sv-article a:visited,.sv-article a:hover,.sv-article a:active{color:#0089bf}.sv-article img{max-width:100%;height:auto}.sv-article figure{display:table;margin:1rem auto}.sv-article figure.align-left{float:left}.sv-article figure.align-right{float:right}.sv-article figure.image figcaption{color:#999;display:block;margin-top:0.25rem;text-align:center;-webkit-user-modify:read-only}.sv-content-view{font-family:"Segoe UI","HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;font-size:0.85em;line-height:1.35;color:#c8c8c8;background-color:#343434;position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;overflow:hidden;user-select:none;-moz-user-select:none;-webkit-user-select:none}.sv-logo{flex:0 50 180px;min-width:40px;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;overflow:hidden;height:40px;user-select:none}.sv-logo .sv-short{flex-grow:1;width:0;max-width:40px}.sv-logo .sv-full{flex:1 0 180px;display:flex;height:100%}.sv-logo .sv-full .sv-logo-full{flex:auto;height:100%}.ff-flex-spacer{user-select:none;-moz-user-select:none;-webkit-user-select:none}.sr-only{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}@keyframes spin{100%{transform:rotate(360deg)}}.sv-prompt,.sv-spinner{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;display:flex;justify-content:center;align-items:center;pointer-events:none}.sv-spinner-wheel{height:120px;width:120px;animation:spin 5s linear infinite}*{scrollbar-color:#676767 #1b1b1b;scrollbar-width:thin}* ::-webkit-scrollbar{width:8px;height:8px}* ::-webkit-scrollbar-track{background-color:#1b1b1b}* ::-webkit-scrollbar-thumb{background-color:#676767;border-radius:8px}voyager-explorer{font-size:16px}.sv-content-only .sv-scene-view,.sv-content-stack .sv-scene-view{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;cursor:grab}.sv-content-only .sv-scene-view:focus,.sv-content-stack .sv-scene-view:focus{border:2px solid #bfedff}.sv-content-only .sv-scene-view:focus:not(:focus-visible),.sv-content-stack .sv-scene-view:focus:not(:focus-visible){border:none;outline:0}.sv-content-only .sv-scene-view:focus-visible,.sv-content-stack .sv-scene-view:focus-visible{border:2px solid #bfedff}.sv-reader-container{overflow-y:auto}.sv-content-stack .sv-reader-container{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;margin-top:52px}.sv-content-stack .sv-reader-view{pointer-events:auto;display:flex;justify-content:center}.sv-content-stack .sv-reader-view .sv-left{flex:0 0 52px}.sv-content-stack .sv-reader-view .sv-article{flex:0 2 720px;background-color:rgba(27,34,38,0.5);padding-bottom:35px}.sv-content-stack .sv-reader-view .sv-right{flex:0 3 16px;background-color:rgba(27,34,38,0.5)}.sv-content-split{display:flex}.sv-content-split .sv-reader-container{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;margin-top:52px}.sv-content-split .sv-scene-view{flex:1 1 60%}.sv-content-split .sv-reader-view{pointer-events:auto;flex:1 1 40%;padding:0 20px}.sv-content-split .sv-reader-view .sv-left{flex:0 0 52px}.sv-content-split .sv-reader-view .sv-article{flex:0 2 720px;background-color:rgba(27,34,38,0.5);padding-bottom:35px;padding-right:16px}.sv-content-split .sv-reader-view .sv-right{flex:0 3 16px;background-color:rgba(27,34,38,0.5)}.sv-article{position:relative;padding:5px 8px 0 16px;user-select:text;-moz-user-select:text;-webkit-user-select:text}.ff-viewport-overlay{font-size:1.0em}.sv-scene-view{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;overflow:hidden}.sv-scene-view.sv-blur{filter:brightness(60%) blur(5px);transition:filter 0.5s}.sv-annotation{box-sizing:border-box;position:absolute;z-index:1;user-select:none;-moz-user-select:none;-webkit-user-select:none}.sv-annotation a:link,.sv-annotation a:visited,.sv-annotation a:hover,.sv-annotation a:active{color:#0089bf}.sv-annotation img{max-height:120px;max-width:100%}.sv-annotation .sv-img-credit{font-size:x-small}.sv-annotation-img{max-width:100%}.sv-circle-annotation{display:flex}.sv-circle-annotation.sv-expanded{z-index:2;width:16%;min-width:180px;max-width:280px}.sv-circle-annotation .sv-marker{background-color:rgba(0,0,0,0.65);border-radius:50%;text-align:center;height:18px;aspect-ratio:1/1;border-style:solid;border-width:1px;cursor:pointer;font-size:0.9em;color:#fff;-webkit-tap-highlight-color:transparent}.sv-circle-annotation .sv-annotation-body{padding:4px 8px;background-color:rgba(0,0,0,0.7);border-radius:4px;margin:0px 1px;width:100%}.sv-circle-annotation .sv-annotation-body .sv-title{padding:0 0 2px 0;font-weight:bold}.sv-circle-annotation .sv-annotation-body p{font-family:"Segoe UI","HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;font-size:0.88em;line-height:1.35;color:#c8c8c8;margin:0.5em 0}.sv-circle-annotation .sv-annotation-body .ff-button{background:rgba(0,0,0,0.01)}.sv-circle-annotation .sv-annotation-body .ff-button:hover{text-decoration:underline}.sv-circle-annotation .sv-annotation-body .sv-content{overflow:hidden;overflow-wrap:break-word}.sv-pin-annotation{padding:0 4px;background-color:rgba(0,0,0,0.5);color:#c8c8c8;transform:translate(-50%, -100%)}.sv-scale-annotation{opacity:0;transition:opacity 0.3s ease-in;position:absolute;color:black;background-color:white;font-weight:bold;border-radius:20px;padding-left:4px;padding-right:4px}.sv-scale-annotation.sv-show{opacity:1}.sv-standard-annotation,.sv-extended-annotation{max-width:20%;min-width:min-content;padding:0 4px;background-color:rgba(0,0,0,0.5);color:#c8c8c8;pointer-events:auto;overflow-wrap:normal}.sv-standard-annotation.sv-expanded,.sv-extended-annotation.sv-expanded{width:20%;min-width:180px;background-color:rgba(0,0,0,0.8);z-index:2}.sv-standard-annotation.sv-short,.sv-extended-annotation.sv-short{width:unset;min-width:min-content}.sv-standard-annotation.sv-q0,.sv-extended-annotation.sv-q0{transform:translate(0, -100%);border-bottom-style:solid;border-bottom-width:1px;text-align:left}.sv-standard-annotation.sv-q1,.sv-extended-annotation.sv-q1{transform:translate(-100%, -100%);border-bottom-style:solid;border-bottom-width:1px;text-align:right}.sv-standard-annotation.sv-q2,.sv-extended-annotation.sv-q2{transform:translate(-100%, 0);border-top-style:solid;border-top-width:1px;text-align:right}.sv-standard-annotation.sv-q3,.sv-extended-annotation.sv-q3{transform:translate(0, 0);border-top-style:solid;border-top-width:1px;text-align:left}.sv-standard-annotation.sv-static-width,.sv-extended-annotation.sv-static-width{width:fit-content}.sv-standard-annotation .sv-title,.sv-extended-annotation .sv-title{padding:1px 0 2px 0;font-weight:bold;-webkit-tap-highlight-color:transparent}.sv-standard-annotation .sv-content,.sv-extended-annotation .sv-content{padding:2px 0;height:0;overflow:hidden;overflow-wrap:break-word;transition:height 0.2s}.sv-standard-annotation p,.sv-extended-annotation p{font-family:"Segoe UI","HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;font-size:0.88em;line-height:1.35;color:#c8c8c8;margin:0.5em 0}.sv-standard-annotation .ff-button,.sv-extended-annotation .ff-button{background:rgba(0,0,0,0.01)}.sv-standard-annotation .ff-button .ff-icon,.sv-extended-annotation .ff-button .ff-icon{fill:#a0a0a0}.sv-standard-annotation .ff-button:hover,.sv-extended-annotation .ff-button:hover{text-decoration:underline}.sv-extended-annotation .sv-title{cursor:pointer}.sv-standard-annotation{pointer-events:none}.sv-standard-annotation.sv-enable-events{pointer-events:auto;cursor:pointer}.sv-annotation-overlay{padding:7px;pointer-events:auto;background-color:rgba(54,61,64,0.6);max-width:min(80%, 800px);min-width:50%;max-height:90%;overflow-y:auto;cursor:auto}.sv-annotation-overlay .sv-annotation-body .ff-button{background:rgba(0,0,0,0.01)}.sv-annotation-overlay .sv-annotation-body .ff-button:hover{text-decoration:underline}.sv-ar-prompt{flex:1 1 auto;display:flex;flex-direction:column;align-items:center;text-align:center;border-radius:20px;margin:30% 0 0 0;overflow:hidden;background-color:rgba(54,61,64,0.6)}.sv-ar-prompt .sv-content{flex:1;width:100%;margin:10px 10px;text-align:center;-webkit-user-select:none;-ms-user-select:none;user-select:none}.sv-ar-prompt .sv-content .sv-ar-icon{height:10em}.sv-ar-menu{display:flex;position:absolute;bottom:0px;flex-direction:row;margin:0 0 6px 6px}.sv-ar-menu>.ff-button{box-sizing:border-box;-webkit-tap-highlight-color:transparent;width:38px;height:38px;margin:0 6px 2px 0;background-color:rgba(74,82,87,0.5);border-radius:20px;font-size:17px;transition:all .15s;pointer-events:auto}.sv-ar-menu>.ff-button:hover,.sv-ar-menu>.ff-button:focus{outline:none;background-color:rgba(74,82,87,0.5);fill:#c8c8c8}.sv-ar-menu>.ff-button[selected]{background-color:#0089bf;color:#f0f0f0}.sv-ar-menu>.ff-button[selected]>.ff-icon{filter:drop-shadow(1px 1px 6px #00648c);fill:#c8c8c8}.sv-ar-menu>.ff-button[selected]:hover,.sv-ar-menu>.ff-button[selected]:focus{background-color:#00a6e8}.sv-ar-code{position:relative;width:420px;max-width:85%;max-height:90%;padding:8px;background:#343434;box-shadow:0 0 20px rgba(0,0,0,0.35);pointer-events:auto}.sv-ar-code .ff-title{margin:0.5em 0 1em 0}.sv-ar-code .ff-title .ff-icon{height:2em;width:2em;padding:2px;border-radius:20px;background-color:rgba(74,82,87,0.5)}.sv-ar-code img{height:250px;margin:auto}.sv-chrome-view{font-family:"Segoe UI","HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;font-size:0.85em;line-height:1.35;color:#c8c8c8;position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;overflow:hidden;display:flex;flex-direction:column;background:linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.15) 10%, transparent 25%);z-index:3}.sv-chrome-view .ff-button{flex:0 1 auto;box-sizing:border-box}.sv-chrome-view .ff-button:focus{outline:none;box-shadow:0 0 3pt 2pt #bfedff}.sv-chrome-view .ff-button:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-chrome-view .ff-button:focus-visible{outline:none;box-shadow:0 0 3pt 2pt #bfedff}.sv-chrome-view .ff-button:hover{outline:none}.sv-chrome-view .ff-button:hover>.ff-icon{fill:#c8c8c8}.sv-chrome-view .ff-button[selected]{background-color:#0089bf}.sv-chrome-view .ff-button[selected][disabled]{background-color:#4e4e4e}.sv-chrome-view .ff-button[selected]>.ff-icon{filter:drop-shadow(1px 1px 6px #00648c);fill:#c8c8c8}.sv-chrome-header{display:flex;align-items:flex-start;height:100%;position:relative}.sv-chrome-header .sv-top-bar{flex:1 1 auto;display:flex;align-items:flex-start;height:40px;margin:9px 9px 0 0;overflow:hidden}.sv-chrome-header .sv-main-title{flex:1 1 auto;margin:6px 8px;font-family:"Hind Siliguri", sans-serif;font-weight:normal;font-size:1.412em;white-space:pre;color:#e8e8e8;user-select:none;-moz-user-select:none;-webkit-user-select:none}.sv-chrome-header .sv-main-title span{color:transparent}.sv-chrome-footer{display:block;position:absolute;bottom:0;right:0}.sv-chrome-footer .sv-bottom-bar{flex:1 1 auto;display:flex;align-items:flex-end;text-align:right;overflow:hidden}.sv-chrome-footer .sv-bottom-bar>.ff-button{margin:6px 6px 6px 5px;box-sizing:border-box;-webkit-tap-highlight-color:transparent;width:38px;height:38px;background-color:rgba(31,36,38,0.8);border-radius:20px;font-size:17px;transition:all .15s;pointer-events:auto}.sv-chrome-footer .sv-bottom-bar>.ff-button .ff-text{color:#a0a0a0}.sv-chrome-footer .sv-bottom-bar>.ff-button:focus{outline:none;background-color:rgba(31,36,38,0.8);box-shadow:0 0 3pt 2pt #bfedff}.sv-chrome-footer .sv-bottom-bar>.ff-button:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-chrome-footer .sv-bottom-bar>.ff-button:focus-visible{outline:none;background-color:rgba(31,36,38,0.8);box-shadow:0 0 3pt 2pt #bfedff}.sv-chrome-footer .sv-bottom-bar>.ff-button:hover{background-color:rgba(74,82,87,0.5);fill:#c8c8c8}.sv-chrome-footer .sv-bottom-bar>.ff-button:hover>.ff-text{color:#c8c8c8}.sv-chrome-footer .sv-bottom-bar>.ff-button[selected]{background-color:#0089bf;color:#f0f0f0}.sv-chrome-footer .sv-bottom-bar>.ff-button[selected]>.ff-icon{filter:drop-shadow(1px 1px 6px #00648c);fill:#c8c8c8}.sv-chrome-footer .sv-bottom-bar>.ff-button[selected]:hover,.sv-chrome-footer .sv-bottom-bar>.ff-button[selected]:focus{background-color:#00a6e8}.sv-chrome-footer .sv-text-icon{font-family:"Hind Siliguri", sans-serif;font-weight:bold;line-height:25px}.sv-main-menu-wrapper{position:relative;height:100%;min-width:50px}.sv-main-menu{display:flex;flex-direction:column;padding:6px 9px 6px 6px;height:100%;overflow-y:auto;overflow-x:hidden;pointer-events:auto;position:absolute;box-sizing:border-box;overscroll-behavior-y:contain}.sv-main-menu>.ff-button{margin:2px 0;box-sizing:border-box;-webkit-tap-highlight-color:transparent;width:38px;height:38px;background-color:rgba(31,36,38,0.8);border-radius:20px;font-size:17px;transition:all .15s;pointer-events:auto}.sv-main-menu>.ff-button .ff-text{color:#a0a0a0}.sv-main-menu>.ff-button:focus{outline:none;background-color:rgba(31,36,38,0.8);box-shadow:0 0 3pt 2pt #bfedff}.sv-main-menu>.ff-button:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-main-menu>.ff-button:focus-visible{outline:none;background-color:rgba(31,36,38,0.8);box-shadow:0 0 3pt 2pt #bfedff}.sv-main-menu>.ff-button:hover{background-color:rgba(74,82,87,0.5);fill:#c8c8c8}.sv-main-menu>.ff-button:hover>.ff-text{color:#c8c8c8}.sv-main-menu>.ff-button[selected]{background-color:#0089bf;color:#f0f0f0}.sv-main-menu>.ff-button[selected]>.ff-icon{filter:drop-shadow(1px 1px 6px #00648c);fill:#c8c8c8}.sv-main-menu>.ff-button[selected]:hover,.sv-main-menu>.ff-button[selected]:focus{background-color:#00a6e8}.sv-main-menu .sv-scroll-btn{border-radius:2px;font-size:10px;height:19px;background-color:#343434;z-index:2;padding:0px;position:sticky}.sv-main-menu .sv-scroll-btn.up{top:0px;margin-top:0px}.sv-main-menu .sv-scroll-btn.down{bottom:12px;margin-top:12px}.sv-main-menu .sv-scroll-btn:hover{background-color:#676767;fill:#c8c8c8}.sv-main-menu .sv-scroll-btn:focus,.sv-main-menu .sv-scroll-btn:focus-visible{background-color:#343434}.sv-share-menu{position:relative;width:450px;max-width:85%;padding:8px;background:#343434;box-shadow:0 0 20px rgba(0,0,0,0.35);pointer-events:auto}.sv-share-menu .ff-title{margin:0.5em 0 1em 0}.sv-share-menu .ff-button{flex:0 0 auto}.sv-share-menu .ff-text-edit{height:6.5em}.sv-share-menu .sv-share-buttons .ff-button{width:48px;height:48px;border-radius:48px;margin:0 1em 1em 0;padding:0}.sv-share-menu .sv-share-buttons .ff-button .ff-icon{height:30px;fill:#f0f0f0}.sv-share-menu .sv-share-button-twitter{background-color:#00aced}.sv-share-menu .sv-share-button-twitter:focus{outline:none;background-color:#00aced;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-twitter:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-share-menu .sv-share-button-twitter:focus-visible{outline:none;background:#00aced;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-twitter:hover{background-color:#21c2ff}.sv-share-menu .sv-share-button-facebook{background-color:#3c5a99}.sv-share-menu .sv-share-button-facebook:focus{outline:none;background-color:#3c5a99;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-facebook:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-share-menu .sv-share-button-facebook:focus-visible{outline:none;background:#3c5a99;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-facebook:hover{background-color:#4e71ba}.sv-share-menu .sv-share-button-linkedin{background-color:#0077B5}.sv-share-menu .sv-share-button-linkedin:focus{outline:none;background-color:#0077B5;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-linkedin:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-share-menu .sv-share-button-linkedin:focus-visible{outline:none;background:#0077B5;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-linkedin:hover{background-color:#0099e8}.sv-share-menu .sv-share-button-email{background-color:#d28842}.sv-share-menu .sv-share-button-email:focus{outline:none;background-color:#d28842;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-email:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-share-menu .sv-share-button-email:focus-visible{outline:none;background:#d28842;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-email:hover{background-color:#dca26b}.sv-document-overlay{position:absolute;left:52px;top:52px;right:6px;bottom:0;pointer-events:auto}.sv-tour-menu .sv-article,.sv-reader-view .sv-article{position:relative}.sv-tour-menu .sv-article .sv-nav-button,.sv-reader-view .sv-article .sv-nav-button{float:right;margin:1em 0.5em;padding:2px}.sv-tour-menu .sv-article .sv-nav-button .ff-icon,.sv-reader-view .sv-article .sv-nav-button .ff-icon{height:1.5em}.sv-tour-menu .sv-entry,.sv-reader-view .sv-entry{position:relative;cursor:pointer;padding:5px 0 5px 15px;margin:2px 2px 16px 2px;max-width:960px;background-color:rgba(27,34,38,0.5)}.sv-tour-menu .sv-entry:hover,.sv-reader-view .sv-entry:hover{background-color:rgba(51,59,64,0.5)}.sv-tour-menu .sv-entry .sv-titlebar,.sv-reader-view .sv-entry .sv-titlebar{display:flex}.sv-tour-menu .sv-entry .ff-icon,.sv-reader-view .sv-entry .ff-icon{margin:auto 10px auto auto;height:1.5em;border-radius:60px;border-style:solid;box-shadow:0 0 2px #a0a0a0;padding:0.6em 0.6em}.sv-option-menu{position:relative;width:225px;max-width:85%;height:200px;max-height:85%;padding:8px;background:#343434;box-shadow:0 0 20px rgba(0,0,0,0.35);pointer-events:auto}.sv-option-menu .ff-title{margin:0.3em 0 0.3em 0.3em}.sv-option-menu .ff-header{padding:0.3em 0 0.3em 0.3em;background:rgba(31,36,38,0.8)}.sv-option-menu .ff-button{flex:0 0 auto}.sv-option-menu .sv-scroll-offset{top:50px}.sv-option-menu .sv-centered{justify-content:center;padding:0.3em 0 0.3em 0.3em}.sv-option-menu .sv-entry{position:relative;cursor:pointer;padding:5px 0 5px 15px;margin-bottom:2px;max-width:960px;background-color:rgba(27,34,38,0.5);user-select:none;-moz-user-select:none;-webkit-user-select:none}.sv-option-menu .sv-entry:focus{outline:2px solid #bfedff;outline-offset:-2px;background-color:rgba(27,34,38,0.5)}.sv-option-menu .sv-entry:focus:not(:focus-visible){outline:0}.sv-option-menu .sv-entry:focus-visible{outline:2px solid #bfedff;outline-offset:-2px;background-color:rgba(27,34,38,0.5)}.sv-option-menu .sv-entry:hover{background-color:rgba(51,59,64,0.5);fill:#c8c8c8}.sv-option-menu .sv-entry[selected]{background-color:#0089bf;color:#f0f0f0}.sv-option-menu .sv-entry[selected]:hover,.sv-option-menu .sv-entry[selected]:focus{background-color:#00a6e8}.sv-main-help{position:relative;width:90%;height:90%;padding:8px;background:#343434;pointer-events:auto}.sv-main-help .sv-help-section{display:flex;text-align:center;width:33%;min-width:180px;max-height:90%;flex-direction:column;justify-content:center;margin-top:20px;margin-bottom:20px}.sv-main-help .sv-help-short{min-width:100px}.sv-main-help .sv-help-row{display:flex;flex-wrap:wrap;height:90%;justify-content:center;overflow:auto}.sv-main-help .sv-help-text{padding:5px 5px 0px 5px;display:flex;align-items:center;justify-content:center}.sv-main-help .sv-help-region{height:100%;display:flex;flex-direction:column}.sv-main-help .ff-icon{height:2rem}.sv-main-help .sv-commands{flex:0 0 auto;display:flex;flex-wrap:wrap;padding:2px}.sv-main-help .sv-commands .ff-button{width:50%;min-width:100px}.sv-bottom-bar-container{position:relative;display:flex;justify-content:center;transition:transform .3s ease-out,opacity .15s ease-out;z-index:1}.sv-bottom-bar-container.sv-transition{transform:translateY(40px);opacity:0}.sv-bottom-bar-container .ff-button{transition:all .15s}.sv-blue-bar{flex:0 1 960px;display:flex;flex-direction:column;background-color:rgba(5,7,8,0.85);border-left:1px solid rgba(0,137,191,0.5);border-right:1px solid rgba(0,137,191,0.5);margin:0 -1px 0 -1px;min-width:0px;pointer-events:auto;user-select:none;-moz-user-select:none;-webkit-user-select:none}.sv-blue-bar .sv-group{display:flex;flex-direction:column}.sv-blue-bar .sv-section{position:relative;display:flex;flex-direction:row;border-top:1px solid rgba(0,137,191,0.5)}.sv-blue-bar .sv-section-lead,.sv-blue-bar .sv-section-trail{flex:0 0 auto;padding:6px;width:38px}.sv-blue-bar .sv-section-lead:hover,.sv-blue-bar .sv-section-trail:hover{background-color:rgba(74,82,87,0.5)}.sv-blue-bar .sv-section-lead{border-right:1px solid rgba(0,137,191,0.5)}.sv-blue-bar .sv-section-trail{border-left:1px solid rgba(0,137,191,0.5)}.sv-blue-bar .sv-transparent-button{flex:0 1 auto;padding:6px;border-radius:2px}.sv-blue-bar .sv-transparent-button .ff-text{margin:1px 2px}.sv-blue-bar .sv-transparent-button .ff-icon{height:22px;margin:1px 2px}.sv-tour-navigator{color:#c8c8c8}.sv-tour-navigator .sv-content{flex:1;margin:2px 8px;text-align:center}.sv-tour-navigator .sv-title{font-size:1.1em}@keyframes ticker{100%{transform:translateX(var(--x-offset))}}.sv-tour-navigator .sv-text{font-size:0.9em}.sv-text-scroll{animation:ticker 1s linear 1;text-overflow:clip}.sv-target-navigator .sv-content{flex:1;margin:2px 8px;text-align:center}.sv-target-navigator .sv-title{font-size:1.1em}.sv-tag-cloud .sv-tag-buttons{flex:1 1 auto;display:flex;flex-wrap:wrap;justify-content:center;margin:4px}.sv-tag-cloud .sv-tag-button{flex:0 1 auto;margin:3px 3px;padding:2px 4px;background-color:rgba(31,36,38,0.8);border-radius:3px;font-size:0.88em}.sv-tag-cloud .sv-tag-button:hover{background-color:rgba(74,82,87,0.5)}.sv-tag-cloud .sv-tag-button[selected]{background-color:#0089bf}.sv-tag-cloud .sv-tag-button .ff-text{margin:1px 2px}.sv-tag-cloud .sv-tag-button .ff-icon{height:22px;margin:1px 2px}.sv-property .ff-input{min-width:auto;width:0;margin:0;padding:2px}.sv-property .ff-input,.sv-property select{text-align:right;background-image:none;appearance:auto}.sv-property .ff-input:focus,.sv-property select:focus{text-align:left}.sv-property.sv-property-color input[type="color"]{cursor:pointer;border:none;margin:2px;height:26px;inline-size:26px;padding:1px;background:#343434;border-radius:2px}.sv-property.sv-property-color input[type="color"]::-webkit-color-swatch-wrapper{padding:0}.sv-property.sv-property-color input[type="color"]::-webkit-color-swatch,.sv-property.sv-property-color input[type="color"]::-moz-color-swatch{border:none;border-radius:2px}.sv-property.sv-property-number .sv-property-field{position:relative;touch-action:none;display:inline-flex}.sv-property.sv-property-number .sv-property-field .ff-bar{background:#272727;position:absolute;inset:0;margin:0;width:0;box-sizing:border-box;border:2px solid #1b1b1b}.sv-property.sv-property-number .sv-property-field .ff-input,.sv-property.sv-property-number .sv-property-field .ff-unit{position:relative;touch-action:none}.sv-property.sv-property-number .sv-property-field .ff-bar,.sv-property.sv-property-number .sv-property-field .ff-unit{pointer-events:none;user-select:none}.sv-property.sv-property-slider{flex:0 2 180px}.sv-property.sv-property-slider .ff-linear-slider{height:6px;margin:12px 2px;padding-right:16px;border-radius:2px;background-color:#4e4e4e}.sv-property.sv-property-slider .ff-linear-slider .ff-knob{width:16px;height:26px;margin:-10px 0 0 0;border-radius:2px;background-color:#0089bf;box-shadow:0 0 6px black}.sv-property.sv-property-options .sv-options-buttons{display:flex;flex-wrap:wrap;justify-content:center;padding:2px 0;gap:2px}.sv-property.sv-property-options .sv-options-buttons .ff-button.ff-control{flex:0 1 auto}.sv-tool-bar{color:#c8c8c8;pointer-events:auto}.sv-tool-bar .sv-tool-buttons{flex:1 1 auto;display:flex;margin:4px;overflow-x:auto}.sv-tool-bar .sv-tool-buttons .sv-tool-button:first-child{margin-left:auto}.sv-tool-bar .sv-tool-buttons .sv-tool-button:last-child{margin-right:auto}.sv-tool-bar .sv-tool-button{flex:0 1 auto;margin:2px;padding:1px 2px;border-radius:3px;font-size:0.882em}.sv-tool-bar .sv-tool-button .ff-text{margin:1px 2px}.sv-tool-bar .sv-tool-button .ff-icon{height:22px;margin:1px 2px}.sv-tool-bar-container{position:relative;bottom:0px;width:100%}.sv-tool-controls{flex:1 1 auto;display:flex;justify-content:center;align-items:center;font-size:0.882em}.sv-tool-controls .sv-property{flex:0 1 auto;align-self:start;display:flex;flex-direction:column;margin:4px}.sv-tool-controls .sv-property label{height:1.25em}.sv-tool-controls .sv-property.sv-nogap{margin:4px 0 !important}.sv-tool-controls .sv-property.sv-property-slider{flex:0 2 180px}.sv-tool-controls .sv-options{display:flex}.sv-tool-controls .ff-label{margin:2px}.sv-tool-controls .ff-string{flex:0 1 auto;height:26px;margin:2px;font-size:1.34em}.sv-tool-controls .ff-button{height:26px;margin:2px;padding:0 4px;background:#343434;border-radius:2px}.sv-tool-controls .ff-button:focus{outline:none;background:#343434;box-shadow:0 0 3pt 2pt #bfedff}.sv-tool-controls .ff-button:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-tool-controls .ff-button:focus-visible{outline:none;background:#343434;box-shadow:0 0 3pt 2pt #bfedff}.sv-tool-controls .ff-button:hover{background-color:#676767;fill:#c8c8c8}.sv-view-tool-view .sv-options,.sv-render-tool-view .sv-options,.sv-light-tool-view .sv-options{flex-wrap:wrap}.sv-tape-tool-view .sv-tool-controls,.sv-slice-tool-view .sv-tool-controls,.sv-environment-tool-view .sv-tool-controls{flex-wrap:wrap}.sv-action-prompt{height:30px;width:30px;fill:#fff}.sv-caption-view{position:absolute;bottom:10%;z-index:2;font-size:1.5rem;justify-content:center;display:flex;width:100%}.sv-caption-box{position:relative;text-align:center;background-color:rgba(0,0,0,0.85);max-width:85%}.sv-splash{padding:7px;pointer-events:auto;background-color:rgba(54,61,64,0.6);max-width:min(80%, 800px);min-width:50%;max-height:90%;overflow-y:auto}.sv-splash>:focus-visible{outline:none;box-shadow:0 0}.sv-audio-view{display:flex;align-items:center;flex:1 1 auto;max-width:100%;min-width:110px;height:30px;background-color:#f0f0f0;border-radius:15px;color:black;cursor:auto}.sv-audio-view>.ff-button{width:30px;height:30px;border-radius:15px;flex:0 1 auto;padding:0px;margin-right:3px;background-color:#f0f0f0;-webkit-tap-highlight-color:transparent}.sv-audio-view>.ff-button .ff-icon{height:1.5em;margin:5px;fill:black}.sv-audio-view>.ff-button:focus{background-color:#f0f0f0}.sv-audio-view>.ff-button:hover{background-color:#a4a4a4}.sv-audio-view>.ff-button:hover>.ff-icon{fill:black}.sv-audio-view .sv-timer{font-size:small;display:flex}.sv-audio-view input{width:100%;margin-left:3px;margin-right:3px}.sv-narrate-player{position:absolute;pointer-events:auto;width:200px;max-width:75%;margin:auto auto;left:0;right:0;z-index:4;padding-top:6px}\n',e.appendChild(t);const n=this.application.system;e.appendChild(new Q(n)),e.appendChild(new Ge(n));const i=document.createElement("div");i.setAttribute("id",l.ZP.stackId),e.appendChild(i),l.ZP.shadowRootNode=e;const s=document.createElement("div");s.classList.add("sr-only"),s.setAttribute("id","sr-intro"),s.setAttribute("aria-live","polite"),e.appendChild(s)}connected(){this.fullscreen.fullscreenElement=this,this.viewer.rootElement=this,this.arManager.shadowRoot=this.shadowRoot}disconnected(){super.disconnected(),this.fullscreen.fullscreenElement=null,this.viewer.rootElement=null,window.VoyagerStory||(this.application.dispose(),this.application=null)}attributeChangedCallback(e,t,n){const i=this.application;if(super.attributeChangedCallback(e,t,n),i&&"root"===e){const e=this.getAttribute("root");e.length>0&&(i.props.root=e,i.reloadDocument(),this.connected())}else i&&"document"===e?(i.props.document=this.getAttribute("document"),i.reloadDocument(),this.connected()):i&&"controls"===e&&i.enableNavigation(n)}onFocus(){this.shadowRoot.getElementById("sr-intro").innerText="The Voyager web application allows you to view and interact with a 3D model from the Smithsonian collection. Use the tab key to move through interactive elements, enter or spacebar keys to activate, and the escape key to exit menus."}toggleAnnotations(){this.application&&this.application.toggleAnnotations()}toggleReader(){this.application&&this.application.toggleReader()}toggleTours(){this.application&&this.application.toggleTours()}toggleTools(){this.application&&this.application.toggleTools()}toggleMeasurement(){this.application&&this.application.toggleMeasurement()}enableAR(){this.application&&this.application.enableAR()}getArticles(){if(this.application){return this.application.getArticles()}}getAnnotations(){if(this.application){return this.application.getAnnotations()}}getCameraOrbit(e){if(this.application){return this.application.getCameraOrbit(e||null)}}setCameraOrbit(e,t){this.application&&this.application.setCameraOrbit(e,t)}getCameraOffset(e){if(this.application){return this.application.getCameraOffset(e||null)}}setCameraOffset(e,t,n){this.application&&this.application.setCameraOffset(e,t,n)}setBackgroundColor(e,t){this.application&&this.application.setBackgroundColor(e,t||null)}setBackgroundStyle(e){this.application&&this.application.setBackgroundStyle(e)}setActiveAnnotation(e){this.application&&this.viewer.ins.activeAnnotation.setValue(e)}setActiveArticle(e){this.application&&this.application.setActiveArticle(e)}setTourStep(e,t,n){this.application&&this.application.setTourStep(e,t,void 0===n||n)}setLanguage(e){this.application&&this.application.setLanguage(e)}};We=Ze([(0,o.Mo)("voyager-explorer")],We);const qe=We},11598:(e,t,n)=>{"use strict";n.d(t,{Cb:()=>i.Cb,Mo:()=>i.Mo,ZP:()=>o,dy:()=>i.dy});var i=n(51120),s=n(31491),r=n(47425);class o extends r.ZP{constructor(){super(...arguments),this.activeNode=null}get nodeProvider(){return this.system.getMainComponent(s.Z)}connected(){super.connected();const e=this.nodeProvider;e.on("active-node",this.onActiveNodeEvent,this),e.activeNode&&(this.activeNode=e.activeNode,this.onActiveNode(null,e.activeNode))}disconnected(){const e=this.nodeProvider;e.off("active-node",this.onActiveNodeEvent,this),e.activeNode&&(this.activeNode=null,this.onActiveNode(e.activeNode,null)),super.disconnected()}onActiveNode(e,t){this.requestUpdate()}onActiveNodeEvent(e){this.activeNode=e.next,this.onActiveNode(e.previous,e.next)}}},88300:(e,t,n)=>{"use strict";n.d(t,{k:()=>r,u:()=>s});var i=n(82587);function s(e,t,n){return Math.min(Math.max(e,t),n)}function r(e,t){var n=new i.y,s=new i.y;n.identity();do{s.compose(t.position,t.quaternion,t.scale),n.multiply(s.invert()),t=t.parent}while(e!==t);return n}},53310:(e,t,n)=>{"use strict";n.d(t,{G:()=>i,e:()=>s});function i(e){return[...e.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])')].filter((e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden")&&"-1"!==e.getAttribute("tabindex")))}function s(e,t){const n=e[0],i=e[e.length-1];t.shiftKey?t.target===n&&(t.preventDefault(),i.focus()):t.target===i&&(t.preventDefault(),n.focus())}},15577:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(1594);const s={mm:{mm:1,cm:.1,m:.001,km:1,in:.0393701,ft:.00328084,yd:.00109361,mi:1},cm:{mm:10,cm:1,m:.01,km:1,in:.393701,ft:.0328084,yd:.0109361,mi:1},m:{mm:1e3,cm:100,m:1,km:1,in:39.3701,ft:3.28084,yd:1.09361,mi:1},km:{mm:1e6,cm:1e5,m:1e3,km:1,in:39370.1,ft:3280.84,yd:1093.61,mi:1},in:{mm:25.4,cm:2.54,m:.0254,km:1,in:1,ft:.0833333,yd:.0277778,mi:1},ft:{mm:304.8,cm:30.48,m:.3048,km:1,in:12,ft:1,yd:.333334,mi:1},yd:{mm:914.4,cm:91.44,m:.9144,km:1,in:36,ft:3,yd:1,mi:1},mi:{mm:1609e3,cm:160900,m:1609,km:1,in:63346456.693,ft:5278871.391,yd:1759623.797,mi:1}};function r(e,t){const n=i.f_[e],r=i.f_[t];return s[n][r]||1}},19853:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(10613),s=n(53868);const r=new WeakMap,o=(0,s.XM)((e=>t=>{if(!(t instanceof s.nt))throw new Error("unsafeHTML can only be used in text bindings");const n=r.get(t);if(void 0!==n&&(0,i.pt)(e)&&e===n.value&&t.value===n.fragment)return;const o=document.createElement("template");o.innerHTML=e;const a=document.importNode(o.content,!0);t.setValue(a),r.set(t,{value:e,fragment:a})}))},25352:(e,t,n)=>{"use strict";n.d(t,{X:()=>s,w:()=>r});const i=new WeakMap,s=e=>(...t)=>{const n=e(...t);return i.set(n,!0),n},r=e=>"function"==typeof e&&i.has(e)},93909:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,eC:()=>i,r4:()=>r});const i="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,s=(e,t,n=null,i=null)=>{for(;t!==n;){const n=t.nextSibling;e.insertBefore(t,i),t=n}},r=(e,t,n=null)=>{for(;t!==n;){const n=t.nextSibling;e.removeChild(t),t=n}}},66390:(e,t,n)=>{"use strict";n.d(t,{J:()=>i,L:()=>s});const i={},s={}},10613:(e,t,n)=>{"use strict";n.d(t,{JG:()=>m,K1:()=>y,QG:()=>d,_l:()=>u,m:()=>f,nt:()=>p,pt:()=>c,sL:()=>g});var i=n(25352),s=n(93909),r=n(66390),o=n(66825),a=n(47275),l=n(14056);const c=e=>null===e||!("object"==typeof e||"function"==typeof e),h=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class d{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(let e=0;e{try{const e={get capture(){return v=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class y{constructor(e,t,n){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=n,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;(0,i.w)(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=r.J,e(this)}if(this.__pendingValue===r.J)return;const e=this.__pendingValue,t=this.value,n=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),s=null!=e&&(null==t||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=b(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=r.J}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const b=e=>e&&(v?{capture:e.capture,passive:e.passive,once:e.once}:e.capture)},44574:(e,t,n)=>{"use strict";n.d(t,{L:()=>o,s:()=>a});var i=n(93909),s=n(10613),r=n(41998);const o=new WeakMap,a=(e,t,n)=>{let a=o.get(t);void 0===a&&((0,i.r4)(t,t.firstChild),o.set(t,a=new s.nt(Object.assign({templateFactory:r.t},n))),a.appendInto(t)),a.setValue(e),a.commit()}},41998:(e,t,n)=>{"use strict";n.d(t,{r:()=>r,t:()=>s});var i=n(14056);function s(e){let t=r.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},r.set(e.type,t));let n=t.stringsArray.get(e.strings);if(void 0!==n)return n;const s=e.strings.join(i.Jw);return n=t.keyString.get(s),void 0===n&&(n=new i.YS(e,e.getTemplateElement()),t.keyString.set(s,n)),t.stringsArray.set(e.strings,n),n}const r=new Map},66825:(e,t,n)=>{"use strict";n.d(t,{R:()=>r});var i=n(93909),s=n(14056);class r{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this.options=n}update(e){let t=0;for(const n of this.__parts)void 0!==n&&n.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=i.eC?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],n=this.template.parts,r=document.createTreeWalker(e,133,null,!1);let o,a=0,l=0,c=r.nextNode();for(;a{"use strict";n.d(t,{j:()=>o});n(93909);var i=n(14056);const s=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:e=>e}),r=` ${i.Jw} `;class o{constructor(e,t,n,i){this.strings=e,this.values=t,this.type=n,this.processor=i}getHTML(){const e=this.strings.length-1;let t="",n=!1;for(let s=0;s-1||n)&&-1===e.indexOf("--\x3e",o+1);const a=i.W5.exec(e);t+=null===a?e+(n?r:i.N):e.substr(0,a.index)+a[1]+a[2]+i.$E+a[3]+i.Jw}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==s&&(t=s.createHTML(t)),e.innerHTML=t,e}}},14056:(e,t,n)=>{"use strict";n.d(t,{$E:()=>o,IW:()=>h,Jw:()=>i,N:()=>s,W5:()=>d,YS:()=>a,pC:()=>c});const i=`{{lit-${String(Math.random()).slice(2)}}}`,s=`\x3c!--${i}--\x3e`,r=new RegExp(`${i}|${s}`),o="$lit$";class a{constructor(e,t){this.parts=[],this.element=t;const n=[],s=[],a=document.createTreeWalker(t.content,133,null,!1);let c=0,u=-1,p=0;const{strings:m,values:{length:f}}=e;for(;p0;){const t=m[p],n=d.exec(t)[2],i=n.toLowerCase()+o,s=e.getAttribute(i);e.removeAttribute(i);const a=s.split(r);this.parts.push({type:"attribute",index:u,name:n,strings:a}),p+=a.length-1}}"TEMPLATE"===e.tagName&&(s.push(e),a.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(i)>=0){const i=e.parentNode,s=t.split(r),a=s.length-1;for(let t=0;t{const n=e.length-t.length;return n>=0&&e.slice(n)===t},c=e=>-1!==e.index,h=()=>document.createComment(""),d=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/},53868:(e,t,n)=>{"use strict";n.d(t,{_l:()=>i._l,JG:()=>i.JG,K1:()=>i.K1,nt:()=>i.nt,sL:()=>i.sL,IW:()=>c.IW,XM:()=>o.X,dy:()=>h,r4:()=>a.r4,sY:()=>l.s,V:()=>a.V});var i=n(10613);const s=new class{handleAttributeExpressions(e,t,n,s){const r=t[0];if("."===r){return new i.m(e,t.slice(1),n).parts}if("@"===r)return[new i.K1(e,t.slice(1),s.eventContext)];if("?"===r)return[new i.JG(e,t.slice(1),n)];return new i.QG(e,t,n).parts}handleTextExpression(e){return new i.nt(e)}};var r=n(47275),o=n(25352),a=n(93909),l=(n(66390),n(44574)),c=(n(41998),n(66825),n(14056));"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const h=(e,...t)=>new r.j(e,t,"html",s)},60531:(e,t,n)=>{"use strict";n.d(t,{H:()=>s});var i=n(67440);class s extends i.c{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}},68347:(e,t,n)=>{"use strict";n.d(t,{V:()=>o});var i=n(75544),s=n(82587),r=n(25499);class o extends r.T{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new s.y,this.projectionMatrix=new s.y,this.projectionMatrixInverse=new s.y,this.coordinateSystem=i._RZ}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}},53203:(e,t,n)=>{"use strict";n.d(t,{_:()=>a});var i=n(75544),s=n(25499),r=n(67440);const o=-90;class a extends s.T{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new r.c(o,1,e,t);i.layers=this.layers,this.add(i);const s=new r.c(o,1,e,t);s.layers=this.layers,this.add(s);const a=new r.c(o,1,e,t);a.layers=this.layers,this.add(a);const l=new r.c(o,1,e,t);l.layers=this.layers,this.add(l);const c=new r.c(o,1,e,t);c.layers=this.layers,this.add(c);const h=new r.c(o,1,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,s,r,o,a,l]=t;for(const e of t)this.remove(e);if(e===i._RZ)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else{if(e!==i.JCZ)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,r,o,a,l,c]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),u=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,s),e.setRenderTarget(n,1,i),e.render(t,r),e.setRenderTarget(n,2,i),e.render(t,o),e.setRenderTarget(n,3,i),e.render(t,a),e.setRenderTarget(n,4,i),e.render(t,l),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,i),e.render(t,c),e.setRenderTarget(h,d,u),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}},62257:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var i=n(68347);class s extends i.V{constructor(e=-1,t=1,n=1,i=-1,s=.1,r=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=r,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,r){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,r=n+e,o=i+t,a=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=e*this.view.offsetX,r=s+e*this.view.width,o-=t*this.view.offsetY,a=o-t*this.view.height}this.projectionMatrix.makeOrthographic(s,r,o,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}},67440:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var i=n(68347),s=n(71050);class r extends i.V{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*s.I3*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*s.qW*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*s.I3*Math.atan(Math.tan(.5*s.qW*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,r){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*s.qW*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const o=this.view;if(null!==this.view&&this.view.enabled){const e=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/e,t-=o.offsetY*n/s,i*=o.width/e,n*=o.height/s}const a=this.filmOffset;0!==a&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}},75544:(e,t,n)=>{"use strict";n.d(t,{$wi:()=>ie,AmZ:()=>Bt,BFQ:()=>je,BG$:()=>st,BVF:()=>F,Bf4:()=>ce,CaW:()=>Xe,CdI:()=>Q,CtA:()=>Fe,Cy:()=>k,D1R:()=>be,D67:()=>Xt,D9w:()=>Ve,Djp:()=>it,E2K:()=>Be,EoG:()=>J,F1y:()=>Yt,FUD:()=>ht,FVh:()=>Gt,GG6:()=>lt,GUF:()=>zt,Gih:()=>ct,HdW:()=>gt,Hy8:()=>N,IFH:()=>Tt,ILR:()=>Ge,IOt:()=>Ot,JCZ:()=>an,JQ4:()=>Ee,Jjb:()=>en,KI_:()=>Vt,KhW:()=>C,Kz5:()=>Me,LSk:()=>sn,LY2:()=>te,L_r:()=>rn,LgZ:()=>R,LsT:()=>Se,M$G:()=>Kt,M5h:()=>y,M6v:()=>W,N4l:()=>v,NDo:()=>Y,NKc:()=>z,NMF:()=>xt,NYV:()=>rt,Ns1:()=>q,O78:()=>Qt,OTo:()=>Le,OoA:()=>pe,PA7:()=>Ut,PeU:()=>s,Pnf:()=>St,QO2:()=>ft,RlZ:()=>O,S2y:()=>o,Se2:()=>B,Sm8:()=>M,SvJ:()=>ut,Syv:()=>_t,T6w:()=>tn,T95:()=>xe,TyD:()=>me,UZH:()=>i,UlW:()=>Pt,Vdb:()=>D,Vtg:()=>Ht,VzW:()=>Te,W2J:()=>nn,WMw:()=>g,Wbm:()=>x,Wl3:()=>d,Wpd:()=>I,WwZ:()=>At,Xaj:()=>b,Y8D:()=>De,YGz:()=>ee,YLQ:()=>fe,ZTh:()=>yt,Zen:()=>Jt,Zr5:()=>$,_AM:()=>Ze,_Li:()=>u,_MY:()=>a,_RZ:()=>on,_iA:()=>l,_lf:()=>Mt,_sL:()=>Et,_wr:()=>U,aCh:()=>kt,aH4:()=>ge,av9:()=>ze,bGH:()=>_,bdR:()=>f,brP:()=>Ue,bsb:()=>pt,c8b:()=>E,cLu:()=>Ce,cRx:()=>Ie,cum:()=>Wt,dSO:()=>le,dZ3:()=>ne,dwk:()=>h,eD:()=>H,eaV:()=>qe,ehD:()=>p,ekQ:()=>Je,f2y:()=>mt,fSK:()=>L,fY$:()=>oe,fto:()=>Ye,g8_:()=>he,gSk:()=>Ct,ghN:()=>T,gi4:()=>nt,hEm:()=>ke,iAb:()=>we,iWC:()=>A,iiP:()=>dt,irR:()=>Pe,j17:()=>jt,jFi:()=>m,jZA:()=>et,jes:()=>V,k0A:()=>Ae,k74:()=>P,knz:()=>Nt,ksN:()=>G,l0P:()=>Ke,l6D:()=>$t,lGU:()=>bt,mSO:()=>It,msZ:()=>se,ntZ:()=>c,ntt:()=>Ft,pIN:()=>wt,pKu:()=>at,ptH:()=>Qe,qhX:()=>X,qkB:()=>Oe,qyh:()=>ye,rOj:()=>w,r_:()=>S,rnI:()=>Lt,rpg:()=>de,tm_:()=>r,uL9:()=>K,uWy:()=>ue,v3W:()=>He,vCF:()=>j,vCx:()=>We,vuL:()=>vt,vxC:()=>ae,w$m:()=>Z,wJv:()=>Re,wem:()=>ve,wk1:()=>Ne,wuA:()=>$e,x5V:()=>Zt,xJs:()=>ot,xfE:()=>re,xoQ:()=>qt,y2t:()=>tt,ywz:()=>_e,z$h:()=>Rt,z81:()=>Dt});const i="158",s=0,r=1,o=2,a=0,l=1,c=2,h=3,d=0,u=1,p=2,m=0,f=1,g=2,v=3,y=4,b=5,_=100,x=101,w=102,S=103,M=104,E=200,T=201,C=202,A=203,P=204,R=205,L=206,N=207,D=208,I=209,O=210,U=211,k=212,V=213,z=214,F=0,B=1,$=2,j=3,H=4,G=5,Z=6,W=7,q=0,X=1,Y=2,K=0,J=1,Q=2,ee=3,te=4,ne=5,ie="attached",se="detached",re=300,oe=301,ae=302,le=303,ce=304,he=306,de=1e3,ue=1001,pe=1002,me=1003,fe=1004,ge=1005,ve=1006,ye=1007,be=1008,_e=1009,xe=1010,we=1011,Se=1012,Me=1013,Ee=1014,Te=1015,Ce=1016,Ae=1017,Pe=1018,Re=1020,Le=1021,Ne=1023,De=1024,Ie=1025,Oe=1026,Ue=1027,ke=1028,Ve=1029,ze=1030,Fe=1031,Be=1033,$e=33776,je=33777,He=33778,Ge=33779,Ze=35840,We=35841,qe=35842,Xe=35843,Ye=36196,Ke=37492,Je=37496,Qe=37808,et=37809,tt=37810,nt=37811,it=37812,st=37813,rt=37814,ot=37815,at=37816,lt=37817,ct=37818,ht=37819,dt=37820,ut=37821,pt=36492,mt=36494,ft=36495,gt=36283,vt=36284,yt=36285,bt=36286,_t=2300,xt=2301,wt=2302,St=2400,Mt=2401,Et=2402,Tt=2500,Ct=2501,At=0,Pt=1,Rt=2,Lt=3e3,Nt=3001,Dt=3200,It=3201,Ot=0,Ut=1,kt="",Vt="srgb",zt="srgb-linear",Ft="display-p3",Bt="display-p3-linear",$t="linear",jt="srgb",Ht="rec709",Gt="p3",Zt=7680,Wt=519,qt=512,Xt=513,Yt=514,Kt=515,Jt=516,Qt=517,en=518,tn=519,nn=35044,sn="300 es",rn=1035,on=2e3,an=2001},35322:(e,t,n)=>{"use strict";n.d(t,{Tl:()=>c,a$:()=>u,lC:()=>d,ql:()=>h});var i=n(19588),s=n(40693),r=n(71050),o=n(75544);const a=new i.P,l=new s.F;class c{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=o.W2J,this.updateRange={offset:0,count:-1},this.gpuType=o.VzW,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i{"use strict";n.d(t,{u:()=>x});var i=n(19588),s=n(40693),r=n(37840),o=n(19251),a=n(35322),l=n(57471),c=n(25499),h=n(82587),d=n(23130),u=n(71050),p=n(19564);let m=0;const f=new h.y,g=new c.T,v=new i.P,y=new r.Z,b=new r.Z,_=new i.P;class x extends o.p{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:m++}),this.uuid=u.DO(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new((0,p.H7)(e)?a.lC:a.ql)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new d.V).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return f.makeRotationFromQuaternion(e),this.applyMatrix4(f),this}rotateX(e){return f.makeRotationX(e),this.applyMatrix4(f),this}rotateY(e){return f.makeRotationY(e),this.applyMatrix4(f),this}rotateZ(e){return f.makeRotationZ(e),this.applyMatrix4(f),this}translate(e,t,n){return f.makeTranslation(e,t,n),this.applyMatrix4(f),this}scale(e,t,n){return f.makeScale(e,t,n),this.applyMatrix4(f),this}lookAt(e){return g.lookAt(e),g.updateMatrix(),this.applyMatrix4(g.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(v).negate(),this.translate(v.x,v.y,v.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const i=n[t];e.data.attributes[t]=i.toJSON(e.data)}const i={};let s=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],r=[];for(let t=0,i=n.length;t0&&(i[t]=r,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(e.data.groups=JSON.parse(JSON.stringify(r)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const i=e.attributes;for(const e in i){const n=i[e];this.setAttribute(e,n.clone(t))}const s=e.morphAttributes;for(const e in s){const n=[],i=s[e];for(let e=0,s=i.length;e{"use strict";n.d(t,{p:()=>i});class i{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,i=n.length;t{"use strict";n.d(t,{v:()=>r});var i=n(71050),s=n(75544);class r{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=s.W2J,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=i.DO()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;i{"use strict";n.d(t,{k:()=>a});var i=n(19588),s=n(35322),r=n(71050);const o=new i.P;class a{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t{"use strict";n.d(t,{S:()=>i});class i{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<{"use strict";n.d(t,{T:()=>M});var i=n(78943),s=n(19588),r=n(82587),o=n(19251),a=n(82954),l=n(45787),c=n(23130),h=n(71050);let d=0;const u=new s.P,p=new i._,m=new r.y,f=new s.P,g=new s.P,v=new s.P,y=new i._,b=new s.P(1,0,0),_=new s.P(0,1,0),x=new s.P(0,0,1),w={type:"added"},S={type:"removed"};class M extends o.p{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:d++}),this.uuid=h.DO(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=M.DEFAULT_UP.clone();const e=new s.P,t=new a.U,n=new i._,o=new s.P(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:o},modelViewMatrix:{value:new r.y},normalMatrix:{value:new c.V}}),this.matrix=new r.y,this.matrixWorld=new r.y,this.matrixAutoUpdate=M.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=M.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new l.S,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return p.setFromAxisAngle(e,t),this.quaternion.multiply(p),this}rotateOnWorldAxis(e,t){return p.setFromAxisAngle(e,t),this.quaternion.premultiply(p),this}rotateX(e){return this.rotateOnAxis(b,e)}rotateY(e){return this.rotateOnAxis(_,e)}rotateZ(e){return this.rotateOnAxis(x,e)}translateOnAxis(e,t){return u.copy(e).applyQuaternion(this.quaternion),this.position.add(u.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(b,e)}translateY(e){return this.translateOnAxis(_,e)}translateZ(e){return this.translateOnAxis(x,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(m.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?f.copy(e):f.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),g.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?m.lookAt(g,f,this.up):m.lookAt(f,g,this.up),this.quaternion.setFromRotationMatrix(m),i&&(m.extractRotation(i.matrixWorld),p.setFromRotationMatrix(m),this.quaternion.premultiply(p.invert()))}add(e){if(arguments.length>1){for(let e=0;e1){for(let e=0;e0&&(n=n.concat(s))}return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(g,e,v),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(g,y,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t0){i.children=[];for(let t=0;t0){i.animations=[];for(let t=0;t0&&(n.geometries=t),i.length>0&&(n.materials=i),s.length>0&&(n.textures=s),o.length>0&&(n.images=o),a.length>0&&(n.shapes=a),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=i,n;function r(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t{"use strict";n.d(t,{P:()=>o});var i=n(19564),s=n(19748);let r;class o{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===r&&(r=(0,i.c)("canvas")),r.width=e.width,r.height=e.height;const n=r.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=r}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=(0,i.c)("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),o=r.data;for(let e=0;e{"use strict";n.d(t,{a:()=>E});var i=n(75544),s=n(35322),r=n(75809),o=n(8035),a=n(62257),l=n(67440),c=n(44428),h=n(19588),d=n(93113),u=n(46953),p=n(24479),m=n(40071);const f=[.125,.215,.35,.446,.526,.582],g=20,v=new a.i,y=new d.I;let b=null,_=0,x=0;const w=(1+Math.sqrt(5))/2,S=1/w,M=[new h.P(1,1,1),new h.P(-1,1,1),new h.P(1,1,-1),new h.P(-1,1,-1),new h.P(0,w,S),new h.P(0,w,-S),new h.P(S,0,w),new h.P(-S,0,w),new h.P(w,S,0),new h.P(-w,S,0)];class E{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){b=this._renderer.getRenderTarget(),_=this._renderer.getActiveCubeFace(),x=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=P(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=A(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?c=f[l-e+4-1]:0===l&&(c=0),i.push(c);const h=1/(a-2),d=-h,u=1+h,p=[d,d,u,d,u,u,d,d,u,u,d,u],m=6,g=6,v=3,y=2,b=1,_=new Float32Array(v*g*m),x=new Float32Array(y*g*m),w=new Float32Array(b*g*m);for(let e=0;e2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];_.set(i,v*g*e),x.set(p,y*g*e);const s=[e,e,e,e,e,e];w.set(s,b*g*e)}const S=new r.u;S.setAttribute("position",new s.Tl(_,v)),S.setAttribute("uv",new s.Tl(x,y)),S.setAttribute("faceIndex",new s.Tl(w,b)),t.push(S),o>4&&o--}return{lodPlanes:t,sizeLods:n,sigmas:i}}(o)),this._blurMaterial=function(e,t,n){const s=new Float32Array(g),r=new h.P(0,1,0);return new c.j({name:"SphericalGaussianBlur",defines:{n:g,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:R(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:i.jFi,depthTest:!1,depthWrite:!1})}(o,e,t)}return o}_compileMaterial(e){const t=new o.K(this._lodPlanes[0],e);this._renderer.compile(t,v)}_sceneToCubeUV(e,t,n,s){const r=new l.c(90,1,t,n),a=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,d=h.autoClear,u=h.toneMapping;h.getClearColor(y),h.toneMapping=i.uL9,h.autoClear=!1;const f=new p.v({name:"PMREM.Background",side:i._Li,depthWrite:!1,depthTest:!1}),g=new o.K(new m.D,f);let v=!1;const b=e.background;b?b.isColor&&(f.color.copy(b),e.background=null,v=!0):(f.color.copy(y),v=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(r.up.set(0,a[t],0),r.lookAt(c[t],0,0)):1===n?(r.up.set(0,0,a[t]),r.lookAt(0,c[t],0)):(r.up.set(0,a[t],0),r.lookAt(0,0,c[t]));const i=this._cubeSize;C(s,n*i,t>2?i:0,i,i),h.setRenderTarget(s),v&&h.render(g,r),h.render(e,r)}g.geometry.dispose(),g.material.dispose(),h.toneMapping=u,h.autoClear=d,e.background=b}_textureToCubeUV(e,t){const n=this._renderer,s=e.mapping===i.fY$||e.mapping===i.vxC;s?(null===this._cubemapMaterial&&(this._cubemapMaterial=P()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=A());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new o.K(this._lodPlanes[0],r);r.uniforms.envMap.value=e;const l=this._cubeSize;C(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,v)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;tg&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const y=[];let b=0;for(let e=0;e_-4?i-_+4:0),4*(this._cubeSize-x),3*x,2*x),l.setRenderTarget(t),l.render(h,v)}}function T(e,t,n){const s=new u.d(e,t,n);return s.texture.mapping=i.g8_,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function C(e,t,n,i,s){e.viewport.set(t,n,i,s),e.scissor.set(t,n,i,s)}function A(){return new c.j({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:R(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:i.jFi,depthTest:!1,depthWrite:!1})}function P(){return new c.j({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:R(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:i.jFi,depthTest:!1,depthWrite:!1})}function R(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}},40071:(e,t,n)=>{"use strict";n.d(t,{D:()=>o});var i=n(75809),s=n(35322),r=n(19588);class o extends i.u{constructor(e=1,t=1,n=1,i=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:o,depthSegments:a};const l=this;i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);const c=[],h=[],d=[],u=[];let p=0,m=0;function f(e,t,n,i,s,o,a,f,g,v,y){const b=o/g,_=a/v,x=o/2,w=a/2,S=f/2,M=g+1,E=v+1;let T=0,C=0;const A=new r.P;for(let r=0;r0?1:-1,d.push(A.x,A.y,A.z),u.push(a/g),u.push(1-r/v),T+=1}}for(let e=0;e{"use strict";n.d(t,{_:()=>r});var i=n(75809),s=n(35322);class r extends i.u{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,o=t/2,a=Math.floor(n),l=Math.floor(i),c=a+1,h=l+1,d=e/a,u=t/l,p=[],m=[],f=[],g=[];for(let e=0;e{"use strict";n.d(t,{O:()=>l});var i=n(19816),s=n(95687),r=n(62257);class o extends s.h{constructor(){super(new r.i(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}var a=n(25499);class l extends i._{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(a.T.DEFAULT_UP),this.updateMatrix(),this.target=new a.T,this.shadow=new o}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}},57090:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var i=n(19816),s=n(93113),r=n(25499);class o extends i._{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(r.T.DEFAULT_UP),this.updateMatrix(),this.groundColor=new s.I(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}},19816:(e,t,n)=>{"use strict";n.d(t,{_:()=>r});var i=n(25499),s=n(93113);class r extends i.T{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new s.I(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}},95687:(e,t,n)=>{"use strict";n.d(t,{h:()=>d});var i=n(82587),s=n(40693),r=n(19588),o=n(84538),a=n(53763);const l=new i.y,c=new r.P,h=new r.P;class d{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new s.F(512,512),this.map=null,this.mapPass=null,this.matrix=new i.y,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new a.i,this._frameExtents=new s.F(1,1),this._viewportCount=1,this._viewports=[new o.L(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;c.setFromMatrixPosition(e.matrixWorld),t.position.copy(c),h.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(h),t.updateMatrixWorld(),l.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(l),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(l)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}},54992:(e,t,n)=>{"use strict";n.d(t,{c:()=>m});var i=n(19816),s=n(95687),r=n(67440),o=n(82587),a=n(40693),l=n(19588),c=n(84538);const h=new o.y,d=new l.P,u=new l.P;class p extends s.h{constructor(){super(new r.c(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new a.F(4,2),this._viewportCount=6,this._viewports=[new c.L(2,1,1,1),new c.L(0,1,1,1),new c.L(3,1,1,1),new c.L(1,1,1,1),new c.L(3,0,1,1),new c.L(1,0,1,1)],this._cubeDirections=[new l.P(1,0,0),new l.P(-1,0,0),new l.P(0,0,1),new l.P(0,0,-1),new l.P(0,1,0),new l.P(0,-1,0)],this._cubeUps=[new l.P(0,1,0),new l.P(0,1,0),new l.P(0,1,0),new l.P(0,1,0),new l.P(0,0,1),new l.P(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),d.setFromMatrixPosition(e.matrixWorld),n.position.copy(d),u.copy(n.position),u.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(u),n.updateMatrixWorld(),i.makeTranslation(-d.x,-d.y,-d.z),h.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(h)}}class m extends i._{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new p}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}},50910:(e,t,n)=>{"use strict";n.d(t,{T:()=>s});var i=n(19816);class s extends i._{constructor(e,t,n=10,i=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}},16426:(e,t,n)=>{"use strict";n.d(t,{P:()=>c});var i=n(19816),s=n(95687),r=n(71050),o=n(67440);class a extends s.h{constructor(){super(new o.c(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=2*r.I3*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;n===t.fov&&i===t.aspect&&s===t.far||(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}var l=n(25499);class c extends i._{constructor(e,t,n=0,i=Math.PI/3,s=0,r=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(l.T.DEFAULT_UP),this.updateMatrix(),this.target=new l.T,this.distance=n,this.angle=i,this.penumbra=s,this.decay=r,this.map=null,this.shadow=new a}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}},58754:(e,t,n)=>{"use strict";n.d(t,{l:()=>i,t:()=>s});class i{constructor(e,t,n){const i=this;let s,r=!1,o=0,a=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){a++,!1===r&&void 0!==i.onStart&&i.onStart(e,o,a),r=!0},this.itemEnd=function(e){o++,void 0!==i.onProgress&&i.onProgress(e,o,a),o===a&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t{"use strict";n.d(t,{n:()=>r});var i=n(63960),s=n(93113);class r extends i.F{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new s.I(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}},63960:(e,t,n)=>{"use strict";n.d(t,{F:()=>l});var i=n(93113),s=n(19251),r=n(75544),o=n(71050);let a=0;class l extends s.p{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:a++}),this.uuid=o.DO(),this.name="",this.type="Material",this.blending=r.bdR,this.side=r.Wl3,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=r.k74,this.blendDst=r.LgZ,this.blendEquation=r.bGH,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new i.I(0,0,0),this.blendAlpha=0,this.depthFunc=r.vCF,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=r.cum,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=r.x5V,this.stencilZFail=r.x5V,this.stencilZPass=r.x5V,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==r.bdR&&(n.blending=this.blending),this.side!==r.Wl3&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==r.k74&&(n.blendSrc=this.blendSrc),this.blendDst!==r.LgZ&&(n.blendDst=this.blendDst),this.blendEquation!==r.bGH&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==r.vCF&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==r.cum&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==r.x5V&&(n.stencilFail=this.stencilFail),this.stencilZFail!==r.x5V&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==r.x5V&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const t=i(e.textures),s=i(e.images);t.length>0&&(n.textures=t),s.length>0&&(n.images=s)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}},24479:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var i=n(63960),s=n(75544),r=n(93113);class o extends i.F{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new r.I(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=s.Ns1,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}},90652:(e,t,n)=>{"use strict";n.d(t,{l:()=>r});var i=n(63960),s=n(75544);class r extends i.F{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=s.z81,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}},35536:(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var i=n(63960);class s extends i.F{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}},41654:(e,t,n)=>{"use strict";n.d(t,{x:()=>a});var i=n(75544),s=n(63960),r=n(40693),o=n(93113);class a extends s.F{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new o.I(16777215),this.specular=new o.I(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new o.I(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=i.IOt,this.normalScale=new r.F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=i.Ns1,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}},6965:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var i=n(75544),s=n(63960),r=n(40693),o=n(93113);class a extends s.F{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new o.I(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new o.I(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=i.IOt,this.normalScale=new r.F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}},44428:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});var i=n(63960),s=n(8173);class r extends i.F{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",this.fragmentShader="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=(0,s.dw)(e.uniforms),this.uniformsGroups=(0,s.fd)(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}},37840:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(19588);class s{constructor(e=new i.P(1/0,1/0,1/0),t=new i.P(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,o),o.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(m),f.subVectors(this.max,m),l.subVectors(e.a,m),c.subVectors(e.b,m),h.subVectors(e.c,m),d.subVectors(c,l),u.subVectors(h,c),p.subVectors(l,h);let t=[0,-d.z,d.y,0,-u.z,u.y,0,-p.z,p.y,d.z,0,-d.x,u.z,0,-u.x,p.z,0,-p.x,-d.y,d.x,0,-u.y,u.x,0,-p.y,p.x,0];return!!y(t,l,c,h,f)&&(t=[1,0,0,0,1,0,0,0,1],!!y(t,l,c,h,f)&&(g.crossVectors(d,u),t=[g.x,g.y,g.z],y(t,l,c,h,f)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,o).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(o).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(r[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),r[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),r[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),r[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),r[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),r[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),r[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),r[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(r)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const r=[new i.P,new i.P,new i.P,new i.P,new i.P,new i.P,new i.P,new i.P],o=new i.P,a=new s,l=new i.P,c=new i.P,h=new i.P,d=new i.P,u=new i.P,p=new i.P,m=new i.P,f=new i.P,g=new i.P,v=new i.P;function y(e,t,n,i,s){for(let r=0,o=e.length-3;r<=o;r+=3){v.fromArray(e,r);const o=s.x*Math.abs(v.x)+s.y*Math.abs(v.y)+s.z*Math.abs(v.z),a=t.dot(v),l=n.dot(v),c=i.dot(v);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}},93113:(e,t,n)=>{"use strict";n.d(t,{I:()=>h});var i=n(71050),s=n(19748),r=n(75544);const o={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},a={h:0,s:0,l:0},l={h:0,s:0,l:0};function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}class h{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(void 0===t&&void 0===n){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=r.KI_){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,s.ep.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=s.ep.workingColorSpace){return this.r=e,this.g=t,this.b=n,s.ep.toWorkingColorSpace(this,i),this}setHSL(e,t,n,r=s.ep.workingColorSpace){if(e=(0,i.kz)(e,1),t=(0,i.uZ)(t,0,1),n=(0,i.uZ)(n,0,1),0===t)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=c(s,i,e+1/3),this.g=c(s,i,e),this.b=c(s,i,e-1/3)}return s.ep.toWorkingColorSpace(this,r),this}setStyle(e,t=r.KI_){function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=i[1],s=n.length;if(3===s)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===s)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=r.KI_){const n=o[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=(0,s.PB)(e.r),this.g=(0,s.PB)(e.g),this.b=(0,s.PB)(e.b),this}copyLinearToSRGB(e){return this.r=(0,s.QP)(e.r),this.g=(0,s.QP)(e.g),this.b=(0,s.QP)(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=r.KI_){return s.ep.fromWorkingColorSpace(d.copy(this),e),65536*Math.round((0,i.uZ)(255*d.r,0,255))+256*Math.round((0,i.uZ)(255*d.g,0,255))+Math.round((0,i.uZ)(255*d.b,0,255))}getHexString(e=r.KI_){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=s.ep.workingColorSpace){s.ep.fromWorkingColorSpace(d.copy(this),t);const n=d.r,i=d.g,r=d.b,o=Math.max(n,i,r),a=Math.min(n,i,r);let l,c;const h=(a+o)/2;if(a===o)l=0,c=0;else{const e=o-a;switch(c=h<=.5?e/(o+a):e/(2-o-a),o){case n:l=(i-r)/e+(i{"use strict";n.d(t,{PB:()=>h,QP:()=>d,ep:()=>c});var i=n(75544),s=n(23130);const r=(new s.V).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),o=(new s.V).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),a={[i.GUF]:{transfer:i.l6D,primaries:i.Vtg,toReference:e=>e,fromReference:e=>e},[i.KI_]:{transfer:i.j17,primaries:i.Vtg,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[i.AmZ]:{transfer:i.l6D,primaries:i.FVh,toReference:e=>e.applyMatrix3(o),fromReference:e=>e.applyMatrix3(r)},[i.ntt]:{transfer:i.j17,primaries:i.FVh,toReference:e=>e.convertSRGBToLinear().applyMatrix3(o),fromReference:e=>e.applyMatrix3(r).convertLinearToSRGB()}},l=new Set([i.GUF,i.AmZ]),c={enabled:!0,_workingColorSpace:i.GUF,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(e){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!e},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!l.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,n){if(!1===this.enabled||t===n||!t||!n)return e;const i=a[t].toReference;return(0,a[n].fromReference)(i(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return a[e].primaries},getTransfer:function(e){return e===i.aCh?i.l6D:a[e].transfer}};function h(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function d(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}},82954:(e,t,n)=>{"use strict";n.d(t,{U:()=>l});var i=n(78943),s=n(82587),r=n(71050);const o=new s.y,a=new i._;class l{constructor(e=0,t=0,n=0,i=l.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],h=i[9],d=i[2],u=i[6],p=i[10];switch(t){case"XYZ":this._y=Math.asin((0,r.uZ)(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(u,c),this._z=0);break;case"YXZ":this._x=Math.asin(-(0,r.uZ)(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin((0,r.uZ)(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-(0,r.uZ)(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(u,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin((0,r.uZ)(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-(0,r.uZ)(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(u,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return o.makeRotationFromQuaternion(e),this.setFromRotationMatrix(o,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return a.setFromEuler(this),this.setFromQuaternion(a,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}l.DEFAULT_ORDER="XYZ"},53763:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var i=n(75544),s=n(19588),r=n(57471),o=n(82094);const a=new r.a,l=new s.P;class c{constructor(e=new o.J,t=new o.J,n=new o.J,i=new o.J,s=new o.J,r=new o.J){this.planes=[e,t,n,i,s,r]}set(e,t,n,i,s,r){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(s),o[5].copy(r),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=i._RZ){const n=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],h=s[5],d=s[6],u=s[7],p=s[8],m=s[9],f=s[10],g=s[11],v=s[12],y=s[13],b=s[14],_=s[15];if(n[0].setComponents(l-r,u-c,g-p,_-v).normalize(),n[1].setComponents(l+r,u+c,g+p,_+v).normalize(),n[2].setComponents(l+o,u+h,g+m,_+y).normalize(),n[3].setComponents(l-o,u-h,g-m,_-y).normalize(),n[4].setComponents(l-a,u-d,g-f,_-b).normalize(),t===i._RZ)n[5].setComponents(l+a,u+d,g+f,_+b).normalize();else{if(t!==i.JCZ)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(a,d,f,b).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),a.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),a.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(a)}intersectsSprite(e){return a.center.set(0,0,0),a.radius=.7071067811865476,a.applyMatrix4(e.matrixWorld),this.intersectsSphere(a)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,l.y=i.normal.y>0?e.max.y:e.min.y,l.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(l)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}},71050:(e,t,n)=>{"use strict";n.d(t,{DO:()=>a,Fv:()=>f,I3:()=>o,M8:()=>g,cY:()=>m,gy:()=>p,h3:()=>u,kz:()=>c,qW:()=>r,t7:()=>h,uZ:()=>l,wt:()=>d});const i=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let s=1234567;const r=Math.PI/180,o=180/Math.PI;function a(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,s=4294967295*Math.random()|0;return(i[255&e]+i[e>>8&255]+i[e>>16&255]+i[e>>24&255]+"-"+i[255&t]+i[t>>8&255]+"-"+i[t>>16&15|64]+i[t>>24&255]+"-"+i[63&n|128]+i[n>>8&255]+"-"+i[n>>16&255]+i[n>>24&255]+i[255&s]+i[s>>8&255]+i[s>>16&255]+i[s>>24&255]).toLowerCase()}function l(e,t,n){return Math.max(t,Math.min(n,e))}function c(e,t){return(e%t+t)%t}function h(e,t,n){return(1-n)*e+n*t}function d(e){return 0==(e&e-1)&&0!==e}function u(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function p(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function m(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function f(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const g={DEG2RAD:r,RAD2DEG:o,generateUUID:a,clamp:l,euclideanModulo:c,mapLinear:function(e,t,n,i,s){return i+(e-t)*(s-i)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:h,damp:function(e,t,n,i){return h(e,t,1-Math.exp(-n*i))},pingpong:function(e,t=1){return t-Math.abs(c(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(s=e);let t=s+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*r},radToDeg:function(e){return e*o},isPowerOfTwo:d,ceilPowerOfTwo:u,floorPowerOfTwo:p,setQuaternionFromProperEuler:function(e,t,n,i,s){const r=Math.cos,o=Math.sin,a=r(n/2),l=o(n/2),c=r((t+i)/2),h=o((t+i)/2),d=r((t-i)/2),u=o((t-i)/2),p=r((i-t)/2),m=o((i-t)/2);switch(s){case"XYX":e.set(a*h,l*d,l*u,a*c);break;case"YZY":e.set(l*u,a*h,l*d,a*c);break;case"ZXZ":e.set(l*d,l*u,a*h,a*c);break;case"XZX":e.set(a*h,l*m,l*p,a*c);break;case"YXY":e.set(l*p,a*h,l*m,a*c);break;case"ZYZ":e.set(l*m,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}},normalize:f,denormalize:m}},23130:(e,t,n)=>{"use strict";n.d(t,{V:()=>i});class i{constructor(e,t,n,s,r,o,a,l,c){i.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,s,r,o,a,l,c)}set(e,t,n,i,s,r,o,a,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=s,c[5]=a,c[6]=n,c[7]=r,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,r=n[0],o=n[3],a=n[6],l=n[1],c=n[4],h=n[7],d=n[2],u=n[5],p=n[8],m=i[0],f=i[3],g=i[6],v=i[1],y=i[4],b=i[7],_=i[2],x=i[5],w=i[8];return s[0]=r*m+o*v+a*_,s[3]=r*f+o*y+a*x,s[6]=r*g+o*b+a*w,s[1]=l*m+c*v+h*_,s[4]=l*f+c*y+h*x,s[7]=l*g+c*b+h*w,s[2]=d*m+u*v+p*_,s[5]=d*f+u*y+p*x,s[8]=d*g+u*b+p*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return t*r*c-t*o*l-n*s*c+n*o*a+i*s*l-i*r*a}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=c*r-o*l,d=o*a-c*s,u=l*s-r*a,p=t*h+n*d+i*u;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return e[0]=h*m,e[1]=(i*l-c*n)*m,e[2]=(o*n-i*r)*m,e[3]=d*m,e[4]=(c*t-i*a)*m,e[5]=(i*s-o*t)*m,e[6]=u*m,e[7]=(n*a-l*t)*m,e[8]=(r*t-n*s)*m,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,r,o){const a=Math.cos(s),l=Math.sin(s);return this.set(n*a,n*l,-n*(a*r+l*o)+r+e,-i*l,i*a,-i*(-l*r+a*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(s.makeScale(e,t)),this}rotate(e){return this.premultiply(s.makeRotation(-e)),this}translate(e,t){return this.premultiply(s.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const s=new i},82587:(e,t,n)=>{"use strict";n.d(t,{y:()=>r});var i=n(75544),s=n(19588);class r{constructor(e,t,n,i,s,o,a,l,c,h,d,u,p,m,f,g){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,i,s,o,a,l,c,h,d,u,p,m,f,g)}set(e,t,n,i,s,r,o,a,l,c,h,d,u,p,m,f){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=r,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=d,g[3]=u,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new r).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/o.setFromMatrixColumn(e,0).length(),s=1/o.setFromMatrixColumn(e,1).length(),r=1/o.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*r,t[9]=n[9]*r,t[10]=n[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,r=Math.cos(n),o=Math.sin(n),a=Math.cos(i),l=Math.sin(i),c=Math.cos(s),h=Math.sin(s);if("XYZ"===e.order){const e=r*c,n=r*h,i=o*c,s=o*h;t[0]=a*c,t[4]=-a*h,t[8]=l,t[1]=n+i*l,t[5]=e-s*l,t[9]=-o*a,t[2]=s-e*l,t[6]=i+n*l,t[10]=r*a}else if("YXZ"===e.order){const e=a*c,n=a*h,i=l*c,s=l*h;t[0]=e+s*o,t[4]=i*o-n,t[8]=r*l,t[1]=r*h,t[5]=r*c,t[9]=-o,t[2]=n*o-i,t[6]=s+e*o,t[10]=r*a}else if("ZXY"===e.order){const e=a*c,n=a*h,i=l*c,s=l*h;t[0]=e-s*o,t[4]=-r*h,t[8]=i+n*o,t[1]=n+i*o,t[5]=r*c,t[9]=s-e*o,t[2]=-r*l,t[6]=o,t[10]=r*a}else if("ZYX"===e.order){const e=r*c,n=r*h,i=o*c,s=o*h;t[0]=a*c,t[4]=i*l-n,t[8]=e*l+s,t[1]=a*h,t[5]=s*l+e,t[9]=n*l-i,t[2]=-l,t[6]=o*a,t[10]=r*a}else if("YZX"===e.order){const e=r*a,n=r*l,i=o*a,s=o*l;t[0]=a*c,t[4]=s-e*h,t[8]=i*h+n,t[1]=h,t[5]=r*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*h+i,t[10]=e-s*h}else if("XZY"===e.order){const e=r*a,n=r*l,i=o*a,s=o*l;t[0]=a*c,t[4]=-h,t[8]=l*c,t[1]=e*h+s,t[5]=r*c,t[9]=n*h-i,t[2]=i*h-n,t[6]=o*c,t[10]=s*h+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(l,e,c)}lookAt(e,t,n){const i=this.elements;return u.subVectors(e,t),0===u.lengthSq()&&(u.z=1),u.normalize(),h.crossVectors(n,u),0===h.lengthSq()&&(1===Math.abs(n.z)?u.x+=1e-4:u.z+=1e-4,u.normalize(),h.crossVectors(n,u)),h.normalize(),d.crossVectors(u,h),i[0]=h.x,i[4]=d.x,i[8]=u.x,i[1]=h.y,i[5]=d.y,i[9]=u.y,i[2]=h.z,i[6]=d.z,i[10]=u.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,r=n[0],o=n[4],a=n[8],l=n[12],c=n[1],h=n[5],d=n[9],u=n[13],p=n[2],m=n[6],f=n[10],g=n[14],v=n[3],y=n[7],b=n[11],_=n[15],x=i[0],w=i[4],S=i[8],M=i[12],E=i[1],T=i[5],C=i[9],A=i[13],P=i[2],R=i[6],L=i[10],N=i[14],D=i[3],I=i[7],O=i[11],U=i[15];return s[0]=r*x+o*E+a*P+l*D,s[4]=r*w+o*T+a*R+l*I,s[8]=r*S+o*C+a*L+l*O,s[12]=r*M+o*A+a*N+l*U,s[1]=c*x+h*E+d*P+u*D,s[5]=c*w+h*T+d*R+u*I,s[9]=c*S+h*C+d*L+u*O,s[13]=c*M+h*A+d*N+u*U,s[2]=p*x+m*E+f*P+g*D,s[6]=p*w+m*T+f*R+g*I,s[10]=p*S+m*C+f*L+g*O,s[14]=p*M+m*A+f*N+g*U,s[3]=v*x+y*E+b*P+_*D,s[7]=v*w+y*T+b*R+_*I,s[11]=v*S+y*C+b*L+_*O,s[15]=v*M+y*A+b*N+_*U,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],r=e[1],o=e[5],a=e[9],l=e[13],c=e[2],h=e[6],d=e[10],u=e[14];return e[3]*(+s*a*h-i*l*h-s*o*d+n*l*d+i*o*u-n*a*u)+e[7]*(+t*a*u-t*l*d+s*r*d-i*r*u+i*l*c-s*a*c)+e[11]*(+t*l*h-t*o*u-s*r*h+n*r*u+s*o*c-n*l*c)+e[15]*(-i*o*c-t*a*h+t*o*d+i*r*h-n*r*d+n*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=e[9],d=e[10],u=e[11],p=e[12],m=e[13],f=e[14],g=e[15],v=h*f*l-m*d*l+m*a*u-o*f*u-h*a*g+o*d*g,y=p*d*l-c*f*l-p*a*u+r*f*u+c*a*g-r*d*g,b=c*m*l-p*h*l+p*o*u-r*m*u-c*o*g+r*h*g,_=p*h*a-c*m*a-p*o*d+r*m*d+c*o*f-r*h*f,x=t*v+n*y+i*b+s*_;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return e[0]=v*w,e[1]=(m*d*s-h*f*s-m*i*u+n*f*u+h*i*g-n*d*g)*w,e[2]=(o*f*s-m*a*s+m*i*l-n*f*l-o*i*g+n*a*g)*w,e[3]=(h*a*s-o*d*s-h*i*l+n*d*l+o*i*u-n*a*u)*w,e[4]=y*w,e[5]=(c*f*s-p*d*s+p*i*u-t*f*u-c*i*g+t*d*g)*w,e[6]=(p*a*s-r*f*s-p*i*l+t*f*l+r*i*g-t*a*g)*w,e[7]=(r*d*s-c*a*s+c*i*l-t*d*l-r*i*u+t*a*u)*w,e[8]=b*w,e[9]=(p*h*s-c*m*s-p*n*u+t*m*u+c*n*g-t*h*g)*w,e[10]=(r*m*s-p*o*s+p*n*l-t*m*l-r*n*g+t*o*g)*w,e[11]=(c*o*s-r*h*s-c*n*l+t*h*l+r*n*u-t*o*u)*w,e[12]=_*w,e[13]=(c*m*i-p*h*i+p*n*d-t*m*d-c*n*f+t*h*f)*w,e[14]=(p*o*i-r*m*i-p*n*a+t*m*a+r*n*f-t*o*f)*w,e[15]=(r*h*i-c*o*i+c*n*a-t*h*a-r*n*d+t*o*d)*w,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,r=e.x,o=e.y,a=e.z,l=s*r,c=s*o;return this.set(l*r+n,l*o-i*a,l*a+i*o,0,l*o+i*a,c*o+n,c*a-i*r,0,l*a-i*o,c*a+i*r,s*a*a+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,r){return this.set(1,n,s,0,e,1,r,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,r=t._y,o=t._z,a=t._w,l=s+s,c=r+r,h=o+o,d=s*l,u=s*c,p=s*h,m=r*c,f=r*h,g=o*h,v=a*l,y=a*c,b=a*h,_=n.x,x=n.y,w=n.z;return i[0]=(1-(m+g))*_,i[1]=(u+b)*_,i[2]=(p-y)*_,i[3]=0,i[4]=(u-b)*x,i[5]=(1-(d+g))*x,i[6]=(f+v)*x,i[7]=0,i[8]=(p+y)*w,i[9]=(f-v)*w,i[10]=(1-(d+m))*w,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=o.set(i[0],i[1],i[2]).length();const r=o.set(i[4],i[5],i[6]).length(),l=o.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],a.copy(this);const c=1/s,h=1/r,d=1/l;return a.elements[0]*=c,a.elements[1]*=c,a.elements[2]*=c,a.elements[4]*=h,a.elements[5]*=h,a.elements[6]*=h,a.elements[8]*=d,a.elements[9]*=d,a.elements[10]*=d,t.setFromRotationMatrix(a),n.x=s,n.y=r,n.z=l,this}makePerspective(e,t,n,s,r,o,a=i._RZ){const l=this.elements,c=2*r/(t-e),h=2*r/(n-s),d=(t+e)/(t-e),u=(n+s)/(n-s);let p,m;if(a===i._RZ)p=-(o+r)/(o-r),m=-2*o*r/(o-r);else{if(a!==i.JCZ)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);p=-o/(o-r),m=-o*r/(o-r)}return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=u,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,s,r,o,a=i._RZ){const l=this.elements,c=1/(t-e),h=1/(n-s),d=1/(o-r),u=(t+e)*c,p=(n+s)*h;let m,f;if(a===i._RZ)m=(o+r)*d,f=-2*d;else{if(a!==i.JCZ)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);m=r*d,f=-1*d}return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-u,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=f,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const o=new s.P,a=new r,l=new s.P(0,0,0),c=new s.P(1,1,1),h=new s.P,d=new s.P,u=new s.P},82094:(e,t,n)=>{"use strict";n.d(t,{J:()=>l});var i=n(23130),s=n(19588);const r=new s.P,o=new s.P,a=new i.V;class l{constructor(e=new s.P(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=r.subVectors(n,t).cross(o.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(r),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||a.getNormalMatrix(e),i=this.coplanarPoint(r).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}},78943:(e,t,n)=>{"use strict";n.d(t,{_:()=>s});var i=n(71050);class s{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,r,o){let a=n[i+0],l=n[i+1],c=n[i+2],h=n[i+3];const d=s[r+0],u=s[r+1],p=s[r+2],m=s[r+3];if(0===o)return e[t+0]=a,e[t+1]=l,e[t+2]=c,void(e[t+3]=h);if(1===o)return e[t+0]=d,e[t+1]=u,e[t+2]=p,void(e[t+3]=m);if(h!==m||a!==d||l!==u||c!==p){let e=1-o;const t=a*d+l*u+c*p+h*m,n=t>=0?1:-1,i=1-t*t;if(i>Number.EPSILON){const s=Math.sqrt(i),r=Math.atan2(s,t*n);e=Math.sin(e*r)/s,o=Math.sin(o*r)/s}const s=o*n;if(a=a*e+d*s,l=l*e+u*s,c=c*e+p*s,h=h*e+m*s,e===1-o){const e=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=e,l*=e,c*=e,h*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,r){const o=n[i],a=n[i+1],l=n[i+2],c=n[i+3],h=s[r],d=s[r+1],u=s[r+2],p=s[r+3];return e[t]=o*p+c*h+a*u-l*d,e[t+1]=a*p+c*d+l*h-o*u,e[t+2]=l*p+c*u+o*d-a*h,e[t+3]=c*p-o*h-a*d-l*u,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const n=e._x,i=e._y,s=e._z,r=e._order,o=Math.cos,a=Math.sin,l=o(n/2),c=o(i/2),h=o(s/2),d=a(n/2),u=a(i/2),p=a(s/2);switch(r){case"XYZ":this._x=d*c*h+l*u*p,this._y=l*u*h-d*c*p,this._z=l*c*p+d*u*h,this._w=l*c*h-d*u*p;break;case"YXZ":this._x=d*c*h+l*u*p,this._y=l*u*h-d*c*p,this._z=l*c*p-d*u*h,this._w=l*c*h+d*u*p;break;case"ZXY":this._x=d*c*h-l*u*p,this._y=l*u*h+d*c*p,this._z=l*c*p+d*u*h,this._w=l*c*h-d*u*p;break;case"ZYX":this._x=d*c*h-l*u*p,this._y=l*u*h+d*c*p,this._z=l*c*p-d*u*h,this._w=l*c*h+d*u*p;break;case"YZX":this._x=d*c*h+l*u*p,this._y=l*u*h+d*c*p,this._z=l*c*p-d*u*h,this._w=l*c*h-d*u*p;break;case"XZY":this._x=d*c*h-l*u*p,this._y=l*u*h-d*c*p,this._z=l*c*p+d*u*h,this._w=l*c*h+d*u*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],r=t[1],o=t[5],a=t[9],l=t[2],c=t[6],h=t[10],d=n+o+h;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-a)*e,this._y=(s-l)*e,this._z=(r-i)*e}else if(n>o&&n>h){const e=2*Math.sqrt(1+n-o-h);this._w=(c-a)/e,this._x=.25*e,this._y=(i+r)/e,this._z=(s+l)/e}else if(o>h){const e=2*Math.sqrt(1+o-n-h);this._w=(s-l)/e,this._x=(i+r)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+h-n-o);this._w=(r-i)/e,this._x=(s+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(i.uZ(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,r=e._w,o=t._x,a=t._y,l=t._z,c=t._w;return this._x=n*c+r*o+i*l-s*a,this._y=i*c+r*a+s*o-n*l,this._z=s*c+r*l+n*a-i*o,this._w=r*c-n*o-i*a-s*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,i=this._y,s=this._z,r=this._w;let o=r*e._w+n*e._x+i*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=r,this._x=n,this._y=i,this._z=s,this;const a=1-o*o;if(a<=Number.EPSILON){const e=1-t;return this._w=e*r+t*this._w,this._x=e*n+t*this._x,this._y=e*i+t*this._y,this._z=e*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=r*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),n*Math.sin(s),n*Math.cos(s),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}},96643:(e,t,n)=>{"use strict";n.d(t,{z:()=>d});var i=n(19588);const s=new i.P,r=new i.P,o=new i.P,a=new i.P,l=new i.P,c=new i.P,h=new i.P;class d{constructor(e=new i.P,t=new i.P(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,s)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=s.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(s.copy(this.origin).addScaledVector(this.direction,t),s.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){r.copy(e).add(t).multiplyScalar(.5),o.copy(t).sub(e).normalize(),a.copy(this.origin).sub(r);const s=.5*e.distanceTo(t),l=-this.direction.dot(o),c=a.dot(this.direction),h=-a.dot(o),d=a.lengthSq(),u=Math.abs(1-l*l);let p,m,f,g;if(u>0)if(p=l*h-c,m=l*c-h,g=s*u,p>=0)if(m>=-g)if(m<=g){const e=1/u;p*=e,m*=e,f=p*(p+l*m+2*c)+m*(l*p+m+2*h)+d}else m=s,p=Math.max(0,-(l*m+c)),f=-p*p+m*(m+2*h)+d;else m=-s,p=Math.max(0,-(l*m+c)),f=-p*p+m*(m+2*h)+d;else m<=-g?(p=Math.max(0,-(-l*s+c)),m=p>0?-s:Math.min(Math.max(-s,-h),s),f=-p*p+m*(m+2*h)+d):m<=g?(p=0,m=Math.min(Math.max(-s,-h),s),f=m*(m+2*h)+d):(p=Math.max(0,-(l*s+c)),m=p>0?s:Math.min(Math.max(-s,-h),s),f=-p*p+m*(m+2*h)+d);else m=l>0?-s:s,p=Math.max(0,-(l*m+c)),f=-p*p+m*(m+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,p),i&&i.copy(r).addScaledVector(o,m),f}intersectSphere(e,t){s.subVectors(e.center,this.origin);const n=s.dot(this.direction),i=s.dot(s)-n*n,r=e.radius*e.radius;if(i>r)return null;const o=Math.sqrt(r-i),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,r,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,i=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,i=(e.min.x-d.x)*l),c>=0?(s=(e.min.y-d.y)*c,r=(e.max.y-d.y)*c):(s=(e.max.y-d.y)*c,r=(e.min.y-d.y)*c),n>r||s>i?null:((s>n||isNaN(n))&&(n=s),(r=0?(o=(e.min.z-d.z)*h,a=(e.max.z-d.z)*h):(o=(e.max.z-d.z)*h,a=(e.min.z-d.z)*h),n>a||o>i?null:((o>n||n!=n)&&(n=o),(a=0?n:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,s)}intersectTriangle(e,t,n,i,s){l.subVectors(t,e),c.subVectors(n,e),h.crossVectors(l,c);let r,o=this.direction.dot(h);if(o>0){if(i)return null;r=1}else{if(!(o<0))return null;r=-1,o=-o}a.subVectors(this.origin,e);const d=r*this.direction.dot(c.crossVectors(a,c));if(d<0)return null;const u=r*this.direction.dot(l.cross(a));if(u<0)return null;if(d+u>o)return null;const p=-r*a.dot(h);return p<0?null:this.at(p/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}},57471:(e,t,n)=>{"use strict";n.d(t,{a:()=>l});var i=n(37840),s=n(19588);const r=new i.Z,o=new s.P,a=new s.P;class l{constructor(e=new s.P,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):r.setFromPoints(e).getCenter(n);let i=0;for(let t=0,s=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;o.subVectors(e,this.center);const t=o.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(o,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(a.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(o.copy(e.center).add(a)),this.expandByPoint(o.copy(e.center).sub(a))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}},40693:(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var i=n(71050);class s{constructor(e=0,t=0){s.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(i.uZ(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,r=this.y-e.y;return this.x=s*n-r*i+e.x,this.y=s*i+r*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}},19588:(e,t,n)=>{"use strict";n.d(t,{P:()=>r});var i=n(71050),s=n(78943);class r{constructor(e=0,t=0,n=0){r.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(a.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(a.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,r=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*r,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*r,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*r,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,r=e.y,o=e.z,a=e.w,l=2*(r*i-o*n),c=2*(o*t-s*i),h=2*(s*n-r*t);return this.x=t+a*l+r*h-o*c,this.y=n+a*c+o*l-s*h,this.z=i+a*h+s*c-r*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,r=t.x,o=t.y,a=t.z;return this.x=i*a-s*o,this.y=s*r-n*a,this.z=n*o-i*r,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return o.copy(this).projectOnVector(e),this.sub(o)}reflect(e){return this.sub(o.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(i.uZ(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const o=new r,a=new s._},84538:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});class i{constructor(e=0,t=0,n=0,s=1){i.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i+r[12]*s,this.y=r[1]*t+r[5]*n+r[9]*i+r[13]*s,this.z=r[2]*t+r[6]*n+r[10]*i+r[14]*s,this.w=r[3]*t+r[7]*n+r[11]*i+r[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s;const r=.01,o=.1,a=e.elements,l=a[0],c=a[4],h=a[8],d=a[1],u=a[5],p=a[9],m=a[2],f=a[6],g=a[10];if(Math.abs(c-d)a&&e>v?ev?a{"use strict";n.d(t,{Z:()=>s});var i=n(25499);class s extends i.T{constructor(){super(),this.isGroup=!0,this.type="Group"}}},93122:(e,t,n)=>{"use strict";n.d(t,{x:()=>g});var i=n(57471),s=n(96643),r=n(82587),o=n(25499),a=n(19588),l=n(64026),c=n(75809),h=n(35322);const d=new a.P,u=new a.P,p=new r.y,m=new s.z,f=new i.a;class g extends o.T{constructor(e=new c.u,t=new l.n){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,i=t.count;el)continue;u.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(u);re.far||t.push({distance:r,point:d.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,r.start),i=Math.min(y.count,r.start+r.count)-1;nl)continue;u.applyMatrix4(this.matrixWorld);const i=e.ray.origin.distanceTo(u);ie.far||t.push({distance:i,point:d.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e{"use strict";n.d(t,{e:()=>l});var i=n(93122),s=n(19588),r=n(35322);const o=new s.P,a=new s.P;class l extends i.x{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,i=t.count;e{"use strict";n.d(t,{K:()=>B});var i=n(19588),s=n(40693),r=n(57471),o=n(96643),a=n(82587),l=n(25499);const c=new i.P,h=new i.P,d=new i.P,u=new i.P,p=new i.P,m=new i.P,f=new i.P,g=new i.P,v=new i.P,y=new i.P;let b=!1;class _{constructor(e=new i.P,t=new i.P,n=new i.P){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),c.subVectors(e,t),i.cross(c);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){c.subVectors(i,t),h.subVectors(n,t),d.subVectors(e,t);const r=c.dot(c),o=c.dot(h),a=c.dot(d),l=h.dot(h),u=h.dot(d),p=r*l-o*o;if(0===p)return s.set(-2,-1,-1);const m=1/p,f=(l*a-o*u)*m,g=(r*u-o*a)*m;return s.set(1-f-g,g,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,u),u.x>=0&&u.y>=0&&u.x+u.y<=1}static getUV(e,t,n,i,s,r,o,a){return!1===b&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),b=!0),this.getInterpolation(e,t,n,i,s,r,o,a)}static getInterpolation(e,t,n,i,s,r,o,a){return this.getBarycoord(e,t,n,i,u),a.setScalar(0),a.addScaledVector(s,u.x),a.addScaledVector(r,u.y),a.addScaledVector(o,u.z),a}static isFrontFacing(e,t,n,i){return c.subVectors(n,t),h.subVectors(e,t),c.cross(h).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return c.subVectors(this.c,this.b),h.subVectors(this.a,this.b),.5*c.cross(h).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return _.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return _.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return!1===b&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),b=!0),_.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}getInterpolation(e,t,n,i,s){return _.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return _.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return _.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let r,o;p.subVectors(i,n),m.subVectors(s,n),g.subVectors(e,n);const a=p.dot(g),l=m.dot(g);if(a<=0&&l<=0)return t.copy(n);v.subVectors(e,i);const c=p.dot(v),h=m.dot(v);if(c>=0&&h<=c)return t.copy(i);const d=a*h-c*l;if(d<=0&&a>=0&&c<=0)return r=a/(a-c),t.copy(n).addScaledVector(p,r);y.subVectors(e,s);const u=p.dot(y),b=m.dot(y);if(b>=0&&u<=b)return t.copy(s);const _=u*l-a*b;if(_<=0&&l>=0&&b<=0)return o=l/(l-b),t.copy(n).addScaledVector(m,o);const x=c*b-u*h;if(x<=0&&h-c>=0&&u-b>=0)return f.subVectors(s,i),o=(h-c)/(h-c+(u-b)),t.copy(i).addScaledVector(f,o);const w=1/(x+_+d);return r=_*w,o=d*w,t.copy(n).addScaledVector(p,r).addScaledVector(m,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}var x=n(75544),w=n(24479),S=n(75809);const M=new a.y,E=new o.z,T=new r.a,C=new i.P,A=new i.P,P=new i.P,R=new i.P,L=new i.P,N=new i.P,D=new s.F,I=new s.F,O=new s.F,U=new i.P,k=new i.P,V=new i.P,z=new i.P,F=new i.P;class B extends l.T{constructor(e=new S.u,t=new w.v){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2)return}M.copy(s).invert(),E.copy(e.ray).applyMatrix4(M),null!==n.boundingBox&&!1===E.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,E)}}_computeIntersections(e,t,n){let i;const s=this.geometry,r=this.material,o=s.index,a=s.attributes.position,l=s.attributes.uv,c=s.attributes.uv1,h=s.attributes.normal,d=s.groups,u=s.drawRange;if(null!==o)if(Array.isArray(r))for(let s=0,a=d.length;sn.far?null:{distance:c,point:F.clone(),object:e}}(e,t,n,r,A,P,R,z);if(u){o&&(D.fromBufferAttribute(o,c),I.fromBufferAttribute(o,h),O.fromBufferAttribute(o,d),u.uv=_.getInterpolation(z,A,P,R,D,I,O,new s.F)),a&&(D.fromBufferAttribute(a,c),I.fromBufferAttribute(a,h),O.fromBufferAttribute(a,d),u.uv1=_.getInterpolation(z,A,P,R,D,I,O,new s.F),u.uv2=u.uv1),l&&(U.fromBufferAttribute(l,c),k.fromBufferAttribute(l,h),V.fromBufferAttribute(l,d),u.normal=_.getInterpolation(z,A,P,R,U,k,V,new i.P),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const e={a:c,b:h,c:d,normal:new i.P,materialIndex:0};_.getNormal(A,P,R,e.normal),u.face=e}return u}},65996:(e,t,n)=>{"use strict";n.d(t,{o:()=>u});var i=n(75544),s=n(8035),r=n(40071),o=n(44428),a=n(8173),l=n(46953),c=n(53203),h=n(48651),d=n(19564);class u extends l.d{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},s=[n,n,n,n,n,n];void 0!==t.encoding&&((0,d.O4)("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===i.knz?i.KI_:i.aCh),this.texture=new h.B(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:i.wem}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},l=new r.D(5,5,5),h=new o.j({name:"CubemapFromEquirect",uniforms:(0,a.dw)(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:i._Li,blending:i.jFi});h.uniforms.tEquirect.value=t;const d=new s.K(l,h),u=t.minFilter;t.minFilter===i.D1R&&(t.minFilter=i.wem);return new c._(1,10,this).update(e,d),t.minFilter=u,d.geometry.dispose(),d.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,n,i);e.setRenderTarget(s)}}},46953:(e,t,n)=>{"use strict";n.d(t,{d:()=>h});var i=n(19251),s=n(21364),r=n(75544),o=n(84538),a=n(37136),l=n(19564);class c extends i.p{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new o.L(0,0,e,t),this.scissorTest=!1,this.viewport=new o.L(0,0,e,t);const i={width:e,height:t,depth:1};void 0!==n.encoding&&((0,l.O4)("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===r.knz?r.KI_:r.aCh),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:r.wem,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new s.x(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new a.H(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class h extends c{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}},7177:(e,t,n)=>{"use strict";n.d(t,{C:()=>B});var i=n(75544),s=n(93113),r=n(53763),o=n(82587),a=n(40693),l=n(19588),c=n(84538),h=n(71050),d=n(54871),u=n(34455),p=n(26067),m=n(83596),f=n(595),g=n(49917),v=n(89479),y=n(5058),b=n(39412),_=n(24297),x=n(88753),w=n(72754),S=n(31132),M=n(27153),E=n(89321),T=n(96369),C=n(15003),A=n(84153),P=n(73981),R=n(46953),L=n(74859),N=n(14933),D=n(69963),I=n(64061),O=n(9840),U=n(53288),k=n(10267),V=n(37874),z=n(19564),F=n(19748);class B{constructor(e={}){const{canvas:t=(0,z.O5)(),context:n=null,depth:F=!0,stencil:B=!0,alpha:$=!1,antialias:j=!1,premultipliedAlpha:H=!0,preserveDrawingBuffer:G=!1,powerPreference:Z="default",failIfMajorPerformanceCaveat:W=!1}=e;let q;this.isWebGLRenderer=!0,q=null!==n?n.getContextAttributes().alpha:$;const X=new Uint32Array(4),Y=new Int32Array(4);let K=null,J=null;const Q=[],ee=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=i.KI_,this._useLegacyLights=!1,this.toneMapping=i.uL9,this.toneMappingExposure=1;const te=this;let ne=!1,ie=0,se=0,re=null,oe=-1,ae=null;const le=new c.L,ce=new c.L;let he=null;const de=new s.I(0);let ue=0,pe=t.width,me=t.height,fe=1,ge=null,ve=null;const ye=new c.L(0,0,pe,me),be=new c.L(0,0,pe,me);let _e=!1;const xe=new r.i;let we=!1,Se=!1,Me=null;const Ee=new o.y,Te=new a.F,Ce=new l.P,Ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Pe(){return null===re?fe:1}let Re,Le,Ne,De,Ie,Oe,Ue,ke,Ve,ze,Fe,Be,$e,je,He,Ge,Ze,We,qe,Xe,Ye,Ke,Je,Qe,et=n;function tt(e,n){for(let i=0;i0),u=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,m=!!n.morphAttributes.color;let f=i.uL9;s.toneMapped&&(null!==re&&!0!==re.isXRRenderTarget||(f=te.toneMapping));const g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,v=void 0!==g?g.length:0,y=Ie.get(s),b=J.state.lights;if(!0===we&&(!0===Se||e!==ae)){const t=e===ae&&s.id===oe;Ge.setState(s,e,t)}let _=!1;s.version===y.__version?y.needsLights&&y.lightsStateVersion!==b.state.version||y.outputColorSpace!==l||r.isInstancedMesh&&!1===y.instancing?_=!0:r.isInstancedMesh||!0!==y.instancing?r.isSkinnedMesh&&!1===y.skinning?_=!0:r.isSkinnedMesh||!0!==y.skinning?r.isInstancedMesh&&!0===y.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===y.instancingColor&&null!==r.instanceColor||y.envMap!==c||!0===s.fog&&y.fog!==o?_=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===Ge.numPlanes&&y.numIntersection===Ge.numIntersection?(y.vertexAlphas!==h||y.vertexTangents!==d||y.morphTargets!==u||y.morphNormals!==p||y.morphColors!==m||y.toneMapping!==f||!0===Le.isWebGL2&&y.morphTargetsCount!==v)&&(_=!0):_=!0:_=!0:_=!0:(_=!0,y.__version=s.version);let x=y.currentProgram;!0===_&&(x=vt(s,t,r));let w=!1,S=!1,M=!1;const E=x.getUniforms(),T=y.uniforms;Ne.useProgram(x.program)&&(w=!0,S=!0,M=!0);s.id!==oe&&(oe=s.id,S=!0);if(w||ae!==e){E.setValue(et,"projectionMatrix",e.projectionMatrix),E.setValue(et,"viewMatrix",e.matrixWorldInverse);const t=E.map.cameraPosition;void 0!==t&&t.setValue(et,Ce.setFromMatrixPosition(e.matrixWorld)),Le.logarithmicDepthBuffer&&E.setValue(et,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(s.isMeshPhongMaterial||s.isMeshToonMaterial||s.isMeshLambertMaterial||s.isMeshBasicMaterial||s.isMeshStandardMaterial||s.isShaderMaterial)&&E.setValue(et,"isOrthographic",!0===e.isOrthographicCamera),ae!==e&&(ae=e,S=!0,M=!0)}if(r.isSkinnedMesh){E.setOptional(et,r,"bindMatrix"),E.setOptional(et,r,"bindMatrixInverse");const e=r.skeleton;e&&(Le.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),E.setValue(et,"boneTexture",e.boneTexture,Oe),E.setValue(et,"boneTextureSize",e.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const C=n.morphAttributes;(void 0!==C.position||void 0!==C.normal||void 0!==C.color&&!0===Le.isWebGL2)&&qe.update(r,n,x);(S||y.receiveShadow!==r.receiveShadow)&&(y.receiveShadow=r.receiveShadow,E.setValue(et,"receiveShadow",r.receiveShadow));s.isMeshGouraudMaterial&&null!==s.envMap&&(T.envMap.value=c,T.flipEnvMap.value=c.isCubeTexture&&!1===c.isRenderTargetTexture?-1:1);S&&(E.setValue(et,"toneMappingExposure",te.toneMappingExposure),y.needsLights&&(P=M,(A=T).ambientLightColor.needsUpdate=P,A.lightProbe.needsUpdate=P,A.directionalLights.needsUpdate=P,A.directionalLightShadows.needsUpdate=P,A.pointLights.needsUpdate=P,A.pointLightShadows.needsUpdate=P,A.spotLights.needsUpdate=P,A.spotLightShadows.needsUpdate=P,A.rectAreaLights.needsUpdate=P,A.hemisphereLights.needsUpdate=P),o&&!0===s.fog&&$e.refreshFogUniforms(T,o),$e.refreshMaterialUniforms(T,s,fe,me,Me),I.y.upload(et,yt(y),T,Oe));var A,P;s.isShaderMaterial&&!0===s.uniformsNeedUpdate&&(I.y.upload(et,yt(y),T,Oe),s.uniformsNeedUpdate=!1);s.isSpriteMaterial&&E.setValue(et,"center",r.center);if(E.setValue(et,"modelViewMatrix",r.modelViewMatrix),E.setValue(et,"normalMatrix",r.normalMatrix),E.setValue(et,"modelMatrix",r.matrixWorld),s.isShaderMaterial||s.isRawShaderMaterial){const e=s.uniformsGroups;for(let t=0,n=e.length;t{function n(){i.forEach((function(e){Ie.get(e).currentProgram.isReady()&&i.delete(e)})),0!==i.size?setTimeout(n,10):t(e)}null!==Re.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let ct=null;function ht(){ut.stop()}function dt(){ut.start()}const ut=new d.C;function pt(e,t,n,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)J.pushLight(e),e.castShadow&&J.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||xe.intersectsSprite(e)){i&&Ce.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Ee);const t=Fe.update(e),s=e.material;s.visible&&K.push(e,t,s,n,Ce.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||xe.intersectsObject(e))){const t=Fe.update(e),s=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),Ce.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),Ce.copy(t.boundingSphere.center)),Ce.applyMatrix4(e.matrixWorld).applyMatrix4(Ee)),Array.isArray(s)){const i=t.groups;for(let r=0,o=i.length;r0&&function(e,t,n,s){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;const r=Le.isWebGL2;null===Me&&(Me=new R.d(1,1,{generateMipmaps:!0,type:Re.has("EXT_color_buffer_half_float")?i.cLu:i.ywz,minFilter:i.D1R,samples:r?4:0}));te.getDrawingBufferSize(Te),r?Me.setSize(Te.x,Te.y):Me.setSize((0,h.gy)(Te.x),(0,h.gy)(Te.y));const o=te.getRenderTarget();te.setRenderTarget(Me),te.getClearColor(de),ue=te.getClearAlpha(),ue<1&&te.setClearColor(16777215,.5);te.clear();const a=te.toneMapping;te.toneMapping=i.uL9,ft(e,n,s),Oe.updateMultisampleRenderTarget(Me),Oe.updateRenderTargetMipmap(Me);let l=!1;for(let e=0,r=t.length;e0&&ft(r,t,n),o.length>0&&ft(o,t,n),a.length>0&&ft(a,t,n),Ne.buffers.depth.setTest(!0),Ne.buffers.depth.setMask(!0),Ne.buffers.color.setMask(!0),Ne.setPolygonOffset(!1)}function ft(e,t,n){const i=!0===t.isScene?t.overrideMaterial:null;for(let s=0,r=e.length;s0?ee[ee.length-1]:null,Q.pop(),K=Q.length>0?Q[Q.length-1]:null},this.getActiveCubeFace=function(){return ie},this.getActiveMipmapLevel=function(){return se},this.getRenderTarget=function(){return re},this.setRenderTargetTextures=function(e,t,n){Ie.get(e.texture).__webglTexture=t,Ie.get(e.depthTexture).__webglTexture=n;const i=Ie.get(e);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===Re.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const n=Ie.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){re=e,ie=t,se=n;let i=!0,s=null,r=!1,o=!1;if(e){const a=Ie.get(e);void 0!==a.__useDefaultFramebuffer?(Ne.bindFramebuffer(et.FRAMEBUFFER,null),i=!1):void 0===a.__webglFramebuffer?Oe.setupRenderTarget(e):a.__hasExternalTextures&&Oe.rebindTextures(e,Ie.get(e.texture).__webglTexture,Ie.get(e.depthTexture).__webglTexture);const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=Ie.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(s=Array.isArray(c[t])?c[t][n]:c[t],r=!0):s=Le.isWebGL2&&e.samples>0&&!1===Oe.useMultisampledRTT(e)?Ie.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,le.copy(e.viewport),ce.copy(e.scissor),he=e.scissorTest}else le.copy(ye).multiplyScalar(fe).floor(),ce.copy(be).multiplyScalar(fe).floor(),he=_e;if(Ne.bindFramebuffer(et.FRAMEBUFFER,s)&&Le.drawBuffers&&i&&Ne.drawBuffers(e,s),Ne.viewport(le),Ne.scissor(ce),Ne.setScissorTest(he),r){const i=Ie.get(e.texture);et.framebufferTexture2D(et.FRAMEBUFFER,et.COLOR_ATTACHMENT0,et.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,n)}else if(o){const i=Ie.get(e.texture),s=t||0;et.framebufferTextureLayer(et.FRAMEBUFFER,et.COLOR_ATTACHMENT0,i.__webglTexture,n||0,s)}oe=-1},this.readRenderTargetPixels=function(e,t,n,s,r,o,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let l=Ie.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(l=l[a]),l){Ne.bindFramebuffer(et.FRAMEBUFFER,l);try{const a=e.texture,l=a.format,c=a.type;if(l!==i.wk1&&Ke.convert(l)!==et.getParameter(et.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const h=c===i.cLu&&(Re.has("EXT_color_buffer_half_float")||Le.isWebGL2&&Re.has("EXT_color_buffer_float"));if(!(c===i.ywz||Ke.convert(c)===et.getParameter(et.IMPLEMENTATION_COLOR_READ_TYPE)||c===i.VzW&&(Le.isWebGL2||Re.has("OES_texture_float")||Re.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-s&&n>=0&&n<=e.height-r&&et.readPixels(t,n,s,r,Ke.convert(l),Ke.convert(c),o)}finally{const e=null!==re?Ie.get(re).__webglFramebuffer:null;Ne.bindFramebuffer(et.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){const i=Math.pow(2,-n),s=Math.floor(t.image.width*i),r=Math.floor(t.image.height*i);Oe.setTexture2D(t,0),et.copyTexSubImage2D(et.TEXTURE_2D,n,0,0,e.x,e.y,s,r),Ne.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i=0){const s=t.image.width,r=t.image.height,o=Ke.convert(n.format),a=Ke.convert(n.type);Oe.setTexture2D(n,0),et.pixelStorei(et.UNPACK_FLIP_Y_WEBGL,n.flipY),et.pixelStorei(et.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),et.pixelStorei(et.UNPACK_ALIGNMENT,n.unpackAlignment),t.isDataTexture?et.texSubImage2D(et.TEXTURE_2D,i,e.x,e.y,s,r,o,a,t.image.data):t.isCompressedTexture?et.compressedTexSubImage2D(et.TEXTURE_2D,i,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):et.texSubImage2D(et.TEXTURE_2D,i,e.x,e.y,o,a,t.image),0===i&&n.generateMipmaps&&et.generateMipmap(et.TEXTURE_2D),Ne.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,i,s=0){if(te.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const r=e.max.x-e.min.x+1,o=e.max.y-e.min.y+1,a=e.max.z-e.min.z+1,l=Ke.convert(i.format),c=Ke.convert(i.type);let h;if(i.isData3DTexture)Oe.setTexture3D(i,0),h=et.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Oe.setTexture2DArray(i,0),h=et.TEXTURE_2D_ARRAY}et.pixelStorei(et.UNPACK_FLIP_Y_WEBGL,i.flipY),et.pixelStorei(et.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),et.pixelStorei(et.UNPACK_ALIGNMENT,i.unpackAlignment);const d=et.getParameter(et.UNPACK_ROW_LENGTH),u=et.getParameter(et.UNPACK_IMAGE_HEIGHT),p=et.getParameter(et.UNPACK_SKIP_PIXELS),m=et.getParameter(et.UNPACK_SKIP_ROWS),f=et.getParameter(et.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[0]:n.image;et.pixelStorei(et.UNPACK_ROW_LENGTH,g.width),et.pixelStorei(et.UNPACK_IMAGE_HEIGHT,g.height),et.pixelStorei(et.UNPACK_SKIP_PIXELS,e.min.x),et.pixelStorei(et.UNPACK_SKIP_ROWS,e.min.y),et.pixelStorei(et.UNPACK_SKIP_IMAGES,e.min.z),n.isDataTexture||n.isData3DTexture?et.texSubImage3D(h,s,t.x,t.y,t.z,r,o,a,l,c,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),et.compressedTexSubImage3D(h,s,t.x,t.y,t.z,r,o,a,l,g.data)):et.texSubImage3D(h,s,t.x,t.y,t.z,r,o,a,l,c,g),et.pixelStorei(et.UNPACK_ROW_LENGTH,d),et.pixelStorei(et.UNPACK_IMAGE_HEIGHT,u),et.pixelStorei(et.UNPACK_SKIP_PIXELS,p),et.pixelStorei(et.UNPACK_SKIP_ROWS,m),et.pixelStorei(et.UNPACK_SKIP_IMAGES,f),0===s&&i.generateMipmaps&&et.generateMipmap(h),Ne.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?Oe.setTextureCube(e,0):e.isData3DTexture?Oe.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?Oe.setTexture2DArray(e,0):Oe.setTexture2D(e,0),Ne.unbindTexture()},this.resetState=function(){ie=0,se=0,re=null,Ne.reset(),Je.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return i._RZ}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===i.ntt?"display-p3":"srgb",t.unpackColorSpace=F.ep.workingColorSpace===i.AmZ?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===i.KI_?i.knz:i.rnI}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===i.knz?i.KI_:i.GUF}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}},76944:(e,t,n)=>{"use strict";n.d(t,{W:()=>i});const i={alphahash_fragment:"\n#ifdef USE_ALPHAHASH\n\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n\n#endif\n",alphahash_pars_fragment:"\n#ifdef USE_ALPHAHASH\n\n\t/**\n\t * See: https://casual-effects.com/research/Wyman2017Hashed/index.html\n\t */\n\n\tconst float ALPHA_HASH_SCALE = 0.05; // Derived from trials only, and may be changed.\n\n\tfloat hash2D( vec2 value ) {\n\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\n\t}\n\n\tfloat hash3D( vec3 value ) {\n\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\n\t}\n\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\n\t\t// Find the discretized derivatives of our coordinates\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\n\t\t// Find two nearest log-discretized noise scales\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\n\t\t// Compute alpha thresholds at our two noise scales\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\n\t\t// Factor to interpolate lerp with\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\n\t\t// Interpolate alpha threshold from noise at two scales\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\n\t\t// Pass into CDF to compute uniformly distrib threshold\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\n\t\t// Find our final, uniformly distributed alpha threshold (ατ)\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\n\t\t// Avoids ατ == 0. Could also do ατ =1-ατ\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\n\t}\n\n#endif\n",alphamap_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n\n#endif\n",alphamap_pars_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",alphatest_fragment:"\n#ifdef USE_ALPHATEST\n\n\tif ( diffuseColor.a < alphaTest ) discard;\n\n#endif\n",alphatest_pars_fragment:"\n#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif\n",aomap_fragment:"\n#ifdef USE_AOMAP\n\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\n\t#endif\n\n#endif\n",aomap_pars_fragment:"\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n\n#endif\n",begin_vertex:"\nvec3 transformed = vec3( position );\n\n#ifdef USE_ALPHAHASH\n\n\tvPosition = vec3( position );\n\n#endif\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n\n#ifdef USE_TANGENT\n\n\tvec3 objectTangent = vec3( tangent.xyz );\n\n#endif\n",bsdfs:"\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n",iridescence_fragment:"\n\n#ifdef USE_IRIDESCENCE\n\n\t// XYZ to linear-sRGB color space\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\n\t// Assume air interface for top\n\t// Note: We don't handle the case fresnel0 == 1\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\n\t}\n\n\t// Conversion FO/IOR\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\n\t}\n\n\t// ior is a value between 1.0 and 3.0. 1.0 is air interface\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\n\t}\n\n\t// Fresnel equations for dielectric/dielectric interfaces.\n\t// Ref: https://belcour.github.io/blog/research/2017/05/01/brdf-thin-film.html\n\t// Evaluation XYZ sensitivity curves in Fourier space\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\n\t}\n\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\n\t\tvec3 I;\n\n\t\t// Force iridescenceIOR -> outsideIOR when thinFilmThickness -> 0.0\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\t// Evaluate the cosTheta on the base layer (Snell law)\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\n\t\t// Handle TIR:\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\n\t\t\treturn vec3( 1.0 );\n\n\t\t}\n\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\n\t\t// First interface\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\n\t\t// Second interface\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); // guard against 1.0\n\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\n\t\t// Phase shift\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\n\t\t// Compound terms\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\n\t\t// Reflectance term for m = 0 (DC term amplitude)\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\n\t\t// Reflectance term for m > 0 (pairs of diracs)\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\n\t\t}\n\n\t\t// Since out of gamut colors might be produced, negative color values are clamped to 0.\n\t\treturn max( I, vec3( 0.0 ) );\n\n\t}\n\n#endif\n\n",bumpmap_pars_fragment:"\n#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n\t// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\n\t\t// normalize is done to ensure that the bump map looks the same regardless of the texture's scale\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm; // normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",clipping_planes_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvec4 plane;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\n\t\tbool clipped = true;\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t\tif ( clipped ) discard;\n\n\t#endif\n\n#endif\n",clipping_planes_pars_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n\n#endif\n",clipping_planes_pars_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n#endif\n",clipping_planes_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvClipPosition = - mvPosition.xyz;\n\n#endif\n",color_fragment:"\n#if defined( USE_COLOR_ALPHA )\n\n\tdiffuseColor *= vColor;\n\n#elif defined( USE_COLOR )\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif\n",color_pars_fragment:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvarying vec4 vColor;\n\n#elif defined( USE_COLOR )\n\n\tvarying vec3 vColor;\n\n#endif\n",color_pars_vertex:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvarying vec4 vColor;\n\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\n\tvarying vec3 vColor;\n\n#endif\n",color_vertex:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvColor = vec4( 1.0 );\n\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\n\tvColor = vec3( 1.0 );\n\n#endif\n\n#ifdef USE_COLOR\n\n\tvColor *= color;\n\n#endif\n\n#ifdef USE_INSTANCING_COLOR\n\n\tvColor.xyz *= instanceColor.xyz;\n\n#endif\n",common:"\n#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n\n#ifndef saturate\n// may have defined saturate() already\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\n\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\n\treturn fract( sin( sn ) * c );\n\n}\n\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\n\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\n\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n\n#ifdef USE_ALPHAHASH\n\n\tvarying vec3 vPosition;\n\n#endif\n\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n}\n\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t// dir can be either a direction vector or a normal vector\n\t// upper-left 3x3 of matrix is assumed to be orthogonal\n\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n\n}\n\nmat3 transposeMat3( const in mat3 m ) {\n\n\tmat3 tmp;\n\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\n\treturn tmp;\n\n}\n\nfloat luminance( const in vec3 rgb ) {\n\n\t// assumes rgb is in linear color space with sRGB primaries and D65 white point\n\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\n\treturn dot( weights, rgb );\n\n}\n\nbool isPerspectiveMatrix( mat4 m ) {\n\n\treturn m[ 2 ][ 3 ] == - 1.0;\n\n}\n\nvec2 equirectUv( in vec3 dir ) {\n\n\t// dir is assumed to be unit length\n\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\treturn vec2( u, v );\n\n}\n\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\n\t// Original approximation by Christophe Schlick '94\n\t// float fresnel = pow( 1.0 - dotVH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH '13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n\n} // validated\n\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\n\t// Original approximation by Christophe Schlick '94\n\t// float fresnel = pow( 1.0 - dotVH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH '13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n\n} // validated\n",cube_uv_reflection_fragment:"\n#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\n\t// These shader functions convert between the UV coordinates of a single face of\n\t// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n\t// sampling a textureCube (not generally normalized ).\n\n\tfloat getFace( vec3 direction ) {\n\n\t\tvec3 absDirection = abs( direction );\n\n\t\tfloat face = - 1.0;\n\n\t\tif ( absDirection.x > absDirection.z ) {\n\n\t\t\tif ( absDirection.x > absDirection.y )\n\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t} else {\n\n\t\t\tif ( absDirection.z > absDirection.y )\n\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t}\n\n\t\treturn face;\n\n\t}\n\n\t// RH coordinate system; PMREM face-indexing convention\n\tvec2 getUV( vec3 direction, float face ) {\n\n\t\tvec2 uv;\n\n\t\tif ( face == 0.0 ) {\n\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n\n\t\t} else if ( face == 1.0 ) {\n\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n\n\t\t} else if ( face == 2.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n\n\t\t} else if ( face == 3.0 ) {\n\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n\n\t\t} else if ( face == 4.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n\n\t\t} else {\n\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n\n\t\t}\n\n\t\treturn 0.5 * ( uv + 1.0 );\n\n\t}\n\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\n\t\tfloat face = getFace( direction );\n\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\n\t\tfloat faceSize = exp2( mipInt );\n\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; // #25071\n\n\t\tif ( face > 2.0 ) {\n\n\t\t\tuv.y += faceSize;\n\n\t\t\tface -= 3.0;\n\n\t\t}\n\n\t\tuv.x += face * faceSize;\n\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\n\t\t#ifdef texture2DGradEXT\n\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; // disable anisotropic filtering\n\n\t\t#else\n\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\n\t\t#endif\n\n\t}\n\n\t// These defines must match with PMREMGenerator\n\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\n\tfloat roughnessToMip( float roughness ) {\n\n\t\tfloat mip = 0.0;\n\n\t\tif ( roughness >= cubeUV_r1 ) {\n\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\n\t\t} else {\n\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness ); // 1.16 = 1.79^0.25\n\t\t}\n\n\t\treturn mip;\n\n\t}\n\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\n\t\tfloat mipF = fract( mip );\n\n\t\tfloat mipInt = floor( mip );\n\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\n\t\tif ( mipF == 0.0 ) {\n\n\t\t\treturn vec4( color0, 1.0 );\n\n\t\t} else {\n\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\n\t\t}\n\n\t}\n\n#endif\n",defaultnormal_vertex:"\nvec3 transformedNormal = objectNormal;\n\n#ifdef USE_INSTANCING\n\n\t// this is in lieu of a per-instance normal-matrix\n\t// shear transforms in the instance matrix are not supported\n\n\tmat3 m = mat3( instanceMatrix );\n\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\n\ttransformedNormal = m * transformedNormal;\n\n#endif\n\ntransformedNormal = normalMatrix * transformedNormal;\n\n#ifdef FLIP_SIDED\n\n\ttransformedNormal = - transformedNormal;\n\n#endif\n\n#ifdef USE_TANGENT\n\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#ifdef FLIP_SIDED\n\n\t\ttransformedTangent = - transformedTangent;\n\n\t#endif\n\n#endif\n",displacementmap_pars_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n",displacementmap_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n\n#endif\n",emissivemap_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n\n#endif\n",emissivemap_pars_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n",colorspace_fragment:"\ngl_FragColor = linearToOutputTexel( gl_FragColor );\n",colorspace_pars_fragment:"\n\n// http://www.russellcottrell.com/photo/matrixCalculator.htm\n\n// Linear sRGB => XYZ => Linear Display P3\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\n\n// Linear Display P3 => XYZ => Linear sRGB\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\n\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\n\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\n\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\n\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\n\n// @deprecated, r156\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\n\n// @deprecated, r156\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}\n",envmap_fragment:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvec3 cameraToFrag;\n\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\n\t\t}\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#else\n\n\t\tvec4 envColor = vec4( 0.0 );\n\n\t#endif\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",envmap_common_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif\n",envmap_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n\n#endif\n",envmap_pars_vertex:"\n#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n#endif\n",envmap_physical_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t\t#else\n\n\t\t\treturn vec3( 0.0 );\n\n\t\t#endif\n\n\t}\n\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\n\t\t\t// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t\t#else\n\n\t\t\treturn vec3( 0.0 );\n\n\t\t#endif\n\n\t}\n\n\t#ifdef USE_ANISOTROPY\n\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t\t\t // https://google.github.io/filament/Filament.md.html#lighting/imagebasedlights/anisotropy\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\n\t\t\t#else\n\n\t\t\t\treturn vec3( 0.0 );\n\n\t\t\t#endif\n\n\t\t}\n\n\t#endif\n\n#endif\n",envmap_vertex:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvWorldPosition = worldPosition.xyz;\n\n\t#else\n\n\t\tvec3 cameraToVertex;\n\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t\t}\n\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\n\n\tvFogDepth = - mvPosition.z;\n\n#endif\n",fog_pars_vertex:"\n#ifdef USE_FOG\n\n\tvarying float vFogDepth;\n\n#endif\n",fog_fragment:"\n#ifdef USE_FOG\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\n\t#endif\n\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\n#endif\n",fog_pars_fragment:"\n#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\n\t#endif\n\n#endif\n",gradientmap_pars_fragment:"\n\n#ifdef USE_GRADIENTMAP\n\n\tuniform sampler2D gradientMap;\n\n#endif\n\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\n\t// dotNL will be from -1.0 to 1.0\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\n\t#ifdef USE_GRADIENTMAP\n\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\n\t#else\n\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\n\t#endif\n\n}\n",lightmap_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n\n#endif\n",lightmap_pars_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif\n",lights_lambert_fragment:"\nLambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;\n",lights_lambert_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct LambertMaterial {\n\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n\n};\n\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n",lights_pars_begin:"\nuniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n\n#if defined( USE_LIGHT_PROBES )\n\n\tuniform vec3 lightProbe[ 9 ];\n\n#endif\n\n// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\n\t// normal is assumed to have unit length\n\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\n\t// band 1\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\n\t// band 2\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\n\treturn result;\n\n}\n\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\n\treturn irradiance;\n\n}\n\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\n\tvec3 irradiance = ambientLightColor;\n\n\treturn irradiance;\n\n}\n\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n\t#if defined ( LEGACY_LIGHTS )\n\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t\t}\n\n\t\treturn 1.0;\n\n\t#else\n\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t\t// page 32, equation 26: E[window1]\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\t\tif ( cutoffDistance > 0.0 ) {\n\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t\t}\n\n\t\treturn distanceFalloff;\n\n\t#endif\n\n}\n\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n\n}\n\n#if NUM_DIR_LIGHTS > 0\n\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\n\t}\n\n#endif\n\n\n#if NUM_POINT_LIGHTS > 0\n\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\n\t// light is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\n\t\tlight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\n\t}\n\n#endif\n\n\n#if NUM_SPOT_LIGHTS > 0\n\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\n\t// light is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\n\t\tlight.direction = normalize( lVector );\n\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\n\t\tif ( spotAttenuation > 0.0 ) {\n\n\t\t\tfloat lightDistance = length( lVector );\n\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\n\t\t} else {\n\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\n\t\t}\n\n\t}\n\n#endif\n\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\n\t// BRDF approximation Texture is 64x64\n\tuniform sampler2D ltc_1; // RGBA Float\n\tuniform sampler2D ltc_2; // RGBA Float\n\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n\n#endif\n\n\n#if NUM_HEMI_LIGHTS > 0\n\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\n\t\treturn irradiance;\n\n\t}\n\n#endif\n",lights_toon_fragment:"\nToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\n",lights_toon_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct ToonMaterial {\n\n\tvec3 diffuseColor;\n\n};\n\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n",lights_phong_fragment:"\nBlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct BlinnPhongMaterial {\n\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n",lights_physical_fragment:"\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\n\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\n\nmaterial.roughness = max( roughnessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n\n#ifdef IOR\n\n\tmaterial.ior = ior;\n\n\t#ifdef USE_SPECULAR\n\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\n\t\t#endif\n\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\n\t\t#endif\n\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\n\t#else\n\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\n\t#endif\n\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n\n#endif\n\n#ifdef USE_CLEARCOAT\n\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\n\t#ifdef USE_CLEARCOATMAP\n\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\n\t#endif\n\n\tmaterial.clearcoat = saturate( material.clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n\n#endif\n\n#ifdef USE_IRIDESCENCE\n\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\n\t#ifdef USE_IRIDESCENCEMAP\n\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\n\t#endif\n\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\n\t#else\n\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\n\t#endif\n\n#endif\n\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheenColor;\n\n\t#ifdef USE_SHEEN_COLORMAP\n\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\n\t#endif\n\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\n\t#endif\n\n#endif\n\n#ifdef USE_ANISOTROPY\n\n\t#ifdef USE_ANISOTROPYMAP\n\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\n\t#else\n\n\t\tvec2 anisotropyV = anisotropyVector;\n\n\t#endif\n\n\tmaterial.anisotropy = length( anisotropyV );\n\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\n\n\t// Roughness along the anisotropy bitangent is the material roughness, while the tangent roughness increases with anisotropy.\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;\n\n#endif\n",lights_physical_pars_fragment:'\n\nstruct PhysicalMaterial {\n\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n\n};\n\n// temporary\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\n\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n// https://google.github.io/filament/Filament.md.html#materialsystem/anisotropicmodel/anisotropicspecularbrdf\n#ifdef USE_ANISOTROPY\n\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\n\t\treturn saturate(v);\n\n\t}\n\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\n\t}\n\n#endif\n\n#ifdef USE_CLEARCOAT\n\n\t// GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\n\t\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\t\tfloat D = D_GGX( alpha, dotNH );\n\n\t\treturn F * ( V * D );\n\n\t}\n\n#endif\n\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\n\t#ifdef USE_IRIDESCENCE\n\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\n\t#endif\n\n\t#ifdef USE_ANISOTROPY\n\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\n\t#else\n\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\t\tfloat D = D_GGX( alpha, dotNH );\n\n\t#endif\n\n\treturn F * ( V * D );\n\n}\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\n\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\n\t// project rect onto sphere\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\n\t// calculate vector form factor\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs\nfloat D_Charlie( float roughness, float dotNH ) {\n\n\tfloat alpha = pow2( roughness );\n\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 ); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n\n}\n\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\n\treturn sheenColor * ( D * V );\n\n}\n\n#endif\n\n// This is a curve-fit approxmation to the "Charlie sheen" BRDF integrated over the hemisphere from \n// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF". The analysis can be found\n// in the Sheen section of https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tfloat r2 = roughness * roughness;\n\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\n\treturn saturate( DG * RECIPROCAL_PI );\n\n}\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\n\treturn fab;\n\n}\n\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\n\treturn specularColor * fab.x + specularF90 * fab.y;\n\n}\n\n// Fdez-Agüera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\n\t#ifdef USE_IRIDESCENCE\n\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\n\t#else\n\n\t\tvec3 Fr = specularColor;\n\n\t#endif\n\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction\n\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\n\t\t// LTC Fresnel Approximation by Stephen Hill\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\n\t}\n\n#endif\n\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\n\t#endif\n\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\n\t#endif\n\n\t// Both indirect specular and indirect diffuse light accumulate here\n\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\n\t#ifdef USE_IRIDESCENCE\n\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\n\t#else\n\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\n\t#endif\n\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n\n}\n',lights_fragment_begin:"\n/**\n * This is a template that can be used to light a material, it uses pluggable\n * RenderEquations (RE)for specific lighting scenarios.\n *\n * Instructions for use:\n * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined\n * - Create a material parameter that is to be passed as the third parameter to your lighting functions.\n *\n * TODO:\n * - Add area light support.\n * - Add sphere light support.\n * - Add diffuse light probe (irradiance cubemap) support.\n */\n\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n\n#ifdef USE_CLEARCOAT\n\n\tgeometryClearcoatNormal = clearcoatNormal;\n\n#endif\n\n#ifdef USE_IRIDESCENCE\n\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\n\tif ( material.iridescenceThickness == 0.0 ) {\n\n\t\tmaterial.iridescence = 0.0;\n\n\t} else {\n\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\n\t}\n\n\tif ( material.iridescence > 0.0 ) {\n\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\n\t\t// Iridescence F0 approximation\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\n\t}\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\n\t\t// spot lights are ordered [shadows with maps, shadows without maps, maps without shadows, none]\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\t#if defined( USE_LIGHT_PROBES )\n\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\n\t#endif\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_fragment_maps:"\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\t#ifdef USE_ANISOTROPY\n\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\n\t#else\n\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\n\t#endif\n\n#endif\n",lights_fragment_end:"\n#if defined( RE_IndirectDiffuse )\n\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n#endif\n",logdepthbuf_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\t// Doing a strict comparison with == 1.0 can cause noise artifacts\n\t// on some platforms. See issue #17623.\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n\n#endif\n",logdepthbuf_pars_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n\n#endif\n",logdepthbuf_pars_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\n\t#else\n\n\t\tuniform float logDepthBufFC;\n\n\t#endif\n\n#endif\n",logdepthbuf_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\n\t#else\n\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\n\t\t\tgl_Position.z *= gl_Position.w;\n\n\t\t}\n\n\t#endif\n\n#endif\n",map_fragment:"\n#ifdef USE_MAP\n\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\n\t#ifdef DECODE_VIDEO_TEXTURE\n\n\t\t// use inline sRGB decode until browsers properly support SRGB8_APLHA8 with video textures\n\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\n\tdiffuseColor *= sampledDiffuseColor;\n\n#endif\n",map_pars_fragment:"\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n",map_particle_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\t#if defined( USE_POINTS_UV )\n\n\t\tvec2 uv = vUv;\n\n\t#else\n\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n\t#endif\n\n#endif\n\n#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, uv );\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n\n#endif\n",map_particle_pars_fragment:"\n#if defined( USE_POINTS_UV )\n\n\tvarying vec2 vUv;\n\n#else\n\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\t\tuniform mat3 uvTransform;\n\n\t#endif\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",metalnessmap_fragment:"\nfloat metalnessFactor = metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n",metalnessmap_pars_fragment:"\n#ifdef USE_METALNESSMAP\n\n\tuniform sampler2D metalnessMap;\n\n#endif\n",morphcolor_vertex:"\n#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tvColor *= morphTargetBaseInfluence;\n\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t#if defined( USE_COLOR_ALPHA )\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\n\t\t#elif defined( USE_COLOR )\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\n\t\t#endif\n\n\t}\n\n#endif\n",morphnormal_vertex:"\n#ifdef USE_MORPHNORMALS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tobjectNormal *= morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\n\t\t}\n\n\t#else\n\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\n\t#endif\n\n#endif\n",morphtarget_pars_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\tuniform float morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\n\t\t}\n\n\t#else\n\n\t\t#ifndef USE_MORPHNORMALS\n\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\n\t\t#else\n\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",morphtarget_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\ttransformed *= morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\n\t\t}\n\n\t#else\n\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\n\t\t#ifndef USE_MORPHNORMALS\n\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",normal_fragment_begin:"\nfloat faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n\n#ifdef FLAT_SHADED\n\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#else\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal *= faceDirection;\n\n\t#endif\n\n#endif\n\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\n\t#ifdef USE_TANGENT\n\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\n\t#else\n\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\n\t#endif\n\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\n\t#endif\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\t#ifdef USE_TANGENT\n\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\n\t#else\n\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\n\t#endif\n\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\n\t#endif\n\n#endif\n\n// non perturbed normal for clearcoat among others\n\nvec3 nonPerturbedNormal = normal;\n\n",normal_fragment_maps:"\n\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n\t#ifdef FLIP_SIDED\n\n\t\tnormal = - normal;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * faceDirection;\n\n\t#endif\n\n\tnormal = normalize( normalMatrix * normal );\n\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\n\tnormal = normalize( tbn * mapN );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n\n#endif\n",normal_pars_fragment:"\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n",normal_pars_vertex:"\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n",normal_vertex:"\n#ifndef FLAT_SHADED // normal is computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n",normalmap_pars_fragment:"\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n#endif\n\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\n\tuniform mat3 normalMatrix;\n\n#endif\n\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\n\t// Normal Mapping Without Precomputed Tangents\n\t// http://www.thetenthplanet.de/archives/1180\n\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\n\t\tvec3 N = surf_norm; // normalized\n\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\n\t\treturn mat3( T * scale, B * scale, N );\n\n\t}\n\n#endif\n",clearcoat_normal_fragment_begin:"\n#ifdef USE_CLEARCOAT\n\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n\n#endif\n",clearcoat_normal_fragment_maps:"\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n\n#endif\n",clearcoat_pars_fragment:"\n\n#ifdef USE_CLEARCOATMAP\n\n\tuniform sampler2D clearcoatMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n\n#endif\n\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform sampler2D clearcoatRoughnessMap;\n\n#endif\n",iridescence_pars_fragment:"\n\n#ifdef USE_IRIDESCENCEMAP\n\n\tuniform sampler2D iridescenceMap;\n\n#endif\n\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tuniform sampler2D iridescenceThicknessMap;\n\n#endif\n",opaque_fragment:"\n#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\n\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n",packing:"\nvec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\n\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\n\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\n\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\n\treturn r * PackUpscale;\n}\n\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\n\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\n\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\n\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\n\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\n\n// NOTE: viewZ, the z-coordinate in camera space, is negative for points in front of the camera\n\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\t// -near maps to 0; -far maps to 1\n\treturn ( viewZ + near ) / ( near - far );\n}\n\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\t// maps orthographic depth in [ 0, 1 ] to viewZ\n\treturn depth * ( near - far ) - near;\n}\n\n// NOTE: https://twitter.com/gonnavis/status/1377183786949959682\n\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\t// -near maps to 0; -far maps to 1\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\n\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\t// maps perspective depth in [ 0, 1 ] to viewZ\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}\n",premultiplied_alpha_fragment:"\n#ifdef PREMULTIPLIED_ALPHA\n\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\n\tgl_FragColor.rgb *= gl_FragColor.a;\n\n#endif\n",project_vertex:"\nvec4 mvPosition = vec4( transformed, 1.0 );\n\n#ifdef USE_INSTANCING\n\n\tmvPosition = instanceMatrix * mvPosition;\n\n#endif\n\nmvPosition = modelViewMatrix * mvPosition;\n\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"\n#ifdef DITHERING\n\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\n#endif\n",dithering_pars_fragment:"\n#ifdef DITHERING\n\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift according to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\n#endif\n",roughnessmap_fragment:"\nfloat roughnessFactor = roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n",roughnessmap_pars_fragment:"\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;\n\n#endif\n",shadowmap_pars_fragment:"\n#if NUM_SPOT_LIGHT_COORDS > 0\n\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n\n#endif\n\n#if NUM_SPOT_LIGHT_MAPS > 0\n\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n\n#endif\n\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): create uniforms for area light shadows\n\n\t#endif\n\t*/\n\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n\t}\n\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\n\t}\n\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n\t\tfloat occlusion = 1.0;\n\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\n\t\tfloat hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n\t\tif (hard_shadow != 1.0 ) {\n\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality\n\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n\t\t}\n\t\treturn occlusion;\n\n\t}\n\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n\t\tfloat shadow = 1.0;\n\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\n\t\tif ( frustumTest ) {\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#else // no percentage-closer filtering:\n\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#endif\n\n\t\t}\n\n\t\treturn shadow;\n\n\t}\n\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\n\t// 2D texture:\n\t//\n\t// xzXZ\n\t// y Y\n\t//\n\t// Y - Positive y direction\n\t// y - Negative y direction\n\t// X - Positive x direction\n\t// x - Negative x direction\n\t// Z - Positive z direction\n\t// z - Negative z direction\n\t//\n\t// Source and test bed:\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\t\t// Number of texels to avoid at the edge of each square\n\n\t\tvec3 absV = abs( v );\n\n\t\t// Intersect unit cube\n\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\n\t\t// Apply scale to avoid seams\n\n\t\t// two texels less per square (one texel will do for NEAREST)\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\t\t// Unwrap\n\n\t\t// space: -1 ... 1 range for each square\n\t\t//\n\t\t// #X##\t\tdim := ( 4 , 2 )\n\t\t// # #\t\tcenter := ( 1 , 1 )\n\n\t\tvec2 planar = v.xy;\n\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\tif ( absV.z >= almostOne ) {\n\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t} else if ( absV.y >= almostOne ) {\n\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\n\t\t}\n\n\t\t// Transform to UV space\n\n\t\t// scale := 0.5 / dim\n\t\t// translate := ( center + 0.5 ) / dim\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t}\n\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\n\t\t// the vector from the light to the world-space position of the fragment.\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\n\t\t// dp = normalized distance from light to fragment position\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n\t\tdp += shadowBias;\n\n\t\t// bd3D = base direction 3D\n\t\tvec3 bd3D = normalize( lightToPosition );\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#else // no percentage-closer filtering\n\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\n\t\t#endif\n\n\t}\n\n#endif\n",shadowmap_pars_vertex:"\n\n#if NUM_SPOT_LIGHT_COORDS > 0\n\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n\n#endif\n\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n",shadowmap_vertex:"\n\n#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\n\t// Offsetting the position used for querying occlusion along the world normal can be used to reduce shadow acne.\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n\n#endif\n\n#if defined( USE_SHADOWMAP )\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n\n// spot lights can be evaluated without active shadow mapping (when SpotLight.map is used)\n\n#if NUM_SPOT_LIGHT_COORDS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n\n",shadowmask_pars_fragment:"\nfloat getShadowMask() {\n\n\tfloat shadow = 1.0;\n\n\t#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\tDirectionalLightShadow directionalLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\tSpotLightShadow spotLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\tPointLightShadow pointLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update shadow for Area light\n\n\t#endif\n\t*/\n\n\t#endif\n\n\treturn shadow;\n\n}\n",skinbase_vertex:"\n#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif\n",skinning_pars_vertex:"\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\n\tmat4 getBoneMatrix( const in float i ) {\n\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\ty = dy * ( y + 0.5 );\n\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\treturn bone;\n\n\t}\n\n#endif\n",skinning_vertex:"\n#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n",skinnormal_vertex:"\n#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n",specularmap_fragment:"\nfloat specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif\n",specularmap_pars_fragment:"\n#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif\n",tonemapping_fragment:"\n#if defined( TONE_MAPPING )\n\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n\n#endif\n",tonemapping_pars_fragment:"\n#ifndef saturate\n// may have defined saturate() already\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n\nuniform float toneMappingExposure;\n\n// exposure only\nvec3 LinearToneMapping( vec3 color ) {\n\n\treturn saturate( toneMappingExposure * color );\n\n}\n\n// source: https://www.cs.utah.edu/docs/techreports/2002/pdf/UUCS-02-001.pdf\nvec3 ReinhardToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n\n}\n\n// source: http://filmicworlds.com/blog/filmic-tonemapping-operators/\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n\n}\n\n// source: https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs\nvec3 RRTAndODTFit( vec3 v ) {\n\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n\n}\n\n// this implementation of ACES is modified to accommodate a brighter viewing environment.\n// the scale factor of 1/0.6 is subjective. see discussion in #19621.\n\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\n\t// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ), // transposed from source\n\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\n\t// ODT_SAT => XYZ => D60_2_D65 => sRGB\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ), // transposed from source\n\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\n\tcolor *= toneMappingExposure / 0.6;\n\n\tcolor = ACESInputMat * color;\n\n\t// Apply RRT and ODT\n\tcolor = RRTAndODTFit( color );\n\n\tcolor = ACESOutputMat * color;\n\n\t// Clamp to [0, 1]\n\treturn saturate( color );\n\n}\n\nvec3 CustomToneMapping( vec3 color ) { return color; }\n",transmission_fragment:"\n#ifdef USE_TRANSMISSION\n\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\n\t#endif\n\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n\n#endif\n",transmission_pars_fragment:"\n#ifdef USE_TRANSMISSION\n\n\t// Transmission code is based on glTF-Sampler-Viewer\n\t// https://github.com/KhronosGroup/glTF-Sample-Viewer\n\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\tuniform sampler2D transmissionMap;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tuniform sampler2D thicknessMap;\n\n\t#endif\n\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\n\tvarying vec3 vWorldPosition;\n\n\t// Mipped Bicubic Texture Filtering by N8\n\t// https://www.shadertoy.com/view/Dl2SDW\n\n\tfloat w0( float a ) {\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\n\t}\n\n\tfloat w1( float a ) {\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\n\t}\n\n\tfloat w2( float a ){\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\n\t}\n\n\tfloat w3( float a ) {\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\n\t}\n\n\t// g0 and g1 are the two amplitude functions\n\tfloat g0( float a ) {\n\n\t\treturn w0( a ) + w1( a );\n\n\t}\n\n\tfloat g1( float a ) {\n\n\t\treturn w2( a ) + w3( a );\n\n\t}\n\n\t// h0 and h1 are the two offset functions\n\tfloat h0( float a ) {\n\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\n\t}\n\n\tfloat h1( float a ) {\n\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\n\t}\n\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\n\t\tuv = uv * texelSize.zw + 0.5;\n\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\n\t}\n\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\n\t}\n\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\n\t\t// Direction of refracted light.\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\n\t\t// Compute rotation-independant scaling of the model matrix.\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\n\t\t// The thickness is specified in local space.\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\n\t}\n\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\n\t\t// Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and\n\t\t// an IOR of 1.5 results in the default amount of microfacet refraction.\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\n\t}\n\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\n\t}\n\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\n\t\tif ( isinf( attenuationDistance ) ) {\n\n\t\t\t// Attenuation distance is +∞, i.e. the transmitted color is not attenuated at all.\n\t\t\treturn vec3( 1.0 );\n\n\t\t} else {\n\n\t\t\t// Compute light attenuation using Beer's law.\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); // Beer's law\n\t\t\treturn transmittance;\n\n\t\t}\n\n\t}\n\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\n\t\t// Project refracted vector on the framebuffer, while mapping to normalized device coordinates.\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\n\t\t// Sample framebuffer to get pixel the refracted ray hits.\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\n\t\t// Get the specular component.\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\n\t\t// As less light is transmitted, the opacity should be increased. This simple approximation does a decent job \n\t\t// of modulating a CSS background, and has no effect when the buffer is opaque, due to a solid object or clear color.\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\n\t}\n#endif\n",uv_pars_fragment:"\n#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\n\tvarying vec2 vUv;\n\n#endif\n#ifdef USE_MAP\n\n\tvarying vec2 vMapUv;\n\n#endif\n#ifdef USE_ALPHAMAP\n\n\tvarying vec2 vAlphaMapUv;\n\n#endif\n#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vLightMapUv;\n\n#endif\n#ifdef USE_AOMAP\n\n\tvarying vec2 vAoMapUv;\n\n#endif\n#ifdef USE_BUMPMAP\n\n\tvarying vec2 vBumpMapUv;\n\n#endif\n#ifdef USE_NORMALMAP\n\n\tvarying vec2 vNormalMapUv;\n\n#endif\n#ifdef USE_EMISSIVEMAP\n\n\tvarying vec2 vEmissiveMapUv;\n\n#endif\n#ifdef USE_METALNESSMAP\n\n\tvarying vec2 vMetalnessMapUv;\n\n#endif\n#ifdef USE_ROUGHNESSMAP\n\n\tvarying vec2 vRoughnessMapUv;\n\n#endif\n#ifdef USE_ANISOTROPYMAP\n\n\tvarying vec2 vAnisotropyMapUv;\n\n#endif\n#ifdef USE_CLEARCOATMAP\n\n\tvarying vec2 vClearcoatMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvarying vec2 vClearcoatNormalMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tvarying vec2 vClearcoatRoughnessMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\n\tvarying vec2 vIridescenceMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tvarying vec2 vIridescenceThicknessMapUv;\n\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\n\tvarying vec2 vSheenColorMapUv;\n\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\tvarying vec2 vSheenRoughnessMapUv;\n\n#endif\n#ifdef USE_SPECULARMAP\n\n\tvarying vec2 vSpecularMapUv;\n\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\n\tvarying vec2 vSpecularColorMapUv;\n\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\n\tvarying vec2 vSpecularIntensityMapUv;\n\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n\n#endif\n#ifdef USE_THICKNESSMAP\n\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n\n#endif\n",uv_pars_vertex:"\n#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\n\tvarying vec2 vUv;\n\n#endif\n#ifdef USE_MAP\n\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n\n#endif\n#ifdef USE_ALPHAMAP\n\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n\n#endif\n#ifdef USE_LIGHTMAP\n\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n\n#endif\n#ifdef USE_AOMAP\n\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n\n#endif\n#ifdef USE_BUMPMAP\n\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n\n#endif\n#ifdef USE_NORMALMAP\n\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n\n#endif\n#ifdef USE_EMISSIVEMAP\n\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n\n#endif\n#ifdef USE_METALNESSMAP\n\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n\n#endif\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n\n#endif\n#ifdef USE_ANISOTROPYMAP\n\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n\n#endif\n#ifdef USE_CLEARCOATMAP\n\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n\n#endif\n#ifdef USE_SPECULARMAP\n\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n\n#endif\n#ifdef USE_THICKNESSMAP\n\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n\n#endif\n",uv_vertex:"\n#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\n\tvUv = vec3( uv, 1 ).xy;\n\n#endif\n#ifdef USE_MAP\n\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_ALPHAMAP\n\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_LIGHTMAP\n\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_AOMAP\n\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_BUMPMAP\n\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_NORMALMAP\n\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_EMISSIVEMAP\n\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_METALNESSMAP\n\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_ROUGHNESSMAP\n\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_ANISOTROPYMAP\n\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_CLEARCOATMAP\n\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SPECULARMAP\n\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_THICKNESSMAP\n\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n\n#endif\n",worldpos_vertex:"\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n\n#endif\n",background_vert:"\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n",background_frag:"\nuniform sampler2D t2D;\nuniform float backgroundIntensity;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n\tvec4 texColor = texture2D( t2D, vUv );\n\n\t#ifdef DECODE_VIDEO_TEXTURE\n\n\t\t// use inline sRGB decode until browsers properly support SRGB8_APLHA8 with video textures\n\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\n\t#endif\n\n\ttexColor.rgb *= backgroundIntensity;\n\n\tgl_FragColor = texColor;\n\n\t#include \n\t#include \n\n}\n",backgroundCube_vert:"\nvarying vec3 vWorldDirection;\n\n#include \n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include \n\t#include \n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",backgroundCube_frag:"\n\n#ifdef ENVMAP_TYPE_CUBE\n\n\tuniform samplerCube envMap;\n\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\tuniform sampler2D envMap;\n\n#endif\n\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\n\nvarying vec3 vWorldDirection;\n\n#include \n\nvoid main() {\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\n\t#else\n\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t#endif\n\n\ttexColor.rgb *= backgroundIntensity;\n\n\tgl_FragColor = texColor;\n\n\t#include \n\t#include \n\n}\n",cube_vert:"\nvarying vec3 vWorldDirection;\n\n#include \n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include \n\t#include \n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",cube_frag:"\nuniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\n\nvarying vec3 vWorldDirection;\n\nvoid main() {\n\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\n\t#include \n\t#include \n\n}\n",depth_vert:"\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include \n\n\t#include \n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include \n\t\t#include \n\t\t#include \n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n",depth_frag:"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n",distanceRGBA_vert:"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\t#include \n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include \n\t\t#include \n\t\t#include \n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvWorldPosition = worldPosition.xyz;\n\n}\n",distanceRGBA_frag:"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main () {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n",equirect_vert:"\nvarying vec3 vWorldDirection;\n\n#include \n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include \n\t#include \n\n}\n",equirect_frag:"\nuniform sampler2D tEquirect;\n\nvarying vec3 vWorldDirection;\n\n#include \n\nvoid main() {\n\n\tvec3 direction = normalize( vWorldDirection );\n\n\tvec2 sampleUV = equirectUv( direction );\n\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t#include \n\t#include \n\n}\n",linedashed_vert:"\nuniform float scale;\nattribute float lineDistance;\n\nvarying float vLineDistance;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\tvLineDistance = scale * lineDistance;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",linedashed_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform float dashSize;\nuniform float totalSize;\n\nvarying float vLineDistance;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\n\t\tdiscard;\n\n\t}\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include \n\t#include \n\t#include \n\n\toutgoingLight = diffuseColor.rgb; // simple shader\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshbasic_vert:"\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\n}\n",meshbasic_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include \n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshlambert_vert:"\n#define LAMBERT\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshlambert_frag:"\n#define LAMBERT\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshmatcap_vert:"\n#define MATCAP\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n}\n",meshmatcap_frag:"\n#define MATCAP\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks\n\n\t#ifdef USE_MATCAP\n\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\n\t#else\n\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); // default if matcap is missing\n\n\t#endif\n\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshnormal_vert:"\n#define NORMAL\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvViewPosition = - mvPosition.xyz;\n\n#endif\n\n}\n",meshnormal_frag:"\n#define NORMAL\n\nuniform float opacity;\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\n\t#ifdef OPAQUE\n\n\t\tgl_FragColor.a = 1.0;\n\n\t#endif\n\n}\n",meshphong_vert:"\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshphong_frag:"\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshphysical_vert:"\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifdef USE_TRANSMISSION\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\n#ifdef USE_TRANSMISSION\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif\n}\n",meshphysical_frag:"\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef IOR\n\tuniform float ior;\n#endif\n\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\n\t#include \n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\n\t#ifdef USE_SHEEN\n\n\t\t// Sheen energy compensation approximation calculation can be found at the end of\n\t\t// https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshtoon_vert:"\n#define TOON\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\n}\n",meshtoon_frag:"\n#define TOON\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",points_vert:"\nuniform float size;\nuniform float scale;\n\n#include \n#include \n#include \n#include \n#include \n#include \n\n#ifdef USE_POINTS_UV\n\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n\n#endif\n\nvoid main() {\n\n\t#ifdef USE_POINTS_UV\n\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tgl_PointSize = size;\n\n\t#ifdef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",points_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\toutgoingLight = diffuseColor.rgb;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",shadow_vert:"\n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\n}\n",shadow_frag:"\nuniform vec3 color;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\n\t#include \n\t#include \n\t#include \n\n}\n",sprite_vert:"\nuniform float rotation;\nuniform vec2 center;\n\n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\n\t#ifndef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\n\t#endif\n\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\n\tmvPosition.xy += rotatedPosition;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include \n\t#include \n\t#include \n\n}\n",sprite_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\toutgoingLight = diffuseColor.rgb;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n"}},17393:(e,t,n)=>{"use strict";n.d(t,{V:()=>h});var i=n(76944),s=n(8173),r=n(40693),o=n(19588),a=n(74102),l=n(93113),c=n(23130);const h={basic:{uniforms:(0,s.Rh)([a.r.common,a.r.specularmap,a.r.envmap,a.r.aomap,a.r.lightmap,a.r.fog]),vertexShader:i.W.meshbasic_vert,fragmentShader:i.W.meshbasic_frag},lambert:{uniforms:(0,s.Rh)([a.r.common,a.r.specularmap,a.r.envmap,a.r.aomap,a.r.lightmap,a.r.emissivemap,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,a.r.fog,a.r.lights,{emissive:{value:new l.I(0)}}]),vertexShader:i.W.meshlambert_vert,fragmentShader:i.W.meshlambert_frag},phong:{uniforms:(0,s.Rh)([a.r.common,a.r.specularmap,a.r.envmap,a.r.aomap,a.r.lightmap,a.r.emissivemap,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,a.r.fog,a.r.lights,{emissive:{value:new l.I(0)},specular:{value:new l.I(1118481)},shininess:{value:30}}]),vertexShader:i.W.meshphong_vert,fragmentShader:i.W.meshphong_frag},standard:{uniforms:(0,s.Rh)([a.r.common,a.r.envmap,a.r.aomap,a.r.lightmap,a.r.emissivemap,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,a.r.roughnessmap,a.r.metalnessmap,a.r.fog,a.r.lights,{emissive:{value:new l.I(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:i.W.meshphysical_vert,fragmentShader:i.W.meshphysical_frag},toon:{uniforms:(0,s.Rh)([a.r.common,a.r.aomap,a.r.lightmap,a.r.emissivemap,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,a.r.gradientmap,a.r.fog,a.r.lights,{emissive:{value:new l.I(0)}}]),vertexShader:i.W.meshtoon_vert,fragmentShader:i.W.meshtoon_frag},matcap:{uniforms:(0,s.Rh)([a.r.common,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,a.r.fog,{matcap:{value:null}}]),vertexShader:i.W.meshmatcap_vert,fragmentShader:i.W.meshmatcap_frag},points:{uniforms:(0,s.Rh)([a.r.points,a.r.fog]),vertexShader:i.W.points_vert,fragmentShader:i.W.points_frag},dashed:{uniforms:(0,s.Rh)([a.r.common,a.r.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:i.W.linedashed_vert,fragmentShader:i.W.linedashed_frag},depth:{uniforms:(0,s.Rh)([a.r.common,a.r.displacementmap]),vertexShader:i.W.depth_vert,fragmentShader:i.W.depth_frag},normal:{uniforms:(0,s.Rh)([a.r.common,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,{opacity:{value:1}}]),vertexShader:i.W.meshnormal_vert,fragmentShader:i.W.meshnormal_frag},sprite:{uniforms:(0,s.Rh)([a.r.sprite,a.r.fog]),vertexShader:i.W.sprite_vert,fragmentShader:i.W.sprite_frag},background:{uniforms:{uvTransform:{value:new c.V},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:i.W.background_vert,fragmentShader:i.W.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:i.W.backgroundCube_vert,fragmentShader:i.W.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:i.W.cube_vert,fragmentShader:i.W.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:i.W.equirect_vert,fragmentShader:i.W.equirect_frag},distanceRGBA:{uniforms:(0,s.Rh)([a.r.common,a.r.displacementmap,{referencePosition:{value:new o.P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:i.W.distanceRGBA_vert,fragmentShader:i.W.distanceRGBA_frag},shadow:{uniforms:(0,s.Rh)([a.r.lights,a.r.fog,{color:{value:new l.I(0)},opacity:{value:1}}]),vertexShader:i.W.shadow_vert,fragmentShader:i.W.shadow_frag}};h.physical={uniforms:(0,s.Rh)([h.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new c.V},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new c.V},clearcoatNormalScale:{value:new r.F(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new c.V},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new c.V},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new c.V},sheen:{value:0},sheenColor:{value:new l.I(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new c.V},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new c.V},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new c.V},transmissionSamplerSize:{value:new r.F},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new c.V},attenuationDistance:{value:0},attenuationColor:{value:new l.I(0)},specularColor:{value:new l.I(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new c.V},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new c.V},anisotropyVector:{value:new r.F},anisotropyMap:{value:null},anisotropyMapTransform:{value:new c.V}}]),vertexShader:i.W.meshphysical_vert,fragmentShader:i.W.meshphysical_frag}},89260:(e,t,n)=>{"use strict";n.d(t,{D:()=>s,u:()=>i});const i="\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n",s="\nuniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n\n#include \n\nvoid main() {\n\n\tconst float samples = float( VSM_SAMPLES );\n\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\n\t\t#ifdef HORIZONTAL_PASS\n\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\n\t\t#else\n\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\n\t\t#endif\n\n\t}\n\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n\n}\n"},74102:(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var i=n(93113),s=n(40693),r=n(23130);const o={common:{diffuse:{value:new i.I(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new r.V},alphaMap:{value:null},alphaMapTransform:{value:new r.V},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new r.V}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new r.V}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new r.V}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new r.V},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new r.V},normalScale:{value:new s.F(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new r.V},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new r.V}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new r.V}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new r.V}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new i.I(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new i.I(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new r.V},alphaTest:{value:0},uvTransform:{value:new r.V}},sprite:{diffuse:{value:new i.I(16777215)},opacity:{value:1},center:{value:new s.F(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new r.V},alphaMap:{value:null},alphaMapTransform:{value:new r.V},alphaTest:{value:0}}}},8173:(e,t,n)=>{"use strict";n.d(t,{Rh:()=>r,dw:()=>s,fd:()=>o,oD:()=>a,rD:()=>l});var i=n(19748);function s(e){const t={};for(const n in e){t[n]={};for(const i in e[n]){const s=e[n][i];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][i]=null):t[n][i]=s.clone():Array.isArray(s)?t[n][i]=s.slice():t[n][i]=s}}return t}function r(e){const t={};for(let n=0;n{"use strict";function i(){let e=null,t=!1,n=null,i=null;function s(t,r){n(t,r),i=e.requestAnimationFrame(s)}return{start:function(){!0!==t&&null!==n&&(i=e.requestAnimationFrame(s),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}n.d(t,{C:()=>i})},34455:(e,t,n)=>{"use strict";function i(e,t){const n=t.isWebGL2,i=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),i.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=i.get(t);n&&(e.deleteBuffer(n.buffer),i.delete(t))},update:function(t,s){if(t.isGLBufferAttribute){const e=i.get(t);return void((!e||e.versioni})},26067:(e,t,n)=>{"use strict";n.d(t,{a:()=>p});var i=n(75544),s=n(40071),r=n(83866),o=n(44428),a=n(93113),l=n(19748),c=n(8035),h=n(17393),d=n(8173);const u={r:0,b:0,g:0};function p(e,t,n,p,m,f,g){const v=new a.I(0);let y,b,_=!0===f?0:1,x=null,w=0,S=null;function M(t,n){t.getRGB(u,(0,d.oD)(e)),p.buffers.color.setClear(u.r,u.g,u.b,n,g)}return{getClearColor:function(){return v},setClearColor:function(e,t=1){v.set(e),_=t,M(v,_)},getClearAlpha:function(){return _},setClearAlpha:function(e){_=e,M(v,_)},render:function(a,u){let f=!1,E=!0===u.isScene?u.background:null;if(E&&E.isTexture){E=(u.backgroundBlurriness>0?n:t).get(E)}null===E?M(v,_):E&&E.isColor&&(M(E,1),f=!0);const T=e.xr.getEnvironmentBlendMode();"additive"===T?p.buffers.color.setClear(0,0,0,1,g):"alpha-blend"===T&&p.buffers.color.setClear(0,0,0,0,g),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),E&&(E.isCubeTexture||E.mapping===i.g8_)?(void 0===b&&(b=new c.K(new s.D(1,1,1),new o.j({name:"BackgroundCubeMaterial",uniforms:(0,d.dw)(h.V.backgroundCube.uniforms),vertexShader:h.V.backgroundCube.vertexShader,fragmentShader:h.V.backgroundCube.fragmentShader,side:i._Li,depthTest:!1,depthWrite:!1,fog:!1})),b.geometry.deleteAttribute("normal"),b.geometry.deleteAttribute("uv"),b.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(b.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),m.update(b)),b.material.uniforms.envMap.value=E,b.material.uniforms.flipEnvMap.value=E.isCubeTexture&&!1===E.isRenderTargetTexture?-1:1,b.material.uniforms.backgroundBlurriness.value=u.backgroundBlurriness,b.material.uniforms.backgroundIntensity.value=u.backgroundIntensity,b.material.toneMapped=l.ep.getTransfer(E.colorSpace)!==i.j17,x===E&&w===E.version&&S===e.toneMapping||(b.material.needsUpdate=!0,x=E,w=E.version,S=e.toneMapping),b.layers.enableAll(),a.unshift(b,b.geometry,b.material,0,0,null)):E&&E.isTexture&&(void 0===y&&(y=new c.K(new r._(2,2),new o.j({name:"BackgroundMaterial",uniforms:(0,d.dw)(h.V.background.uniforms),vertexShader:h.V.background.vertexShader,fragmentShader:h.V.background.fragmentShader,side:i.Wl3,depthTest:!1,depthWrite:!1,fog:!1})),y.geometry.deleteAttribute("normal"),Object.defineProperty(y.material,"map",{get:function(){return this.uniforms.t2D.value}}),m.update(y)),y.material.uniforms.t2D.value=E,y.material.uniforms.backgroundIntensity.value=u.backgroundIntensity,y.material.toneMapped=l.ep.getTransfer(E.colorSpace)!==i.j17,!0===E.matrixAutoUpdate&&E.updateMatrix(),y.material.uniforms.uvTransform.value.copy(E.matrix),x===E&&w===E.version&&S===e.toneMapping||(y.material.needsUpdate=!0,x=E,w=E.version,S=e.toneMapping),y.layers.enableAll(),a.unshift(y,y.geometry,y.material,0,0,null))}}}},83596:(e,t,n)=>{"use strict";n.d(t,{s:()=>s});var i=n(75544);function s(e,t,n,s){const r=e.getParameter(e.MAX_VERTEX_ATTRIBS),o=s.isWebGL2?null:t.get("OES_vertex_array_object"),a=s.isWebGL2||null!==o,l={},c=m(null);let h=c,d=!1;function u(t){return s.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function p(t){return s.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function m(e){const t=[],n=[],i=[];for(let e=0;e=0){const n=s[t];let i=r[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;o++}}return h.attributesNum!==o||h.index!==i}(r,_,p,x),w&&function(e,t,n,i){const s={},r=t.attributes;let o=0;const a=n.getAttributes();for(const t in a){if(a[t].location>=0){let n=r[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),s[t]=i,o++}}h.attributes=s,h.attributesNum=o,h.index=i}(r,_,p,x)}else{const e=!0===c.wireframe;h.geometry===_.id&&h.program===p.id&&h.wireframe===e||(h.geometry=_.id,h.program=p.id,h.wireframe=e,w=!0)}null!==x&&n.update(x,e.ELEMENT_ARRAY_BUFFER),(w||d)&&(d=!1,function(r,o,a,l){if(!1===s.isWebGL2&&(r.isInstancedMesh||l.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;f();const c=l.attributes,h=a.getAttributes(),d=o.defaultAttributeValues;for(const t in h){const o=h[t];if(o.location>=0){let a=c[t];if(void 0===a&&("instanceMatrix"===t&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===t&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const t=a.normalized,c=a.itemSize,h=n.get(a);if(void 0===h)continue;const d=h.buffer,u=h.type,p=h.bytesPerElement,m=!0===s.isWebGL2&&(u===e.INT||u===e.UNSIGNED_INT||a.gpuType===i.Kz5);if(a.isInterleavedBufferAttribute){const n=a.data,i=n.stride,s=a.offset;if(n.isInstancedInterleavedBuffer){for(let e=0;e{"use strict";function i(e,t,n,i){const s=i.isWebGL2;let r;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r,1)},this.renderInstances=function(i,o,a){if(0===a)return;let l,c;if(s)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](r,i,o,a),n.update(o,r,a)}}n.d(t,{w:()=>i})},49917:(e,t,n)=>{"use strict";function i(e,t,n){let i;function s(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const r="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===e.constructor.name;let o=void 0!==n.precision?n.precision:"highp";const a=s(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=r||t.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),m=e.getParameter(e.MAX_VERTEX_ATTRIBS),f=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),g=e.getParameter(e.MAX_VARYING_VECTORS),v=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),y=d>0,b=r||t.has("OES_texture_float");return{isWebGL2:r,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:s,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:d,maxTextureSize:u,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:b,floatVertexTextures:y&&b,maxSamples:r?e.getParameter(e.MAX_SAMPLES):0}}n.d(t,{G:()=>i})},89479:(e,t,n)=>{"use strict";n.d(t,{h:()=>r});var i=n(23130),s=n(82094);function r(e){const t=this;let n=null,r=0,o=!1,a=!1;const l=new s.J,c=new i.V,h={value:null,needsUpdate:!1};function d(e,n,i,s){const r=null!==e?e.length:0;let o=null;if(0!==r){if(o=h.value,!0!==s||null===o){const t=i+4*r,s=n.matrixWorldInverse;c.getNormalMatrix(s),(null===o||o.length0);t.numPlanes=r,t.numIntersection=0}();else{const e=a?0:r,t=4*e;let i=m.clippingState||null;h.value=i,i=d(c,s,t,l);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=u?this.numPlanes:0,this.numPlanes+=e}}}},5058:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var i=n(75544),s=n(65996);function r(e){let t=new WeakMap;function n(e,t){return t===i.dSO?e.mapping=i.fY$:t===i.Bf4&&(e.mapping=i.vxC),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(o){if(o&&o.isTexture&&!1===o.isRenderTargetTexture){const a=o.mapping;if(a===i.dSO||a===i.Bf4){if(t.has(o)){return n(t.get(o).texture,o.mapping)}{const i=o.image;if(i&&i.height>0){const a=new s.o(i.height/2);return a.fromEquirectangularTexture(e,o),t.set(o,a),o.addEventListener("dispose",r),n(a.texture,o.mapping)}return null}}}return o},dispose:function(){t=new WeakMap}}}},39412:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});var i=n(75544),s=n(93612);function r(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(o){if(o&&o.isTexture){const a=o.mapping,l=a===i.dSO||a===i.Bf4,c=a===i.fY$||a===i.vxC;if(l||c){if(o.isRenderTargetTexture&&!0===o.needsPMREMUpdate){o.needsPMREMUpdate=!1;let i=t.get(o);return null===n&&(n=new s.a(e)),i=l?n.fromEquirectangular(o,i):n.fromCubemap(o,i),t.set(o,i),i.texture}if(t.has(o))return t.get(o).texture;{const i=o.image;if(l&&i&&i.height>0||c&&i&&function(e){let t=0;const n=6;for(let i=0;i{"use strict";function i(e){const t={};function n(n){if(void 0!==t[n])return t[n];let i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}n.d(t,{P:()=>i})},88753:(e,t,n)=>{"use strict";n.d(t,{Y:()=>r});var i=n(35322),s=n(19564);function r(e,t,n,r){const o={},a=new WeakMap;function l(e){const i=e.target;null!==i.index&&t.remove(i.index);for(const e in i.attributes)t.remove(i.attributes[e]);for(const e in i.morphAttributes){const n=i.morphAttributes[e];for(let e=0,i=n.length;e{"use strict";function i(e,t,n,i){const s=i.isWebGL2;let r,o,a;this.setMode=function(e){r=e},this.setIndex=function(e){o=e.type,a=e.bytesPerElement},this.render=function(t,i){e.drawElements(r,i,o,t*a),n.update(i,r,1)},this.renderInstances=function(i,l,c){if(0===c)return;let h,d;if(s)h=e,d="drawElementsInstanced";else if(h=t.get("ANGLE_instanced_arrays"),d="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[d](r,l,o,i*a,c),n.update(l,r,c)}}n.d(t,{x:()=>i})},31132:(e,t,n)=>{"use strict";function i(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,i,s){switch(t.calls++,i){case e.TRIANGLES:t.triangles+=s*(n/3);break;case e.LINES:t.lines+=s*(n/2);break;case e.LINE_STRIP:t.lines+=s*(n-1);break;case e.LINE_LOOP:t.lines+=s*n;break;case e.POINTS:t.points+=s*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}n.d(t,{I:()=>i})},19836:(e,t,n)=>{"use strict";n.d(t,{h:()=>d});var i=n(93113),s=n(82587),r=n(40693),o=n(19588),a=n(74102);function l(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new o.P,color:new i.I};break;case"SpotLight":n={position:new o.P,direction:new o.P,color:new i.I,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new o.P,color:new i.I,distance:0,decay:0};break;case"HemisphereLight":n={direction:new o.P,skyColor:new i.I,groundColor:new i.I};break;case"RectAreaLight":n={color:new i.I,position:new o.P,halfWidth:new o.P,halfHeight:new o.P}}return e[t.id]=n,n}}}let c=0;function h(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function d(e,t){const n=new l,i=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new r.F};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new r.F,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),d={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)d.probe.push(new o.P);const u=new o.P,p=new s.y,m=new s.y;return{setup:function(s,r){let o=0,l=0,u=0;for(let e=0;e<9;e++)d.probe[e].set(0,0,0);let p=0,m=0,f=0,g=0,v=0,y=0,b=0,_=0,x=0,w=0,S=0;s.sort(h);const M=!0===r?Math.PI:1;for(let e=0,t=s.length;e0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(d.rectAreaLTC1=a.r.LTC_FLOAT_1,d.rectAreaLTC2=a.r.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(d.rectAreaLTC1=a.r.LTC_HALF_1,d.rectAreaLTC2=a.r.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),d.ambient[0]=o,d.ambient[1]=l,d.ambient[2]=u;const E=d.hash;E.directionalLength===p&&E.pointLength===m&&E.spotLength===f&&E.rectAreaLength===g&&E.hemiLength===v&&E.numDirectionalShadows===y&&E.numPointShadows===b&&E.numSpotShadows===_&&E.numSpotMaps===x&&E.numLightProbes===S||(d.directional.length=p,d.spot.length=f,d.rectArea.length=g,d.point.length=m,d.hemi.length=v,d.directionalShadow.length=y,d.directionalShadowMap.length=y,d.pointShadow.length=b,d.pointShadowMap.length=b,d.spotShadow.length=_,d.spotShadowMap.length=_,d.directionalShadowMatrix.length=y,d.pointShadowMatrix.length=b,d.spotLightMatrix.length=_+x-w,d.spotLightMap.length=x,d.numSpotLightShadowsWithMaps=w,d.numLightProbes=S,E.directionalLength=p,E.pointLength=m,E.spotLength=f,E.rectAreaLength=g,E.hemiLength=v,E.numDirectionalShadows=y,E.numPointShadows=b,E.numSpotShadows=_,E.numSpotMaps=x,E.numLightProbes=S,d.version=c++)},setupView:function(e,t){let n=0,i=0,s=0,r=0,o=0;const a=t.matrixWorldInverse;for(let t=0,l=e.length;t{"use strict";n.d(t,{J:()=>r});var i=n(75544),s=n(8173);function r(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(s,r){s.opacity.value=r.opacity,r.color&&s.diffuse.value.copy(r.color),r.emissive&&s.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(s.map.value=r.map,n(r.map,s.mapTransform)),r.alphaMap&&(s.alphaMap.value=r.alphaMap,n(r.alphaMap,s.alphaMapTransform)),r.bumpMap&&(s.bumpMap.value=r.bumpMap,n(r.bumpMap,s.bumpMapTransform),s.bumpScale.value=r.bumpScale,r.side===i._Li&&(s.bumpScale.value*=-1)),r.normalMap&&(s.normalMap.value=r.normalMap,n(r.normalMap,s.normalMapTransform),s.normalScale.value.copy(r.normalScale),r.side===i._Li&&s.normalScale.value.negate()),r.displacementMap&&(s.displacementMap.value=r.displacementMap,n(r.displacementMap,s.displacementMapTransform),s.displacementScale.value=r.displacementScale,s.displacementBias.value=r.displacementBias),r.emissiveMap&&(s.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,s.emissiveMapTransform)),r.specularMap&&(s.specularMap.value=r.specularMap,n(r.specularMap,s.specularMapTransform)),r.alphaTest>0&&(s.alphaTest.value=r.alphaTest);const o=t.get(r).envMap;if(o&&(s.envMap.value=o,s.flipEnvMap.value=o.isCubeTexture&&!1===o.isRenderTargetTexture?-1:1,s.reflectivity.value=r.reflectivity,s.ior.value=r.ior,s.refractionRatio.value=r.refractionRatio),r.lightMap){s.lightMap.value=r.lightMap;const t=!0===e._useLegacyLights?Math.PI:1;s.lightMapIntensity.value=r.lightMapIntensity*t,n(r.lightMap,s.lightMapTransform)}r.aoMap&&(s.aoMap.value=r.aoMap,s.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,s.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,(0,s.oD)(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,s,o,a,l){s.isMeshBasicMaterial||s.isMeshLambertMaterial?r(e,s):s.isMeshToonMaterial?(r(e,s),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,s)):s.isMeshPhongMaterial?(r(e,s),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,s)):s.isMeshStandardMaterial?(r(e,s),function(e,i){e.metalness.value=i.metalness,i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap,n(i.metalnessMap,e.metalnessMapTransform));e.roughness.value=i.roughness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap,n(i.roughnessMap,e.roughnessMapTransform));t.get(i).envMap&&(e.envMapIntensity.value=i.envMapIntensity)}(e,s),s.isMeshPhysicalMaterial&&function(e,t,s){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===i._Li&&e.clearcoatNormalScale.value.negate()));t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=s.texture,e.transmissionSamplerSize.value.set(s.width,s.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform)));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,s,l)):s.isMeshMatcapMaterial?(r(e,s),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,s)):s.isMeshDepthMaterial?r(e,s):s.isMeshDistanceMaterial?(r(e,s),function(e,n){const i=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(i.matrixWorld),e.nearDistance.value=i.shadow.camera.near,e.farDistance.value=i.shadow.camera.far}(e,s)):s.isMeshNormalMaterial?r(e,s):s.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(e,s),s.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,s)):s.isPointsMaterial?function(e,t,i,s){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*i,e.scale.value=.5*s,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,s,o,a):s.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,s):s.isShadowMaterial?(e.color.value.copy(s.color),e.opacity.value=s.opacity):s.isShaderMaterial&&(s.uniformsNeedUpdate=!1)}}}},27153:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var i=n(75544),s=n(57938),r=n(84538),o=n(40693);function a(e,t){return e[0]-t[0]}function l(e,t){return Math.abs(t[1])-Math.abs(e[1])}function c(e,t,n){const c={},h=new Float32Array(8),d=new WeakMap,u=new r.L,p=[];for(let e=0;e<8;e++)p[e]=[e,0];return{update:function(r,m,f){const g=r.morphTargetInfluences;if(!0===t.isWebGL2){const v=m.morphAttributes.position||m.morphAttributes.normal||m.morphAttributes.color,y=void 0!==v?v.length:0;let b=d.get(m);if(void 0===b||b.count!==y){void 0!==b&&b.texture.dispose();const w=void 0!==m.morphAttributes.position,S=void 0!==m.morphAttributes.normal,M=void 0!==m.morphAttributes.color,E=m.morphAttributes.position||[],T=m.morphAttributes.normal||[],C=m.morphAttributes.color||[];let A=0;!0===w&&(A=1),!0===S&&(A=2),!0===M&&(A=3);let P=m.attributes.position.count*A,R=1;P>t.maxTextureSize&&(R=Math.ceil(P/t.maxTextureSize),P=t.maxTextureSize);const L=new Float32Array(P*R*4*y),N=new s.p(L,P,R,y);N.type=i.VzW,N.needsUpdate=!0;const D=4*A;for(let O=0;O{"use strict";function i(e,t,n,i){let s=new WeakMap;function r(e){const t=e.target;t.removeEventListener("dispose",r),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(o){const a=i.render.frame,l=o.geometry,c=t.get(o,l);if(s.get(c)!==a&&(t.update(c),s.set(c,a)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",r)&&o.addEventListener("dispose",r),s.get(o)!==a&&(n.update(o.instanceMatrix,e.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,e.ARRAY_BUFFER),s.set(o,a))),o.isSkinnedMesh){const e=o.skeleton;s.get(e)!==a&&(e.update(),s.set(e,a))}return c},dispose:function(){s=new WeakMap}}}n.d(t,{E:()=>i})},48580:(e,t,n)=>{"use strict";n.d(t,{d:()=>S});var i=n(64061),s=n(31685),r=n(76944),o=n(75544),a=n(19748);let l=0;function c(e,t,n){const i=e.getShaderParameter(t,e.COMPILE_STATUS),s=e.getShaderInfoLog(t).trim();if(i&&""===s)return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const i=parseInt(r[1]);return n.toUpperCase()+"\n\n"+s+"\n\n"+function(e,t){const n=e.split("\n"),i=[],s=Math.max(t-6,0),r=Math.min(t+6,n.length);for(let e=s;e":" "} ${s}: ${n[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}return s}function h(e,t){const n=function(e){const t=a.ep.getPrimaries(a.ep.workingColorSpace),n=a.ep.getPrimaries(e);let i;switch(t===n?i="":t===o.FVh&&n===o.Vtg?i="LinearDisplayP3ToLinearSRGB":t===o.Vtg&&n===o.FVh&&(i="LinearSRGBToLinearDisplayP3"),e){case o.GUF:case o.AmZ:return[i,"LinearTransferOETF"];case o.KI_:case o.ntt:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[i,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function d(e,t){let n;switch(t){case o.EoG:n="Linear";break;case o.CdI:n="Reinhard";break;case o.YGz:n="OptimizedCineon";break;case o.LY2:n="ACESFilmic";break;case o.dZ3:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function u(e){return""!==e}function p(e,t){const n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function m(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const f=/^[ \t]*#include +<([\w\d./]+)>/gm;function g(e){return e.replace(f,y)}const v=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function y(e,t){let n=r.W[t];if(void 0===n){const e=v.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");n=r.W[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return g(n)}const b=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function _(e){return e.replace(b,x)}function x(e,t,n,i){let s="";for(let e=parseInt(t);e0&&(R+="\n"),L=[C,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,A].filter(u).join("\n"),L.length>0&&(L+="\n")):(R=[w(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,A,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+M:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+x:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(u).join("\n"),L=[C,w(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,A,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+S:"",n.envMap?"#define "+M:"",n.envMap?"#define "+E:"",T?"#define CUBEUV_TEXEL_WIDTH "+T.texelWidth:"",T?"#define CUBEUV_TEXEL_HEIGHT "+T.texelHeight:"",T?"#define CUBEUV_MAX_MIP "+T.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+x:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==o.uL9?"#define TONE_MAPPING":"",n.toneMapping!==o.uL9?r.W.tonemapping_pars_fragment:"",n.toneMapping!==o.uL9?d("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",r.W.colorspace_pars_fragment,h("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(u).join("\n")),y=g(y),y=p(y,n),y=m(y,n),b=g(b),b=p(b,n),b=m(b,n),y=_(y),b=_(b),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(N="#version 300 es\n",R=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+R,L=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===o.LSk?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===o.LSk?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+L);const D=N+R+y,I=N+L+b,O=(0,s.d)(f,f.VERTEX_SHADER,D),U=(0,s.d)(f,f.FRAGMENT_SHADER,I);function k(t){if(e.debug.checkShaderErrors){const n=f.getProgramInfoLog(P).trim(),i=f.getShaderInfoLog(O).trim(),s=f.getShaderInfoLog(U).trim();let r=!0,o=!0;if(!1===f.getProgramParameter(P,f.LINK_STATUS))if(r=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(f,P,O,U);else{const e=c(f,O,"vertex"),t=c(f,U,"fragment");console.error("THREE.WebGLProgram: Shader Error "+f.getError()+" - VALIDATE_STATUS "+f.getProgramParameter(P,f.VALIDATE_STATUS)+"\n\nProgram Info Log: "+n+"\n"+e+"\n"+t)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==i&&""!==s||(o=!1);o&&(t.diagnostics={runnable:r,programLog:n,vertexShader:{log:i,prefix:R},fragmentShader:{log:s,prefix:L}})}f.deleteShader(O),f.deleteShader(U),V=new i.y(f,P),z=function(e,t){const n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let s=0;s{"use strict";n.d(t,{Z:()=>h});var i=n(75544),s=n(45787),r=n(48580),o=n(97386),a=n(17393),l=n(8173),c=n(19748);function h(e,t,n,h,d,u,p){const m=new s.S,f=new o.T,g=[],v=d.isWebGL2,y=d.logarithmicDepthBuffer,b=d.vertexTextures;let _=d.precision;const x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function w(e){return 0===e?"uv":`uv${e}`}return{getParameters:function(s,r,o,l,u){const m=l.fog,g=u.geometry,S=s.isMeshStandardMaterial?l.environment:null,M=(s.isMeshStandardMaterial?n:t).get(s.envMap||S),E=M&&M.mapping===i.g8_?M.image.height:null,T=x[s.type];null!==s.precision&&(_=d.getMaxPrecision(s.precision),_!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",_,"instead."));const C=g.morphAttributes.position||g.morphAttributes.normal||g.morphAttributes.color,A=void 0!==C?C.length:0;let P,R,L,N,D=0;if(void 0!==g.morphAttributes.position&&(D=1),void 0!==g.morphAttributes.normal&&(D=2),void 0!==g.morphAttributes.color&&(D=3),T){const e=a.V[T];P=e.vertexShader,R=e.fragmentShader}else P=s.vertexShader,R=s.fragmentShader,f.update(s),L=f.getVertexShaderID(s),N=f.getFragmentShaderID(s);const I=e.getRenderTarget(),O=!0===u.isInstancedMesh,U=!!s.map,k=!!s.matcap,V=!!M,z=!!s.aoMap,F=!!s.lightMap,B=!!s.bumpMap,$=!!s.normalMap,j=!!s.displacementMap,H=!!s.emissiveMap,G=!!s.metalnessMap,Z=!!s.roughnessMap,W=s.anisotropy>0,q=s.clearcoat>0,X=s.iridescence>0,Y=s.sheen>0,K=s.transmission>0,J=W&&!!s.anisotropyMap,Q=q&&!!s.clearcoatMap,ee=q&&!!s.clearcoatNormalMap,te=q&&!!s.clearcoatRoughnessMap,ne=X&&!!s.iridescenceMap,ie=X&&!!s.iridescenceThicknessMap,se=Y&&!!s.sheenColorMap,re=Y&&!!s.sheenRoughnessMap,oe=!!s.specularMap,ae=!!s.specularColorMap,le=!!s.specularIntensityMap,ce=K&&!!s.transmissionMap,he=K&&!!s.thicknessMap,de=!!s.gradientMap,ue=!!s.alphaMap,pe=s.alphaTest>0,me=!!s.alphaHash,fe=!!s.extensions,ge=!!g.attributes.uv1,ve=!!g.attributes.uv2,ye=!!g.attributes.uv3;let be=i.uL9;return s.toneMapped&&(null!==I&&!0!==I.isXRRenderTarget||(be=e.toneMapping)),{isWebGL2:v,shaderID:T,shaderType:s.type,shaderName:s.name,vertexShader:P,fragmentShader:R,defines:s.defines,customVertexShaderID:L,customFragmentShaderID:N,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:_,instancing:O,instancingColor:O&&null!==u.instanceColor,supportsVertexTextures:b,outputColorSpace:null===I?e.outputColorSpace:!0===I.isXRRenderTarget?I.texture.colorSpace:i.GUF,map:U,matcap:k,envMap:V,envMapMode:V&&M.mapping,envMapCubeUVHeight:E,aoMap:z,lightMap:F,bumpMap:B,normalMap:$,displacementMap:b&&j,emissiveMap:H,normalMapObjectSpace:$&&s.normalMapType===i.PA7,normalMapTangentSpace:$&&s.normalMapType===i.IOt,metalnessMap:G,roughnessMap:Z,anisotropy:W,anisotropyMap:J,clearcoat:q,clearcoatMap:Q,clearcoatNormalMap:ee,clearcoatRoughnessMap:te,iridescence:X,iridescenceMap:ne,iridescenceThicknessMap:ie,sheen:Y,sheenColorMap:se,sheenRoughnessMap:re,specularMap:oe,specularColorMap:ae,specularIntensityMap:le,transmission:K,transmissionMap:ce,thicknessMap:he,gradientMap:de,opaque:!1===s.transparent&&s.blending===i.bdR,alphaMap:ue,alphaTest:pe,alphaHash:me,combine:s.combine,mapUv:U&&w(s.map.channel),aoMapUv:z&&w(s.aoMap.channel),lightMapUv:F&&w(s.lightMap.channel),bumpMapUv:B&&w(s.bumpMap.channel),normalMapUv:$&&w(s.normalMap.channel),displacementMapUv:j&&w(s.displacementMap.channel),emissiveMapUv:H&&w(s.emissiveMap.channel),metalnessMapUv:G&&w(s.metalnessMap.channel),roughnessMapUv:Z&&w(s.roughnessMap.channel),anisotropyMapUv:J&&w(s.anisotropyMap.channel),clearcoatMapUv:Q&&w(s.clearcoatMap.channel),clearcoatNormalMapUv:ee&&w(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:te&&w(s.clearcoatRoughnessMap.channel),iridescenceMapUv:ne&&w(s.iridescenceMap.channel),iridescenceThicknessMapUv:ie&&w(s.iridescenceThicknessMap.channel),sheenColorMapUv:se&&w(s.sheenColorMap.channel),sheenRoughnessMapUv:re&&w(s.sheenRoughnessMap.channel),specularMapUv:oe&&w(s.specularMap.channel),specularColorMapUv:ae&&w(s.specularColorMap.channel),specularIntensityMapUv:le&&w(s.specularIntensityMap.channel),transmissionMapUv:ce&&w(s.transmissionMap.channel),thicknessMapUv:he&&w(s.thicknessMap.channel),alphaMapUv:ue&&w(s.alphaMap.channel),vertexTangents:!!g.attributes.tangent&&($||W),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!g.attributes.color&&4===g.attributes.color.itemSize,vertexUv1s:ge,vertexUv2s:ve,vertexUv3s:ye,pointsUvs:!0===u.isPoints&&!!g.attributes.uv&&(U||ue),fog:!!m,useFog:!0===s.fog,fogExp2:m&&m.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:y,skinning:!0===u.isSkinnedMesh,morphTargets:void 0!==g.morphAttributes.position,morphNormals:void 0!==g.morphAttributes.normal,morphColors:void 0!==g.morphAttributes.color,morphTargetsCount:A,morphTextureStride:D,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numSpotLightMaps:r.spotLightMap.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numDirLightShadows:r.directionalShadowMap.length,numPointLightShadows:r.pointShadowMap.length,numSpotLightShadows:r.spotShadowMap.length,numSpotLightShadowsWithMaps:r.numSpotLightShadowsWithMaps,numLightProbes:r.numLightProbes,numClippingPlanes:p.numPlanes,numClipIntersection:p.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&o.length>0,shadowMapType:e.shadowMap.type,toneMapping:be,useLegacyLights:e._useLegacyLights,decodeVideoTexture:U&&!0===s.map.isVideoTexture&&c.ep.getTransfer(s.map.colorSpace)===i.j17,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===i.ehD,flipSided:s.side===i._Li,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:fe&&!0===s.extensions.derivatives,extensionFragDepth:fe&&!0===s.extensions.fragDepth,extensionDrawBuffers:fe&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:fe&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:v||h.has("EXT_frag_depth"),rendererExtensionDrawBuffers:v||h.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:v||h.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:h.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){m.disableAll(),t.isWebGL2&&m.enable(0);t.supportsVertexTextures&&m.enable(1);t.instancing&&m.enable(2);t.instancingColor&&m.enable(3);t.matcap&&m.enable(4);t.envMap&&m.enable(5);t.normalMapObjectSpace&&m.enable(6);t.normalMapTangentSpace&&m.enable(7);t.clearcoat&&m.enable(8);t.iridescence&&m.enable(9);t.alphaTest&&m.enable(10);t.vertexColors&&m.enable(11);t.vertexAlphas&&m.enable(12);t.vertexUv1s&&m.enable(13);t.vertexUv2s&&m.enable(14);t.vertexUv3s&&m.enable(15);t.vertexTangents&&m.enable(16);t.anisotropy&&m.enable(17);t.alphaHash&&m.enable(18);e.push(m.mask),m.disableAll(),t.fog&&m.enable(0);t.useFog&&m.enable(1);t.flatShading&&m.enable(2);t.logarithmicDepthBuffer&&m.enable(3);t.skinning&&m.enable(4);t.morphTargets&&m.enable(5);t.morphNormals&&m.enable(6);t.morphColors&&m.enable(7);t.premultipliedAlpha&&m.enable(8);t.shadowMapEnabled&&m.enable(9);t.useLegacyLights&&m.enable(10);t.doubleSided&&m.enable(11);t.flipSided&&m.enable(12);t.useDepthPacking&&m.enable(13);t.dithering&&m.enable(14);t.transmission&&m.enable(15);t.sheen&&m.enable(16);t.opaque&&m.enable(17);t.pointsUvs&&m.enable(18);t.decodeVideoTexture&&m.enable(19);e.push(m.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=x[e.type];let n;if(t){const e=a.V[t];n=l.rD.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let i;for(let e=0,t=g.length;e{"use strict";function i(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}n.d(t,{Z:()=>i})},84153:(e,t,n)=>{"use strict";function i(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function s(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function r(){const e=[];let t=0;const n=[],r=[],o=[];function a(n,i,s,r,o,a){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:s,groupOrder:r,renderOrder:n.renderOrder,z:o,group:a},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=s,l.groupOrder=r,l.renderOrder=n.renderOrder,l.z=o,l.group=a),t++,l}return{opaque:n,transmissive:r,transparent:o,init:function(){t=0,n.length=0,r.length=0,o.length=0},push:function(e,t,i,s,l,c){const h=a(e,t,i,s,l,c);i.transmission>0?r.push(h):!0===i.transparent?o.push(h):n.push(h)},unshift:function(e,t,i,s,l,c){const h=a(e,t,i,s,l,c);i.transmission>0?r.unshift(h):!0===i.transparent?o.unshift(h):n.unshift(h)},finish:function(){for(let n=t,i=e.length;n1&&n.sort(e||i),r.length>1&&r.sort(t||s),o.length>1&&o.sort(t||s)}}}function o(){let e=new WeakMap;return{get:function(t,n){const i=e.get(t);let s;return void 0===i?(s=new r,e.set(t,[s])):n>=i.length?(s=new r,i.push(s)):s=i[n],s},dispose:function(){e=new WeakMap}}}n.d(t,{M:()=>o})},73981:(e,t,n)=>{"use strict";n.d(t,{Q:()=>r});var i=n(19836);function s(e,t){const n=new i.h(e,t),s=[],r=[];return{init:function(){s.length=0,r.length=0},state:{lightsArray:s,shadowsArray:r,lights:n},setupLights:function(e){n.setup(s,e)},setupLightsView:function(e){n.setupView(s,e)},pushLight:function(e){s.push(e)},pushShadow:function(e){r.push(e)}}}function r(e,t){let n=new WeakMap;return{get:function(i,r=0){const o=n.get(i);let a;return void 0===o?(a=new s(e,t),n.set(i,[a])):r>=o.length?(a=new s(e,t),o.push(a)):a=o[r],a},dispose:function(){n=new WeakMap}}}},31685:(e,t,n)=>{"use strict";function i(e,t,n){const i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}n.d(t,{d:()=>i})},97386:(e,t,n)=>{"use strict";n.d(t,{T:()=>s});let i=0;class s{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),r=this._getShaderCacheForMaterial(e);return!1===r.has(i)&&(r.add(i),i.usedTimes++),!1===r.has(s)&&(r.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new r(e),t.set(e,n)),n}}class r{constructor(e){this.id=i++,this.code=e,this.usedTimes=0}}},74859:(e,t,n)=>{"use strict";n.d(t,{c:()=>f});var i=n(75544),s=n(46953),r=n(90652),o=n(35536),a=n(44428),l=n(35322),c=n(75809),h=n(8035),d=n(84538),u=n(40693),p=n(53763),m=n(89260);function f(e,t,n){let f=new p.i;const g=new u.F,v=new u.F,y=new d.L,b=new r.l({depthPacking:i.mSO}),_=new o.L,x={},w=n.maxTextureSize,S={[i.Wl3]:i._Li,[i._Li]:i.Wl3,[i.ehD]:i.ehD},M=new a.j({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new u.F},radius:{value:4}},vertexShader:m.u,fragmentShader:m.D}),E=M.clone();E.defines.HORIZONTAL_PASS=1;const T=new c.u;T.setAttribute("position",new l.Tl(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const C=new h.K(T,M),A=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=i._iA;let P=this.type;function R(n,i){const r=t.update(C);M.defines.VSM_SAMPLES!==n.blurSamples&&(M.defines.VSM_SAMPLES=n.blurSamples,E.defines.VSM_SAMPLES=n.blurSamples,M.needsUpdate=!0,E.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new s.d(g.x,g.y)),M.uniforms.shadow_pass.value=n.map.texture,M.uniforms.resolution.value=n.mapSize,M.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,M,C,null),E.uniforms.shadow_pass.value=n.mapPass.texture,E.uniforms.resolution.value=n.mapSize,E.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,E,C,null)}function L(t,n,s,r){let o=null;const a=!0===s.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==a)o=a;else if(o=!0===s.isPointLight?_:b,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const e=o.uuid,t=n.uuid;let i=x[e];void 0===i&&(i={},x[e]=i);let s=i[t];void 0===s&&(s=o.clone(),i[t]=s),o=s}if(o.visible=n.visible,o.wireframe=n.wireframe,r===i.dwk?o.side=null!==n.shadowSide?n.shadowSide:n.side:o.side=null!==n.shadowSide?n.shadowSide:S[n.side],o.alphaMap=n.alphaMap,o.alphaTest=n.alphaTest,o.map=n.map,o.clipShadows=n.clipShadows,o.clippingPlanes=n.clippingPlanes,o.clipIntersection=n.clipIntersection,o.displacementMap=n.displacementMap,o.displacementScale=n.displacementScale,o.displacementBias=n.displacementBias,o.wireframeLinewidth=n.wireframeLinewidth,o.linewidth=n.linewidth,!0===s.isPointLight&&!0===o.isMeshDistanceMaterial){e.properties.get(o).light=s}return o}function N(n,s,r,o,a){if(!1===n.visible)return;if(n.layers.test(s.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&a===i.dwk)&&(!n.frustumCulled||f.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,n.matrixWorld);const i=t.update(n),s=n.material;if(Array.isArray(s)){const t=i.groups;for(let l=0,c=t.length;lw||g.y>w)&&(g.x>w&&(v.x=Math.floor(w/u.x),g.x=v.x*u.x,l.mapSize.x=v.x),g.y>w&&(v.y=Math.floor(w/u.y),g.y=v.y*u.y,l.mapSize.y=v.y)),null===l.map||!0===h||!0===d){const e=this.type!==i.dwk?{minFilter:i.TyD,magFilter:i.TyD}:{};null!==l.map&&l.map.dispose(),l.map=new s.d(g.x,g.y,e),l.map.texture.name=a.name+".shadowMap",l.camera.updateProjectionMatrix()}e.setRenderTarget(l.map),e.clear();const p=l.getViewportCount();for(let e=0;e{"use strict";n.d(t,{m:()=>o});var i=n(75544),s=n(93113),r=n(84538);function o(e,t,n){const o=n.isWebGL2;const a=new function(){let t=!1;const n=new r.L;let i=null;const s=new r.L(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,r,o,a){!0===a&&(t*=o,i*=o,r*=o),n.set(t,i,r,o),!1===s.equals(n)&&(e.clearColor(t,i,r,o),s.copy(n))},reset:function(){t=!1,i=null,s.set(-1,0,0,0)}}},l=new function(){let t=!1,n=null,s=null,r=null;return{setTest:function(t){t?G(e.DEPTH_TEST):Z(e.DEPTH_TEST)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(s!==t){switch(t){case i.BVF:e.depthFunc(e.NEVER);break;case i.Se2:e.depthFunc(e.ALWAYS);break;case i.Zr5:e.depthFunc(e.LESS);break;case i.vCF:e.depthFunc(e.LEQUAL);break;case i.eD:e.depthFunc(e.EQUAL);break;case i.ksN:e.depthFunc(e.GEQUAL);break;case i.w$m:e.depthFunc(e.GREATER);break;case i.M6v:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}s=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,n=null,s=null,r=null}}},c=new function(){let t=!1,n=null,i=null,s=null,r=null,o=null,a=null,l=null,c=null;return{setTest:function(n){t||(n?G(e.STENCIL_TEST):Z(e.STENCIL_TEST))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,o){i===t&&s===n&&r===o||(e.stencilFunc(t,n,o),i=t,s=n,r=o)},setOp:function(t,n,i){o===t&&a===n&&l===i||(e.stencilOp(t,n,i),o=t,a=n,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,i=null,s=null,r=null,o=null,a=null,l=null,c=null}}},h=new WeakMap,d=new WeakMap;let u={},p={},m=new WeakMap,f=[],g=null,v=!1,y=null,b=null,_=null,x=null,w=null,S=null,M=null,E=new s.I(0,0,0),T=0,C=!1,A=null,P=null,R=null,L=null,N=null;const D=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let I=!1,O=0;const U=e.getParameter(e.VERSION);-1!==U.indexOf("WebGL")?(O=parseFloat(/^WebGL (\d)/.exec(U)[1]),I=O>=1):-1!==U.indexOf("OpenGL ES")&&(O=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),I=O>=2);let k=null,V={};const z=e.getParameter(e.SCISSOR_BOX),F=e.getParameter(e.VIEWPORT),B=(new r.L).fromArray(z),$=(new r.L).fromArray(F);function j(t,n,i,s){const r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let a=0;a{"use strict";n.d(t,{w:()=>l});var i=n(75544),s=n(71050),r=n(80109),o=n(19564),a=n(19748);function l(e,t,n,l,c,h,d){const u=c.isWebGL2,p=c.maxTextures,m=c.maxCubemapSize,f=c.maxTextureSize,g=c.maxSamples,v=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,y="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),b=new WeakMap;let _;const x=new WeakMap;let w=!1;try{w="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function S(e,t){return w?new OffscreenCanvas(e,t):(0,o.c)("canvas")}function M(e,t,n,i){let r=1;if((e.width>i||e.height>i)&&(r=i/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const i=t?s.gy:Math.floor,o=i(r*e.width),a=i(r*e.height);void 0===_&&(_=S(o,a));const l=n?S(o,a):_;l.width=o,l.height=a;return l.getContext("2d").drawImage(e,0,0,o,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+a+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function E(e){return s.wt(e.width)&&s.wt(e.height)}function T(e,t){return e.generateMipmaps&&t&&e.minFilter!==i.TyD&&e.minFilter!==i.wem}function C(t){e.generateMipmap(t)}function A(n,s,r,o,l=!1){if(!1===u)return s;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let c=s;if(s===e.RED&&(r===e.FLOAT&&(c=e.R32F),r===e.HALF_FLOAT&&(c=e.R16F),r===e.UNSIGNED_BYTE&&(c=e.R8)),s===e.RED_INTEGER&&(r===e.UNSIGNED_BYTE&&(c=e.R8UI),r===e.UNSIGNED_SHORT&&(c=e.R16UI),r===e.UNSIGNED_INT&&(c=e.R32UI),r===e.BYTE&&(c=e.R8I),r===e.SHORT&&(c=e.R16I),r===e.INT&&(c=e.R32I)),s===e.RG&&(r===e.FLOAT&&(c=e.RG32F),r===e.HALF_FLOAT&&(c=e.RG16F),r===e.UNSIGNED_BYTE&&(c=e.RG8)),s===e.RGBA){const t=l?i.l6D:a.ep.getTransfer(o);r===e.FLOAT&&(c=e.RGBA32F),r===e.HALF_FLOAT&&(c=e.RGBA16F),r===e.UNSIGNED_BYTE&&(c=t===i.j17?e.SRGB8_ALPHA8:e.RGBA8),r===e.UNSIGNED_SHORT_4_4_4_4&&(c=e.RGBA4),r===e.UNSIGNED_SHORT_5_5_5_1&&(c=e.RGB5_A1)}return c!==e.R16F&&c!==e.R32F&&c!==e.RG16F&&c!==e.RG32F&&c!==e.RGBA16F&&c!==e.RGBA32F||t.get("EXT_color_buffer_float"),c}function P(e,t,n){return!0===T(e,n)||e.isFramebufferTexture&&e.minFilter!==i.TyD&&e.minFilter!==i.wem?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function R(t){return t===i.TyD||t===i.YLQ||t===i.aH4?e.NEAREST:e.LINEAR}function L(e){const t=e.target;t.removeEventListener("dispose",L),function(e){const t=l.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=x.get(n);if(i){const s=i[t.__cacheKey];s.usedTimes--,0===s.usedTimes&&D(e),0===Object.keys(i).length&&x.delete(n)}l.remove(e)}(t),t.isVideoTexture&&b.delete(t)}function N(t){const n=t.target;n.removeEventListener("dispose",N),function(t){const n=t.texture,i=l.get(t),s=l.get(n);void 0!==s.__webglTexture&&(e.deleteTexture(s.__webglTexture),d.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(i.__webglFramebuffer[t]))for(let n=0;n0&&s.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void B(s,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+i)}const U={[i.rpg]:e.REPEAT,[i.uWy]:e.CLAMP_TO_EDGE,[i.OoA]:e.MIRRORED_REPEAT},k={[i.TyD]:e.NEAREST,[i.YLQ]:e.NEAREST_MIPMAP_NEAREST,[i.aH4]:e.NEAREST_MIPMAP_LINEAR,[i.wem]:e.LINEAR,[i.qyh]:e.LINEAR_MIPMAP_NEAREST,[i.D1R]:e.LINEAR_MIPMAP_LINEAR},V={[i.xoQ]:e.NEVER,[i.T6w]:e.ALWAYS,[i.D67]:e.LESS,[i.M$G]:e.LEQUAL,[i.F1y]:e.EQUAL,[i.Jjb]:e.GEQUAL,[i.Zen]:e.GREATER,[i.O78]:e.NOTEQUAL};function z(n,s,r){if(r?(e.texParameteri(n,e.TEXTURE_WRAP_S,U[s.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,U[s.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,U[s.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,k[s.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,k[s.minFilter])):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE),s.wrapS===i.uWy&&s.wrapT===i.uWy||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,e.TEXTURE_MAG_FILTER,R(s.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,R(s.minFilter)),s.minFilter!==i.TyD&&s.minFilter!==i.wem&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,V[s.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");if(s.magFilter===i.TyD)return;if(s.minFilter!==i.aH4&&s.minFilter!==i.D1R)return;if(s.type===i.VzW&&!1===t.has("OES_texture_float_linear"))return;if(!1===u&&s.type===i.cLu&&!1===t.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||l.get(s).__currentAnisotropy)&&(e.texParameterf(n,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,c.getMaxAnisotropy())),l.get(s).__currentAnisotropy=s.anisotropy)}}function F(t,n){let i=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",L));const s=n.source;let r=x.get(s);void 0===r&&(r={},x.set(s,r));const o=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(n);if(o!==t.__cacheKey){void 0===r[o]&&(r[o]={texture:e.createTexture(),usedTimes:0},d.memory.textures++,i=!0),r[o].usedTimes++;const s=r[t.__cacheKey];void 0!==s&&(r[t.__cacheKey].usedTimes--,0===s.usedTimes&&D(n)),t.__cacheKey=o,t.__webglTexture=r[o].texture}return i}function B(t,s,r){let o=e.TEXTURE_2D;(s.isDataArrayTexture||s.isCompressedArrayTexture)&&(o=e.TEXTURE_2D_ARRAY),s.isData3DTexture&&(o=e.TEXTURE_3D);const c=F(t,s),d=s.source;n.bindTexture(o,t.__webglTexture,e.TEXTURE0+r);const p=l.get(d);if(d.version!==p.__version||!0===c){n.activeTexture(e.TEXTURE0+r);const t=a.ep.getPrimaries(a.ep.workingColorSpace),l=s.colorSpace===i.aCh?null:a.ep.getPrimaries(s.colorSpace),m=s.colorSpace===i.aCh||t===l?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,m);const g=function(e){return!u&&(e.wrapS!==i.uWy||e.wrapT!==i.uWy||e.minFilter!==i.TyD&&e.minFilter!==i.wem)}(s)&&!1===E(s.image);let v=M(s.image,g,!1,f);v=W(s,v);const y=E(v)||u,b=h.convert(s.format,s.colorSpace);let _,x=h.convert(s.type),w=A(s.internalFormat,b,x,s.colorSpace,s.isVideoTexture);z(o,s,y);const S=s.mipmaps,R=u&&!0!==s.isVideoTexture,L=void 0===p.__version||!0===c,N=P(s,v,y);if(s.isDepthTexture)w=e.DEPTH_COMPONENT,u?w=s.type===i.VzW?e.DEPTH_COMPONENT32F:s.type===i.JQ4?e.DEPTH_COMPONENT24:s.type===i.wJv?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT16:s.type===i.VzW&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),s.format===i.qkB&&w===e.DEPTH_COMPONENT&&s.type!==i.LsT&&s.type!==i.JQ4&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),s.type=i.JQ4,x=h.convert(s.type)),s.format===i.brP&&w===e.DEPTH_COMPONENT&&(w=e.DEPTH_STENCIL,s.type!==i.wJv&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),s.type=i.wJv,x=h.convert(s.type))),L&&(R?n.texStorage2D(e.TEXTURE_2D,1,w,v.width,v.height):n.texImage2D(e.TEXTURE_2D,0,w,v.width,v.height,0,b,x,null));else if(s.isDataTexture)if(S.length>0&&y){R&&L&&n.texStorage2D(e.TEXTURE_2D,N,w,S[0].width,S[0].height);for(let t=0,i=S.length;t>=1,i>>=1}}else if(S.length>0&&y){R&&L&&n.texStorage2D(e.TEXTURE_2D,N,w,S[0].width,S[0].height);for(let t=0,i=S.length;t>a),s=Math.max(1,i.height>>a);o===e.TEXTURE_3D||o===e.TEXTURE_2D_ARRAY?n.texImage3D(o,a,u,t,s,i.depth,0,c,d,null):n.texImage2D(o,a,u,t,s,0,c,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),Z(i)?v.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,r,o,l.get(s).__webglTexture,0,G(i)):(o===e.TEXTURE_2D||o>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&o<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,r,o,l.get(s).__webglTexture,a),n.bindFramebuffer(e.FRAMEBUFFER,null)}function j(t,n,s){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer){let r=!0===u?e.DEPTH_COMPONENT24:e.DEPTH_COMPONENT16;if(s||Z(n)){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===i.VzW?r=e.DEPTH_COMPONENT32F:t.type===i.JQ4&&(r=e.DEPTH_COMPONENT24));const s=G(n);Z(n)?v.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,s,r,n.width,n.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,s,r,n.width,n.height)}else e.renderbufferStorage(e.RENDERBUFFER,r,n.width,n.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(n.depthBuffer&&n.stencilBuffer){const i=G(n);s&&!1===Z(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,n.width,n.height):Z(n)?v.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)}else{const t=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let i=0;i0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function W(e,n){const s=e.colorSpace,o=e.format,l=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===i.L_r||s!==i.GUF&&s!==i.aCh&&(a.ep.getTransfer(s)===i.j17?!1===u?!0===t.has("EXT_sRGB")&&o===i.wk1?(e.format=i.L_r,e.minFilter=i.wem,e.generateMipmaps=!1):n=r.P.sRGBToLinear(n):o===i.wk1&&l===i.ywz||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",s)),n}this.allocateTextureUnit=function(){const e=I;return e>=p&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+p),I+=1,e},this.resetTextureUnits=function(){I=0},this.setTexture2D=O,this.setTexture2DArray=function(t,i){const s=l.get(t);t.version>0&&s.__version!==t.version?B(s,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,s.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const s=l.get(t);t.version>0&&s.__version!==t.version?B(s,t,i):n.bindTexture(e.TEXTURE_3D,s.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,s){const r=l.get(t);t.version>0&&r.__version!==t.version?function(t,s,r){if(6!==s.image.length)return;const o=F(t,s),c=s.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+r);const d=l.get(c);if(c.version!==d.__version||!0===o){n.activeTexture(e.TEXTURE0+r);const t=a.ep.getPrimaries(a.ep.workingColorSpace),l=s.colorSpace===i.aCh?null:a.ep.getPrimaries(s.colorSpace),p=s.colorSpace===i.aCh||t===l?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);const f=s.isCompressedTexture||s.image[0].isCompressedTexture,g=s.image[0]&&s.image[0].isDataTexture,v=[];for(let e=0;e<6;e++)v[e]=f||g?g?s.image[e].image:s.image[e]:M(s.image[e],!1,!0,m),v[e]=W(s,v[e]);const y=v[0],b=E(y)||u,_=h.convert(s.format,s.colorSpace),x=h.convert(s.type),w=A(s.internalFormat,_,x,s.colorSpace),S=u&&!0!==s.isVideoTexture,R=void 0===d.__version||!0===o;let L,N=P(s,y,b);if(z(e.TEXTURE_CUBE_MAP,s,b),f){S&&R&&n.texStorage2D(e.TEXTURE_CUBE_MAP,N,w,y.width,y.height);for(let t=0;t<6;t++){L=v[t].mipmaps;for(let r=0;r0&&N++,n.texStorage2D(e.TEXTURE_CUBE_MAP,N,w,v[0].width,v[0].height));for(let t=0;t<6;t++)if(g){S?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,v[t].width,v[t].height,_,x,v[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,w,v[t].width,v[t].height,0,_,x,v[t].data);for(let i=0;i0){s.__webglFramebuffer[t]=[];for(let n=0;n0){s.__webglFramebuffer=[];for(let t=0;t0&&!1===Z(t)){const r=a?i:[i];s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0&&!1===Z(t)){const i=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],s=t.width,r=t.height;let o=e.COLOR_BUFFER_BIT;const a=[],c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,h=l.get(t),d=!0===t.isWebGLMultipleRenderTargets;if(d)for(let t=0;t{"use strict";n.d(t,{y:()=>he});var i=n(48651),s=n(21364),r=n(57938),o=n(85375);const a=new s.x,l=new r.p,c=new o.J,h=new i.B,d=[],u=[],p=new Float32Array(16),m=new Float32Array(9),f=new Float32Array(4);function g(e,t,n){const i=e[0];if(i<=0||i>0)return e;const s=t*n;let r=d[s];if(void 0===r&&(r=new Float32Array(s),d[s]=r),0!==t){i.toArray(r,0);for(let i=1,s=0;i!==t;++i)s+=n,e[i].toArray(r,s)}return r}function v(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n{"use strict";function i(e,t,n,i){let s={},r={},o=[];const a=n.isWebGL2?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(e,t,n){const i=e.value;if(void 0===n[t]){if("number"==typeof i)n[t]=i;else{const e=Array.isArray(i)?i:[i],s=[];for(let t=0;t0){s=n%i;const e=i-s;0!==s&&e-o.boundary<0&&(n+=i-s,r.__offset=n)}n+=o.storage}s=n%i,s>0&&(n+=i-s);e.__size=n,e.__cache={}}(n),u=function(t){const n=function(){for(let e=0;ei})},9840:(e,t,n)=>{"use strict";n.d(t,{f:()=>r});var i=n(75544),s=n(19748);function r(e,t,n){const r=n.isWebGL2;return{convert:function(n,o=i.aCh){let a;const l=s.ep.getTransfer(o);if(n===i.ywz)return e.UNSIGNED_BYTE;if(n===i.k0A)return e.UNSIGNED_SHORT_4_4_4_4;if(n===i.irR)return e.UNSIGNED_SHORT_5_5_5_1;if(n===i.T95)return e.BYTE;if(n===i.iAb)return e.SHORT;if(n===i.LsT)return e.UNSIGNED_SHORT;if(n===i.Kz5)return e.INT;if(n===i.JQ4)return e.UNSIGNED_INT;if(n===i.VzW)return e.FLOAT;if(n===i.cLu)return r?e.HALF_FLOAT:(a=t.get("OES_texture_half_float"),null!==a?a.HALF_FLOAT_OES:null);if(n===i.OTo)return e.ALPHA;if(n===i.wk1)return e.RGBA;if(n===i.Y8D)return e.LUMINANCE;if(n===i.cRx)return e.LUMINANCE_ALPHA;if(n===i.qkB)return e.DEPTH_COMPONENT;if(n===i.brP)return e.DEPTH_STENCIL;if(n===i.L_r)return a=t.get("EXT_sRGB"),null!==a?a.SRGB_ALPHA_EXT:null;if(n===i.hEm)return e.RED;if(n===i.D9w)return e.RED_INTEGER;if(n===i.av9)return e.RG;if(n===i.CtA)return e.RG_INTEGER;if(n===i.E2K)return e.RGBA_INTEGER;if(n===i.wuA||n===i.BFQ||n===i.v3W||n===i.ILR)if(l===i.j17){if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===a)return null;if(n===i.wuA)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===i.BFQ)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===i.v3W)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===i.ILR)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(a=t.get("WEBGL_compressed_texture_s3tc"),null===a)return null;if(n===i.wuA)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===i.BFQ)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===i.v3W)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===i.ILR)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===i._AM||n===i.vCx||n===i.eaV||n===i.CaW){if(a=t.get("WEBGL_compressed_texture_pvrtc"),null===a)return null;if(n===i._AM)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===i.vCx)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===i.eaV)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===i.CaW)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===i.fto)return a=t.get("WEBGL_compressed_texture_etc1"),null!==a?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===i.l0P||n===i.ekQ){if(a=t.get("WEBGL_compressed_texture_etc"),null===a)return null;if(n===i.l0P)return l===i.j17?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(n===i.ekQ)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}if(n===i.ptH||n===i.jZA||n===i.y2t||n===i.gi4||n===i.Djp||n===i.BG$||n===i.NYV||n===i.xJs||n===i.pKu||n===i.GG6||n===i.Gih||n===i.FUD||n===i.iiP||n===i.SvJ){if(a=t.get("WEBGL_compressed_texture_astc"),null===a)return null;if(n===i.ptH)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===i.jZA)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===i.y2t)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===i.gi4)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===i.Djp)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===i.BG$)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===i.NYV)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===i.xJs)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===i.pKu)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===i.GG6)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===i.Gih)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===i.FUD)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===i.iiP)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===i.SvJ)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===i.bsb||n===i.f2y||n===i.QO2){if(a=t.get("EXT_texture_compression_bptc"),null===a)return null;if(n===i.bsb)return l===i.j17?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===i.f2y)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===i.QO2)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(n===i.HdW||n===i.vuL||n===i.ZTh||n===i.lGU){if(a=t.get("EXT_texture_compression_rgtc"),null===a)return null;if(n===i.bsb)return a.COMPRESSED_RED_RGTC1_EXT;if(n===i.vuL)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===i.ZTh)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===i.lGU)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===i.wJv?r?e.UNSIGNED_INT_24_8:(a=t.get("WEBGL_depth_texture"),null!==a?a.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[n]?e[n]:null}}}},83084:(e,t,n)=>{"use strict";n.d(t,{N:()=>o});var i=n(19588),s=n(29187);const r={type:"move"};class o{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new s.Z,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new s.Z,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new i.P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new i.P),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new s.Z,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new i.P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new i.P),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(c&&e.hand){o=!0;for(const i of e.hand.values()){const e=t.getJointPose(i,n),s=this._getHandJoint(c,i);null!==e&&(s.matrix.fromArray(e.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,s.jointRadius=e.radius),s.visible=null!==e}const i=c.joints["index-finger-tip"],s=c.joints["thumb-tip"],r=i.position.distanceTo(s.position),a=.02,l=.005;c.inputState.pinching&&r>a+l?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&r<=a-l&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),null!==s&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));null!==a&&(i=t.getPose(e.targetRaySpace,n),null===i&&null!==s&&(i=s),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(r)))}return null!==a&&(a.visible=null!==i),null!==l&&(l.visible=null!==s),null!==c&&(c.visible=null!==o),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new s.Z;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}},53288:(e,t,n)=>{"use strict";n.d(t,{M:()=>m});var i=n(60531),s=n(19251),r=n(67440),o=n(19588),a=n(84538),l=n(71050),c=n(54871),h=n(46953),d=n(83084),u=n(38057),p=n(75544);class m extends s.p{constructor(e,t){super();const n=this;let s=null,m=1,f=null,g="local-floor",v=1,y=null,b=null,_=null,x=null,w=null,S=null;const M=t.getContextAttributes();let E=null,T=null;const C=[],A=[],P=new r.c;P.layers.enable(1),P.viewport=new a.L;const R=new r.c;R.layers.enable(2),R.viewport=new a.L;const L=[P,R],N=new i.H;N.layers.enable(1),N.layers.enable(2);let D=null,I=null;function O(e){const t=A.indexOf(e.inputSource);if(-1===t)return;const n=C[t];void 0!==n&&(n.update(e.inputSource,e.frame,y||f),n.dispatchEvent({type:e.type,data:e.inputSource}))}function U(){s.removeEventListener("select",O),s.removeEventListener("selectstart",O),s.removeEventListener("selectend",O),s.removeEventListener("squeeze",O),s.removeEventListener("squeezestart",O),s.removeEventListener("squeezeend",O),s.removeEventListener("end",U),s.removeEventListener("inputsourceschange",k);for(let e=0;e=0&&(A[i]=null,C[i].disconnect(n))}for(let t=0;t=A.length){A.push(n),i=e;break}if(null===A[e]){A[e]=n,i=e;break}}if(-1===i)break}const s=C[i];s&&s.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=C[e];return void 0===t&&(t=new d.N,C[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=C[e];return void 0===t&&(t=new d.N,C[e]=t),t.getGripSpace()},this.getHand=function(e){let t=C[e];return void 0===t&&(t=new d.N,C[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){m=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){g=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return y||f},this.setReferenceSpace=function(e){y=e},this.getBaseLayer=function(){return null!==x?x:w},this.getBinding=function(){return _},this.getFrame=function(){return S},this.getSession=function(){return s},this.setSession=async function(i){if(s=i,null!==s){if(E=e.getRenderTarget(),s.addEventListener("select",O),s.addEventListener("selectstart",O),s.addEventListener("selectend",O),s.addEventListener("squeeze",O),s.addEventListener("squeezestart",O),s.addEventListener("squeezeend",O),s.addEventListener("end",U),s.addEventListener("inputsourceschange",k),!0!==M.xrCompatible&&await t.makeXRCompatible(),void 0===s.renderState.layers||!1===e.capabilities.isWebGL2){const n={antialias:void 0!==s.renderState.layers||M.antialias,alpha:!0,depth:M.depth,stencil:M.stencil,framebufferScaleFactor:m};w=new XRWebGLLayer(s,t,n),s.updateRenderState({baseLayer:w}),T=new h.d(w.framebufferWidth,w.framebufferHeight,{format:p.wk1,type:p.ywz,colorSpace:e.outputColorSpace,stencilBuffer:M.stencil})}else{let n=null,i=null,r=null;M.depth&&(r=M.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=M.stencil?p.brP:p.qkB,i=M.stencil?p.wJv:p.JQ4);const o={colorFormat:t.RGBA8,depthFormat:r,scaleFactor:m};_=new XRWebGLBinding(s,t),x=_.createProjectionLayer(o),s.updateRenderState({layers:[x]}),T=new h.d(x.textureWidth,x.textureHeight,{format:p.wk1,type:p.ywz,depthTexture:new u.$(x.textureWidth,x.textureHeight,i,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:M.stencil,colorSpace:e.outputColorSpace,samples:M.antialias?4:0});e.properties.get(T).__ignoreDepthValues=x.ignoreDepthValues}T.isXRRenderTarget=!0,this.setFoveation(v),y=null,f=await s.requestReferenceSpace(g),$.setContext(s),$.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==s)return s.environmentBlendMode};const V=new o.P,z=new o.P;function F(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===s)return;N.near=R.near=P.near=e.near,N.far=R.far=P.far=e.far,D===N.near&&I===N.far||(s.updateRenderState({depthNear:N.near,depthFar:N.far}),D=N.near,I=N.far);const t=e.parent,n=N.cameras;F(N,t);for(let e=0;e{"use strict";n.d(t,{x:()=>s});var i=n(25499);class s extends i.T{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}},48651:(e,t,n)=>{"use strict";n.d(t,{B:()=>r});var i=n(21364),s=n(75544);class r extends i.x{constructor(e,t,n,i,r,o,a,l,c,h){super(e=void 0!==e?e:[],t=void 0!==t?t:s.fY$,n,i,r,o,a,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}},85375:(e,t,n)=>{"use strict";n.d(t,{J:()=>r});var i=n(21364),s=n(75544);class r extends i.x{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=s.TyD,this.minFilter=s.TyD,this.wrapR=s.uWy,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}},57938:(e,t,n)=>{"use strict";n.d(t,{p:()=>r});var i=n(21364),s=n(75544);class r extends i.x{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=s.TyD,this.minFilter=s.TyD,this.wrapR=s.uWy,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}},38057:(e,t,n)=>{"use strict";n.d(t,{$:()=>r});var i=n(21364),s=n(75544);class r extends i.x{constructor(e,t,n,i,r,o,a,l,c,h){if((h=void 0!==h?h:s.qkB)!==s.qkB&&h!==s.brP)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&h===s.qkB&&(n=s.JQ4),void 0===n&&h===s.brP&&(n=s.wJv),super(null,i,r,o,a,l,h,n,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==a?a:s.TyD,this.minFilter=void 0!==l?l:s.TyD,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}},37136:(e,t,n)=>{"use strict";n.d(t,{H:()=>o});var i=n(80109),s=n(71050);let r=0;class o{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:r++}),this.uuid=s.DO(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t{"use strict";n.d(t,{x:()=>d});var i=n(19251),s=n(75544),r=n(71050),o=n(40693),a=n(23130),l=n(37136),c=n(19564);let h=0;class d extends i.p{constructor(e=d.DEFAULT_IMAGE,t=d.DEFAULT_MAPPING,n=s.uWy,i=s.uWy,u=s.wem,p=s.D1R,m=s.wk1,f=s.ywz,g=d.DEFAULT_ANISOTROPY,v=s.aCh){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:h++}),this.uuid=r.DO(),this.name="",this.source=new l.H(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=u,this.minFilter=p,this.anisotropy=g,this.format=m,this.internalFormat=null,this.type=f,this.offset=new o.F(0,0),this.repeat=new o.F(1,1),this.center=new o.F(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new a.V,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof v?this.colorSpace=v:((0,c.O4)("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=v===s.knz?s.KI_:s.aCh),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==s.xfE)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case s.rpg:e.x=e.x-Math.floor(e.x);break;case s.uWy:e.x=e.x<0?0:1;break;case s.OoA:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case s.rpg:e.y=e.y-Math.floor(e.y);break;case s.uWy:e.y=e.y<0?0:1;break;case s.OoA:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return(0,c.O4)("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===s.KI_?s.knz:s.rnI}set encoding(e){(0,c.O4)("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===s.knz?s.KI_:s.aCh}}d.DEFAULT_IMAGE=null,d.DEFAULT_MAPPING=s.xfE,d.DEFAULT_ANISOTROPY=1},19564:(e,t,n)=>{"use strict";function i(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}n.d(t,{H7:()=>i,O4:()=>a,O5:()=>r,c:()=>s});Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function s(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function r(){const e=s("canvas");return e.style.display="block",e}const o={};function a(e){e in o||(o[e]=!0,console.warn(e))}},338:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},90360:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},47227:e=>{"use strict";e.exports=JSON.parse('{"asset":{"type":"application/si-dpo-3d.document+json","version":"1.0","copyright":"(c) Smithsonian Institution, all rights reserved","generator":"Voyager"},"scene":0,"scenes":[{"nodes":[0,1],"setup":0}],"nodes":[{"translation":[0,0,15],"camera":0},{"name":"Lights","children":[2,3,4,5]},{"translation":[0,0,2],"rotation":[0.4829741,-0.1070728,0.1880998,0.8484633],"scale":[1,1,1],"name":"Key","light":0},{"rotation":[0.3546969,0.163893,-0.3861077,0.8356136],"scale":[1,1,1],"name":"Fill #1","light":1},{"translation":[0,0,1],"rotation":[0.9374013,-0.3018693,0.0532277,0.1652891],"name":"Fill #2","light":2},{"translation":[1,0,-1],"rotation":[0.373256,0.6426073,-0.5786063,0.3360813],"scale":[1,1,1],"name":"Rim","light":3}],"setups":[{"units":"cm","interface":{"visible":true,"logo":true,"menu":true,"tools":true},"viewer":{"shader":"Default","exposure":1,"gamma":2,"annotationsVisible":false},"reader":{"enabled":false,"position":"Overlay"},"navigation":{"type":"Orbit","enabled":true,"autoZoom":true,"lightsFollowCamera":true,"autoRotation":false,"orbit":{"orbit":[-24,-26,0],"offset":[0,0,150],"minOrbit":[-90,null,null],"maxOrbit":[90,null,null],"minOffset":[null,null,0.1],"maxOffset":[null,null,10000]}},"background":{"style":"RadialGradient","color0":[0.2,0.25,0.3],"color1":[0.01,0.03,0.05]},"floor":{"visible":false,"position":[0,-25,0],"size":50,"color":[0.6,0.75,0.8],"opacity":0.5,"receiveShadow":false},"grid":{"visible":false,"color":[0.5,0.7,0.8]},"tape":{"enabled":false,"startPosition":[0,0,0],"startDirection":[0,0,0],"endPosition":[0,0,0],"endDirection":[0,0,0]},"slicer":{"enabled":false,"axis":"X","inverted":false,"position":0.5}}],"cameras":[{"type":"perspective","perspective":{"yfov":52,"znear":0.1,"zfar":100000}}],"lights":[{"color":[1,0.95,0.9],"intensity":1,"type":"directional","shadowEnabled":true},{"color":[0.9,0.95,1],"intensity":0.7,"type":"directional","shadowEnabled":true},{"color":[0.8,0.85,1],"intensity":0.5,"type":"directional"},{"color":[0.85,0.9078313,1],"intensity":0.6,"type":"directional"}]}')}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};n(94860)})(); \ No newline at end of file diff --git a/previewers/betatest/lib/voyager-explorer.v0.43.0.gdcc.min.js b/previewers/betatest/lib/voyager-explorer.v0.43.0.gdcc.min.js new file mode 100644 index 0000000..233c165 --- /dev/null +++ b/previewers/betatest/lib/voyager-explorer.v0.43.0.gdcc.min.js @@ -0,0 +1,395 @@ +/*! For license information please see voyager-explorer.min.js.LICENSE.txt */ +(()=>{var e={93523:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n\n// #include \n// replaced with\nvarying vec2 vUv;\n\n//#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include \n\n vec2 coords = vUv * 2.0 - 1.0;\n float f = dot(coords, coords);\n\tgl_FragColor = vec4(outgoingLight, mix(diffuseColor.a, 0.0, f));\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n\n"},62001:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include \n\n//#include \n// replaced with\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\n//#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t// replaced with\n\tvUv = ( vec3( uv, 1 ) ).xy;\n\n\t//#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n\n"},8669:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="//#define STANDARD\n\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef IOR\n\tuniform float ior;\n#endif\n\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\n\nvarying vec3 vViewPosition;\n\n\n#include \n#include \n#include \n#include \n\n#include \n\n// Zone map support\n#if defined(USE_ZONEMAP)\n\tvarying vec2 vZoneUv;\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#ifdef USE_ZONEMAP\n\tuniform sampler2D zoneMap;\n#endif\n\n#ifdef USE_AOMAP\n uniform vec3 aoMapMix;\n#endif\n\n#ifdef MODE_XRAY\n varying float vIntensity;\n#endif\n\n#ifdef CUT_PLANE\n\t#if !defined(USE_TRANSMISSION)\n \tvarying vec3 vWorldPosition;\n\t#endif\n uniform vec4 cutPlaneDirection;\n uniform vec3 cutPlaneColor;\n#endif\n\nvoid main() {\n #ifdef CUT_PLANE\n if (dot(vWorldPosition, cutPlaneDirection.xyz) < -cutPlaneDirection.w) {\n discard;\n }\n #endif\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#ifdef CUT_PLANE\n\t // on the cut surface (back facing fragments revealed), replace normal with cut plane direction\n if (!gl_FrontFacing) {\n normal = -cutPlaneDirection.xyz;\n diffuseColor.rgb = cutPlaneColor.rgb;\n }\n\t#endif\n\n #include \n #include \n #include \n\t\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t//#include \n\t// REPLACED WITH\n\t#ifdef USE_AOMAP\n\t // if cut plane is enabled, disable ambient occlusion on back facing fragments\n\t #ifdef CUT_PLANE\n if (gl_FrontFacing) {\n\t #endif\n\n \t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n \tvec3 aoSample = vec3(texture2D(aoMap, vAoMapUv).r,texture2D(aoMap, vAoMapUv).r,texture2D(aoMap, vAoMapUv).r);\n \tvec3 aoFactors = mix(vec3(1.0), aoSample, clamp(aoMapMix * aoMapIntensity, 0.0, 1.0));\n \tfloat ambientOcclusion = aoFactors.x * aoFactors.y * aoFactors.z;\n \tfloat ambientOcclusion2 = ambientOcclusion * ambientOcclusion;\n \treflectedLight.directDiffuse *= ambientOcclusion2;\n \treflectedLight.directSpecular *= ambientOcclusion;\n \t//reflectedLight.indirectDiffuse *= ambientOcclusion;\n\n \t#if defined( USE_CLEARCOAT ) \n\t\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t\t#endif\n\n\t\t#if defined( USE_SHEEN ) \n\t\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t\t#endif\n\n\t\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\n\t\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\n\t\t#endif\n\n \t#ifdef CUT_PLANE\n \t }\n \t#endif\n #endif\n\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\n\t#include \n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\n #ifdef USE_SHEEN\n\n\t\t// Sheen energy compensation approximation calculation can be found at the end of\n\t\t// https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\n\t#endif\n\n\t#ifdef CUT_PLANE\n\tif (!gl_FrontFacing) {\n\t\toutgoingLight = cutPlaneColor.rgb;\n\t}\n\t#endif\n\n\t#include \n\n\t#ifdef USE_ZONEMAP\n\t\tvec4 zoneColor = texture2D(zoneMap, vZoneUv);\n\t\tgl_FragColor += mix(vec4(0.0, 0.0, 0.0, 1.0), vec4(zoneColor.rgb, 1.0), zoneColor.a);\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n #ifdef MODE_NORMALS\n gl_FragColor = vec4(vec3(normal * 0.5 + 0.5), 1.0);\n #endif\n\n #ifdef MODE_XRAY\n gl_FragColor = vec4(vec3(0.4, 0.7, 1.0) * vIntensity, 1.0);\n #endif\n}\n"},9849:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i="//#define PHYSICAL\n//#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#if defined(USE_TRANSMISSION) || defined(CUT_PLANE)\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n// Zone map support\n#if defined(USE_ZONEMAP)\t\n\tvarying vec2 vZoneUv;\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#ifdef MODE_XRAY\n varying float vIntensity;\n#endif\n\n//#ifdef CUT_PLANE\n// varying vec3 vWorldPosition;\n//#endif\n\nvoid main() {\n\n\t#include \n\n// Zone map support\n#if defined(USE_ZONEMAP)\n\t#if defined(USE_MAP)\n\t\tvZoneUv = (mapTransform * vec3(vMapUv, 1)).xy;\n\t#else\n\t\tvZoneUv = uv;\n\t#endif\n#endif\n\n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n#ifdef MODE_XRAY\n vIntensity = pow(abs(1.0 - abs(dot(vNormal, vec3(0.0, 0.0, 1.0)))), 3.0);\n#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t// #include \n\t// REPLACED WITH\n\t#if defined(USE_ENVMAP) || defined(DISTANCE) || defined(USE_SHADOWMAP) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 || defined(CUT_PLANE)\n \tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n #endif\n\n\t#include \n\t#include \n\n#ifdef USE_TRANSMISSION\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif\n\n#ifdef CUT_PLANE\n vWorldPosition = worldPosition.xyz / worldPosition.w;\n#endif\n\n#ifdef MODE_NORMALS\n vNormal = normal;\n#endif\n}"},75310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const i=n(72206),s=n(610),r=n(73348),o=n(90360),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends i.default{_addVocabularies(){super._addVocabularies(),s.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(r.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var h=n(43750);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var d=n(56110);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}})},6657:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class i extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=i;class s extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof i&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function r(e,...t){const n=[e[0]];let i=0;for(;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const i=n(6657),s=n(32715);var r=n(6657);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var o=n(32715);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),t.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?s.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,e,t)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof i.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=B(this.rhs,e,t),this}get names(){return P(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class h extends c{constructor(e,t,n,i){super(e,n,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class u extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class p extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class f extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=B(this.code,e,t),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let i=n.length;for(;i--;){const s=n[i];s.optimizeNames(e,t)||(R(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>T(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class A extends m{}class v extends g{}v.kind="else";class y extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(D(e),t instanceof y?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=B(this.condition,e,t),this}get names(){const e=super.names;return P(e,this.condition),this.else&&T(e,this.else.names),e}}y.kind="if";class b extends g{}b.kind="for";class _ extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=B(this.iteration,e,t),this}get names(){return T(super.names,this.iteration.names)}}class x extends b{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){const t=e.es5?s.varKinds.var:this.varKind,{name:n,from:i,to:r}=this;return`for(${t} ${n}=${i}; ${n}<${r}; ${n}++)`+super.render(e)}get names(){const e=P(super.names,this.from);return P(e,this.to)}}class w extends b{constructor(e,t,n,i){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=B(this.iterable,e,t),this}get names(){return T(super.names,this.iterable.names)}}class E extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}E.kind="func";class C extends m{render(e){return"return "+super.render(e)}}C.kind="return";class S extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,i;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(i=this.finally)||void 0===i||i.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&T(e,this.catch.names),this.finally&&T(e,this.finally.names),e}}class M extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}M.kind="catch";class I extends g{render(e){return"finally"+super.render(e)}}I.kind="finally";function T(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function P(e,t){return t instanceof i._CodeOrName?T(e,t.names):e}function B(e,t,n){return e instanceof i.Name?r(e):(s=e)instanceof i._Code&&s._items.some((e=>e instanceof i.Name&&1===t[e.str]&&void 0!==n[e.str]))?new i._Code(e._items.reduce(((e,t)=>(t instanceof i.Name&&(t=r(t)),t instanceof i._Code?e.push(...t._items):e.push(t),e)),[])):e;var s;function r(e){const i=n[e.str];return void 0===i||1!==t[e.str]?e:(delete t[e.str],i)}}function R(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function D(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:i._`!${O(e)}`}t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new s.Scope({parent:e}),this._nodes=[new A]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,i){const s=this._scope.toName(t);return void 0!==n&&i&&(this._constants[s.str]=n),this._leafNode(new l(e,s,n)),s}const(e,t,n){return this._def(s.varKinds.const,e,t,n)}let(e,t,n){return this._def(s.varKinds.let,e,t,n)}var(e,t,n){return this._def(s.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new c(e,t,n))}add(e,n){return this._leafNode(new h(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==i.nil&&this._leafNode(new f(e)),this}object(...e){const t=["{"];for(const[n,s]of e)t.length>1&&t.push(","),t.push(n),(n!==s||this.opts.es5)&&(t.push(":"),(0,i.addCodeArg)(t,s));return t.push("}"),new i._Code(t)}if(e,t,n){if(this._blockNode(new y(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,n,i,r=(this.opts.es5?s.varKinds.var:s.varKinds.let)){const o=this._scope.toName(e);return this._for(new x(r,o,t,n),(()=>i(o)))}forOf(e,t,n,r=s.varKinds.const){const o=this._scope.toName(e);if(this.opts.es5){const e=t instanceof i.Name?t:this.var("_arr",t);return this.forRange("_i",0,i._`${e}.length`,(t=>{this.var(o,i._`${e}[${t}]`),n(o)}))}return this._for(new w("of",r,o,t),(()=>n(o)))}forIn(e,t,n,r=(this.opts.es5?s.varKinds.var:s.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,i._`Object.keys(${t})`,n);const o=this._scope.toName(e);return this._for(new w("in",r,o,t),(()=>n(o)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new u(e))}return(e){const t=new C;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new S;if(this._blockNode(i),this.code(e),t){const e=this.name("e");this._currNode=i.catch=new M(e),t(e)}return n&&(this._currNode=i.finally=new I,this.code(n)),this._endBlockNode(M,I)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=i.nil,n,s){return this._blockNode(new E(e,t,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=D;const L=k(t.operators.AND);t.and=function(...e){return e.reduce(L)};const N=k(t.operators.OR);function k(e){return(t,n)=>t===i.nil?n:n===i.nil?t:i._`${O(t)} ${e} ${O(n)}`}function O(e){return e instanceof i.Name?e:i._`(${e})`}t.or=function(...e){return e.reduce(N)}},32715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const i=n(6657);class s extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var r;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(r=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=o;class a extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=i._`.${new i.Name(t)}[${n}]`}}t.ValueScopeName=a;const l=i._`\n`;t.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:i.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const i=this.toName(e),{prefix:s}=i,r=null!==(n=t.key)&&void 0!==n?n:t.ref;let o=this._values[s];if(o){const e=o.get(r);if(e)return e}else o=this._values[s]=new Map;o.set(r,i);const a=this._scope[s]||(this._scope[s]=[]),l=a.length;return a[l]=t.ref,i.setValue(t,{property:s,itemIndex:l}),i}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return i._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,o={},a){let l=i.nil;for(const c in e){const h=e[c];if(!h)continue;const d=o[c]=o[c]||new Map;h.forEach((e=>{if(d.has(e))return;d.set(e,r.Started);let o=n(e);if(o){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;l=i._`${l}${n} ${e} = ${o};${this.opts._n}`}else{if(!(o=null==a?void 0:a(e)))throw new s(e);l=i._`${l}${o}${this.opts._n}`}d.set(e,r.Completed)}))}return l}}},16257:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const i=n(56110),s=n(20530),r=n(17748);function o(e,t){const n=e.const("err",t);e.if(i._`${r.default.vErrors} === null`,(()=>e.assign(r.default.vErrors,i._`[${n}]`)),i._`${r.default.vErrors}.push(${n})`),e.code(i._`${r.default.errors}++`)}function a(e,t){const{gen:n,validateName:s,schemaEnv:r}=e;r.$async?n.throw(i._`new ${e.ValidationError}(${t})`):(n.assign(i._`${s}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>i.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?i.str`"${e}" keyword must be ${t} ($data)`:i.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,s,r){const{it:l}=e,{gen:h,compositeRule:d,allErrors:u}=l,p=c(e,n,s);(null!=r?r:d||u)?o(h,p):a(l,i._`[${p}]`)},t.reportExtraError=function(e,n=t.keywordError,i){const{it:s}=e,{gen:l,compositeRule:h,allErrors:d}=s;o(l,c(e,n,i)),h||d||a(s,r.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(r.default.errors,t),e.if(i._`${r.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(i._`${r.default.vErrors}.length`,t)),(()=>e.assign(r.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:s,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",o,r.default.errors,(o=>{e.const(l,i._`${r.default.vErrors}[${o}]`),e.if(i._`${l}.instancePath === undefined`,(()=>e.assign(i._`${l}.instancePath`,(0,i.strConcat)(r.default.instancePath,a.errorPath)))),e.assign(i._`${l}.schemaPath`,i.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(i._`${l}.schema`,n),e.assign(i._`${l}.data`,s))}))};const l={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function c(e,t,n){const{createErrors:s}=e.it;return!1===s?i._`{}`:function(e,t,n={}){const{gen:s,it:o}=e,a=[h(o,n),d(e,n)];return function(e,{params:t,message:n},s){const{keyword:o,data:a,schemaValue:c,it:h}=e,{opts:d,propertyName:u,topSchemaRef:p,schemaPath:f}=h;s.push([l.keyword,o],[l.params,"function"==typeof t?t(e):t||i._`{}`]),d.messages&&s.push([l.message,"function"==typeof n?n(e):n]);d.verbose&&s.push([l.schema,c],[l.parentSchema,i._`${p}${f}`],[r.default.data,a]);u&&s.push([l.propertyName,u])}(e,t,a),s.object(...a)}(e,t,n)}function h({errorPath:e},{instancePath:t}){const n=t?i.str`${e}${(0,s.getErrorPath)(t,s.Type.Str)}`:e;return[r.default.instancePath,(0,i.strConcat)(r.default.instancePath,n)]}function d({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:i.str`${t}/${e}`;return n&&(o=i.str`${o}${(0,s.getErrorPath)(n,s.Type.Str)}`),[l.schemaPath,o]}},59336:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const i=n(56110),s=n(97939),r=n(17748),o=n(66184),a=n(20530),l=n(43750),c=n(55858);class h{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function d(e){const t=p.call(this,e);if(t)return t;const n=(0,o.getFullPath)(e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:h}=this.opts,d=new i.CodeGen(this.scope,{es5:a,lines:c,ownProperties:h});let u;e.$async&&(u=d.scopeValue("Error",{ref:s.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const f=d.scopeName("validate");e.validateName=f;const m={gen:d,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:d.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,i.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:i.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(m),d.optimize(this.opts.code.optimize);const t=d.toString();g=`${d.scopeRefs(r.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:f,validateCode:t,scopeValues:d._values}),this.opts.unevaluated){const{props:e,items:t}=m;n.evaluated={props:e instanceof i.Name?void 0:e,items:t instanceof i.Name?void 0:t,dynamicProps:e instanceof i.Name,dynamicItems:t instanceof i.Name},n.source&&(n.source.evaluated=(0,i.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function u(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:d.call(this,e)}function p(e){for(const i of this._compilations)if(n=e,(t=i).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return i;var t,n}function f(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){const n=c.parse(t),i=(0,o._getFullPath)(n);let s=(0,o.getFullPath)(e.baseId);if(Object.keys(e.schema).length>0&&i===s)return A.call(this,n,e);const r=(0,o.normalizeId)(i),a=this.refs[r]||this.schemas[r];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return A.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||d.call(this,a),r===(0,o.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,i=t[n];return i&&(s=(0,o.resolveUrl)(s,i)),new h({schema:t,schemaId:n,root:e,baseId:s})}return A.call(this,n,a)}}t.SchemaEnv=h,t.compileSchema=d,t.resolveRef=function(e,t,n){var i;n=(0,o.resolveUrl)(t,n);const s=e.refs[n];if(s)return s;let r=f.call(this,e,n);if(void 0===r){const s=null===(i=e.localRefs)||void 0===i?void 0:i[n],{schemaId:o}=this.opts;s&&(r=new h({schema:s,schemaId:o,root:e,baseId:t}))}return void 0!==r?e.refs[n]=u.call(this,r):void 0},t.getCompilingSchema=p,t.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function A(e,{baseId:t,schema:n,root:i}){var s;if("/"!==(null===(s=e.fragment)||void 0===s?void 0:s[0]))return;for(const i of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(i)];if(void 0===e)return;const s="object"==typeof(n=e)&&n[this.opts.schemaId];!g.has(i)&&s&&(t=(0,o.resolveUrl)(t,s))}let r;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,o.resolveUrl)(t,n.$ref);r=m.call(this,i,e)}const{schemaId:l}=this.opts;return r=r||new h({schema:n,schemaId:l,root:i,baseId:t}),r.schema!==r.root.schema?r:void 0}},17748:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};t.default=s},33482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(66184);class s extends Error{constructor(e,t,n){super(n||`can't resolve reference ${t} from id ${e}`),this.missingRef=(0,i.resolveUrl)(e,t),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(this.missingRef))}}t.default=s},66184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const i=n(20530),s=n(28926),r=n(68125),o=n(55858),a=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&h(e)<=t)};const l=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(l.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(c))return!0;if("object"==typeof n&&c(n))return!0}return!1}function h(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!a.has(n)&&("object"==typeof e[n]&&(0,i.eachItem)(e[n],(e=>t+=h(e))),t===1/0))return 1/0}return t}function d(e="",t){!1!==t&&(e=f(e));return u(o.parse(e))}function u(e){return o.serialize(e).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=u;const p=/#\/?$/;function f(e){return e?e.replace(p,""):""}t.normalizeId=f,t.resolveUrl=function(e,t){return t=f(t),o.resolve(e,t)};const m=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n}=this.opts,i=f(e[n]||t),a={"":i},l=d(i,!1),c={},h=new Set;return r(e,{allKeys:!0},((e,t,i,s)=>{if(void 0===s)return;const r=l+t;let d=a[s];function g(t){if(t=f(d?o.resolve(d,t):t),h.has(t))throw p(t);h.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==f(r)&&("#"===t[0]?(u(e,c[t],t),c[t]=e):this.refs[t]=r),t}function A(e){if("string"==typeof e){if(!m.test(e))throw new Error(`invalid anchor "${e}"`);g.call(this,`#${e}`)}}"string"==typeof e[n]&&(d=g.call(this,e[n])),A.call(this,e.$anchor),A.call(this,e.$dynamicAnchor),a[t]=d})),c;function u(e,t,n){if(void 0!==t&&!s(e,t))throw p(n)}function p(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},46754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},20530:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const i=n(56110),s=n(6657);function r(e,t=e.schema){const{opts:n,self:i}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const s=i.RULES.keywords;for(const n in t)s[n]||f(e,`unknown keyword: "${n}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:s}){return(r,o,a,l)=>{const c=void 0===a?o:a instanceof i.Name?(o instanceof i.Name?e(r,o,a):t(r,o,a),a):o instanceof i.Name?(t(r,a,o),o):n(o,a);return l!==i.Name||c instanceof i.Name?c:s(r,c)}}function h(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",i._`{}`);return void 0!==t&&d(e,n,t),n}function d(e,t,n){Object.keys(n).forEach((n=>e.assign(i._`${t}${(0,i.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!o(t,e.self.RULES.all))},t.checkUnknownRules=r,t.schemaHasRules=o,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,s,r){if(!r){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return i._`${n}`}return i._`${e}${t}${(0,i.getProperty)(s)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>{e.if(i._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,i._`${n} || {}`).code(i._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,i._`${n} || {}`),d(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:h}),items:c({mergeNames:(e,t,n)=>e.if(i._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,i._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(i._`${n} !== true`,(()=>e.assign(n,!0===t||i._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=h,t.setEvaluated=d;const u={};var p;function f(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:u[t.code]||(u[t.code]=new s._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(p=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof i.Name){const s=t===p.Num;return n?s?i._`"[" + ${e} + "]"`:i._`"['" + ${e} + "']"`:s?i._`"/" + ${e}`:i._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,i.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=f},87177:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>i(e,t)))}function i(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},i){const s=t.RULES.types[i];return s&&!0!==s&&n(e,s)},t.shouldUseGroup=n,t.shouldUseRule=i},42971:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const i=n(16257),s=n(56110),r=n(17748),o={message:"boolean schema is false"};function a(e,t){const{gen:n,data:s}=e,r={gen:n,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,i.reportError)(r,o,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:i}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(r.default.data):(t.assign(s._`${i}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:i}=e;!1===i?(n.var(t,!1),a(e)):n.var(t,!0)}},97349:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const i=n(46754),s=n(87177),r=n(16257),o=n(56110),a=n(20530);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:i,opts:r}=e,a=function(e,t){return t?e.filter((e=>h.has(e)||"array"===t&&"array"===e)):[]}(t,r.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,s.schemaHasRulesForType)(e,t[0]));if(c){const s=u(t,i,r.strictNumbers,l.Wrong);n.if(s,(()=>{a.length?function(e,t,n){const{gen:i,data:s,opts:r}=e,a=i.let("dataType",o._`typeof ${s}`),l=i.let("coerced",o._`undefined`);"array"===r.coerceTypes&&i.if(o._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,(()=>i.assign(s,o._`${s}[0]`).assign(a,o._`typeof ${s}`).if(u(t,s,r.strictNumbers),(()=>i.assign(l,s)))));i.if(o._`${l} !== undefined`);for(const e of n)(h.has(e)||"array"===e&&"array"===r.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void i.elseIf(o._`${a} == "number" || ${a} == "boolean"`).assign(l,o._`"" + ${s}`).elseIf(o._`${s} === null`).assign(l,o._`""`);case"number":return void i.elseIf(o._`${a} == "boolean" || ${s} === null + || (${a} == "string" && ${s} && ${s} == +${s})`).assign(l,o._`+${s}`);case"integer":return void i.elseIf(o._`${a} === "boolean" || ${s} === null + || (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(l,o._`+${s}`);case"boolean":return void i.elseIf(o._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(l,!1).elseIf(o._`${s} === "true" || ${s} === 1`).assign(l,!0);case"null":return i.elseIf(o._`${s} === "" || ${s} === 0 || ${s} === false`),void i.assign(l,null);case"array":i.elseIf(o._`${a} === "string" || ${a} === "number" + || ${a} === "boolean" || ${s} === null`).assign(l,o._`[${s}]`)}}i.else(),f(e),i.endIf(),i.if(o._`${l} !== undefined`,(()=>{i.assign(s,l),function({gen:e,parentData:t,parentDataProperty:n},i){e.if(o._`${t} !== undefined`,(()=>e.assign(o._`${t}[${n}]`,i)))}(e,l)}))}(e,t,a):f(e)}))}return c};const h=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,i=l.Correct){const s=i===l.Correct?o.operators.EQ:o.operators.NEQ;let r;switch(e){case"null":return o._`${t} ${s} null`;case"array":r=o._`Array.isArray(${t})`;break;case"object":r=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":r=a(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":r=a();break;default:return o._`typeof ${t} ${s} ${e}`}return i===l.Correct?r:(0,o.not)(r);function a(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,n?o._`isFinite(${t})`:o.nil)}}function u(e,t,n,i){if(1===e.length)return d(e[0],t,n,i);let s;const r=(0,a.toHash)(e);if(r.array&&r.object){const e=o._`typeof ${t} != "object"`;s=r.null?e:o._`!${t} || ${e}`,delete r.null,delete r.array,delete r.object}else s=o.nil;r.number&&delete r.integer;for(const e in r)s=(0,o.and)(s,d(e,t,n,i));return s}t.checkDataType=d,t.checkDataTypes=u;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function f(e){const t=function(e){const{gen:t,data:n,schema:i}=e,s=(0,a.schemaRefOrVal)(e,i,"type");return{gen:t,keyword:"type",data:n,schema:i.type,schemaCode:s,schemaValue:s,parentSchema:i,params:{},it:e}}(e);(0,r.reportError)(t,p)}t.reportTypeError=f},15944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const i=n(56110),s=n(20530);function r(e,t,n){const{gen:r,compositeRule:o,data:a,opts:l}=e;if(void 0===n)return;const c=i._`${a}${(0,i.getProperty)(t)}`;if(o)return void(0,s.checkStrictMode)(e,`default is ignored for: ${c}`);let h=i._`${c} === undefined`;"empty"===l.useDefaults&&(h=i._`${h} || ${c} === null || ${c} === ""`),r.if(h,i._`${c} = ${(0,i.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:i}=e.schema;if("object"===t&&n)for(const t in n)r(e,t,n[t].default);else"array"===t&&Array.isArray(i)&&i.forEach(((t,n)=>r(e,n,t.default)))}},43750:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const i=n(42971),s=n(97349),r=n(87177),o=n(97349),a=n(15944),l=n(42e3),c=n(35678),h=n(56110),d=n(17748),u=n(66184),p=n(20530),f=n(16257);function m({gen:e,validateName:t,schema:n,schemaEnv:i,opts:s},r){s.code.es5?e.func(t,h._`${d.default.data}, ${d.default.valCxt}`,i.$async,(()=>{e.code(h._`"use strict"; ${g(n,s)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,h._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,h._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,h._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,h._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,h._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,h._`""`),e.var(d.default.parentData,h._`undefined`),e.var(d.default.parentDataProperty,h._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,h._`{}`)}))}(e,s),e.code(r)})):e.func(t,h._`${d.default.data}, ${function(e){return h._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?h._`, ${d.default.dynamicAnchors}={}`:h.nil}}={}`}(s)}`,i.$async,(()=>e.code(g(n,s)).code(r)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?h._`/*# sourceURL=${n} */`:h.nil}function A(e,t){y(e)&&(b(e),v(e))?function(e,t){const{schema:n,gen:i,opts:s}=e;s.$comment&&n.$comment&&x(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const r=i.const("_errs",d.default.errors);_(e,r),i.var(t,h._`${r} === ${d.default.errors}`)}(e,t):(0,i.boolOrEmptySchema)(e,t)}function v({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function b(e){(0,p.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:i,self:s}=e;t.$ref&&i.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function _(e,t){if(e.opts.jtd)return w(e,[],!1,t);const n=(0,s.getSchemaTypes)(e.schema);w(e,n,!(0,s.coerceAndCheckDataType)(e,n),t)}function x({gen:e,schemaEnv:t,schema:n,errSchemaPath:i,opts:s}){const r=n.$comment;if(!0===s.$comment)e.code(h._`${d.default.self}.logger.log(${r})`);else if("function"==typeof s.$comment){const n=h.str`${i}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code(h._`${d.default.self}.opts.$comment(${r}, ${n}, ${s}.schema)`)}}function w(e,t,n,i){const{gen:s,schema:a,data:l,allErrors:c,opts:u,self:f}=e,{RULES:m}=f;function g(p){(0,r.shouldUseGroup)(a,p)&&(p.type?(s.if((0,o.checkDataType)(p.type,l,u.strictNumbers)),E(e,p),1===t.length&&t[0]===p.type&&n&&(s.else(),(0,o.reportTypeError)(e)),s.endIf()):E(e,p),c||s.if(h._`${d.default.errors} === ${i||0}`))}!a.$ref||!u.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(a,m)?(u.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{S(e.dataTypes,t)||M(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),e.dataTypes=e.dataTypes.filter((e=>S(t,e)))})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&M(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const n=e.self.RULES.all;for(const i in n){const s=n[i];if("object"==typeof s&&(0,r.shouldUseRule)(e.schema,s)){const{type:n}=s.definition;n.length&&!n.some((e=>C(t,e)))&&M(e,`missing type "${n.join(",")}" for keyword "${i}"`)}}}(e,e.dataTypes)}(e,t),s.block((()=>{for(const e of m.rules)g(e);g(m.post)}))):s.block((()=>T(e,"$ref",m.all.$ref.definition)))}function E(e,t){const{gen:n,schema:i,opts:{useDefaults:s}}=e;s&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,r.shouldUseRule)(i,n)&&T(e,n.keyword,n.definition,t.type)}))}function C(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function S(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function M(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){y(e)&&(b(e),v(e))?function(e){const{schema:t,opts:n,gen:i}=e;m(e,(()=>{n.$comment&&t.$comment&&x(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),i.let(d.default.vErrors,null),i.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",h._`${n}.evaluated`),t.if(h._`${e.evaluated}.dynamicProps`,(()=>t.assign(h._`${e.evaluated}.props`,h._`undefined`))),t.if(h._`${e.evaluated}.dynamicItems`,(()=>t.assign(h._`${e.evaluated}.items`,h._`undefined`)))}(e),_(e),function(e){const{gen:t,schemaEnv:n,validateName:i,ValidationError:s,opts:r}=e;n.$async?t.if(h._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(h._`new ${s}(${d.default.vErrors})`))):(t.assign(h._`${i}.errors`,d.default.vErrors),r.unevaluated&&function({gen:e,evaluated:t,props:n,items:i}){n instanceof h.Name&&e.assign(h._`${t}.props`,n);i instanceof h.Name&&e.assign(h._`${t}.items`,i)}(e),t.return(h._`${d.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,i.topBoolOrEmptySchema)(e)))};class I{constructor(e,t,n){if((0,l.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",R(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,n){this.failResult((0,h.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,h.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(h._`${t} !== undefined && (${(0,h.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=h.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=h.nil,t=h.nil){if(!this.$data)return;const{gen:n,schemaCode:i,schemaType:s,def:r}=this;n.if((0,h.or)(h._`${i} === undefined`,t)),e!==h.nil&&n.assign(e,!0),(s.length||r.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==h.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:i,it:s}=this;return(0,h.or)(function(){if(n.length){if(!(t instanceof h.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return h._`${(0,o.checkDataTypes)(e,t,s.opts.strictNumbers,o.DataType.Wrong)}`}return h.nil}(),function(){if(i.validateSchema){const n=e.scopeValue("validate$data",{ref:i.validateSchema});return h._`!${n}(${t})`}return h.nil}())}subschema(e,t){const n=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(n,this.it,e),(0,c.extendSubschemaMode)(n,e);const i={...this.it,...n,items:void 0,props:void 0};return A(i,t),i}mergeEvaluated(e,t){const{it:n,gen:i}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=p.mergeEvaluated.props(i,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=p.mergeEvaluated.items(i,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:i}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return i.if(t,(()=>this.mergeEvaluated(e,h.Name))),!0}}function T(e,t,n,i){const s=new I(e,n,t);"code"in n?n.code(s,i):s.$data&&n.validate?(0,l.funcKeywordCode)(s,n):"macro"in n?(0,l.macroKeywordCode)(s,n):(n.compile||n.validate)&&(0,l.funcKeywordCode)(s,n)}t.KeywordCxt=I;const P=/^\/(?:[^~]|~0|~1)*$/,B=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function R(e,{dataLevel:t,dataNames:n,dataPathArr:i}){let s,r;if(""===e)return d.default.rootData;if("/"===e[0]){if(!P.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,r=d.default.rootData}else{const o=B.exec(e);if(!o)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+o[1];if(s=o[2],"#"===s){if(a>=t)throw new Error(l("property/index",a));return i[t-a]}if(a>t)throw new Error(l("data",a));if(r=n[t-a],!s)return r}let o=r;const a=s.split("/");for(const e of a)e&&(r=h._`${r}${(0,h.getProperty)((0,p.unescapeJsonPointer)(e))}`,o=h._`${o} && ${r}`);return o;function l(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=R},42e3:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const i=n(56110),s=n(17748),r=n(57111),o=n(16257);function a(e){const{gen:t,data:n,it:s}=e;t.if(s.parentData,(()=>t.assign(n,i._`${s.parentData}[${s.parentDataProperty}]`)))}function l(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,i.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:s,schema:r,parentSchema:o,it:a}=e,c=t.macro.call(a.self,r,o,a),h=l(n,s,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const d=n.name("valid");e.subschema({schema:c,schemaPath:i.nil,errSchemaPath:`${a.errSchemaPath}/${s}`,topSchemaRef:h,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:c,keyword:h,schema:d,parentSchema:u,$data:p,it:f}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(f,t);const m=!p&&t.compile?t.compile.call(f.self,d,u,f):t.validate,g=l(c,h,m),A=c.let("valid");function v(n=(t.async?i._`await `:i.nil)){const o=f.opts.passContext?s.default.this:s.default.self,a=!("compile"in t&&!p||!1===t.schema);c.assign(A,i._`${n}${(0,r.callValidateCode)(e,g,o,a)}`,t.modifying)}function y(e){var n;c.if((0,i.not)(null!==(n=t.valid)&&void 0!==n?n:A),e)}e.block$data(A,(function(){if(!1===t.errors)v(),t.modifying&&a(e),y((()=>e.error()));else{const n=t.async?function(){const e=c.let("ruleErrs",null);return c.try((()=>v(i._`await `)),(t=>c.assign(A,!1).if(i._`${t} instanceof ${f.ValidationError}`,(()=>c.assign(e,i._`${t}.errors`)),(()=>c.throw(t))))),e}():function(){const e=i._`${g}.errors`;return c.assign(e,null),v(i.nil),e}();t.modifying&&a(e),y((()=>function(e,t){const{gen:n}=e;n.if(i._`Array.isArray(${t})`,(()=>{n.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,i._`${s.default.vErrors}.length`),(0,o.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:A)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:i},s,r){if(Array.isArray(s.keyword)?!s.keyword.includes(r):s.keyword!==r)throw new Error("ajv implementation error");const o=s.dependencies;if(null==o?void 0:o.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${r}: ${o.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[r])){const e=`keyword "${r}" value is invalid at path "${i}": `+n.errorsText(s.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}}},35678:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const i=n(56110),s=n(20530);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:r,schemaPath:o,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==r)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const r=e.schema[t];return void 0===n?{schema:r,schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:r[n],schemaPath:i._`${e.schemaPath}${(0,i.getProperty)(t)}${(0,i.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,s.escapeFragment)(n)}`}}if(void 0!==r){if(void 0===o||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:r,data:o,dataTypes:a,propertyName:l}){if(void 0!==o&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==n){const{errorPath:o,dataPathArr:a,opts:l}=t;h(c.let("data",i._`${t.data}${(0,i.getProperty)(n)}`,!0)),e.errorPath=i.str`${o}${(0,s.getErrorPath)(n,r,l.jsPropertySyntax)}`,e.parentDataProperty=i._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}if(void 0!==o){h(o instanceof i.Name?o:c.let("data",o,!0)),void 0!==l&&(e.propertyName=l)}function h(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:i,createErrors:s,allErrors:r}){void 0!==i&&(e.compositeRule=i),void 0!==s&&(e.createErrors=s),void 0!==r&&(e.allErrors=r),e.jtdDiscriminator=t,e.jtdMetadata=n}},72206:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var i=n(43750);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return i.KeywordCxt}});var s=n(56110);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});const r=n(97939),o=n(33482),a=n(46754),l=n(59336),c=n(56110),h=n(66184),d=n(97349),u=n(20530),p=n(338),f=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},A={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,n,i,s,r,o,a,l,c,h,d,u,p,f,m,g,A,v,y,b,_,x;const w=e.strict,E=null===(t=e.code)||void 0===t?void 0:t.optimize,C=!0===E||void 0===E?1:E||0;return{strictSchema:null===(i=null!==(n=e.strictSchema)&&void 0!==n?n:w)||void 0===i||i,strictNumbers:null===(r=null!==(s=e.strictNumbers)&&void 0!==s?s:w)||void 0===r||r,strictTypes:null!==(a=null!==(o=e.strictTypes)&&void 0!==o?o:w)&&void 0!==a?a:"log",strictTuples:null!==(c=null!==(l=e.strictTuples)&&void 0!==l?l:w)&&void 0!==c?c:"log",strictRequired:null!==(d=null!==(h=e.strictRequired)&&void 0!==h?h:w)&&void 0!==d&&d,code:e.code?{...e.code,optimize:C}:{optimize:C},loopRequired:null!==(u=e.loopRequired)&&void 0!==u?u:200,loopEnum:null!==(p=e.loopEnum)&&void 0!==p?p:200,meta:null===(f=e.meta)||void 0===f||f,messages:null===(m=e.messages)||void 0===m||m,inlineRefs:null===(g=e.inlineRefs)||void 0===g||g,schemaId:null!==(A=e.schemaId)&&void 0!==A?A:"$id",addUsedSchema:null===(v=e.addUsedSchema)||void 0===v||v,validateSchema:null===(y=e.validateSchema)||void 0===y||y,validateFormats:null===(b=e.validateFormats)||void 0===b||b,unicodeRegExp:null===(_=e.unicodeRegExp)||void 0===_||_,int32range:null===(x=e.int32range)||void 0===x||x}}class y{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:m,es5:t,lines:n}),this.logger=function(e){if(!1===e)return S;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,g,e,"NOT SUPPORTED"),b.call(this,A,e,"DEPRECATED","warn"),this._metaOpts=C.call(this),e.formats&&w.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&E.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),x.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let i=p;"id"===n&&(i={...p},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const i=n(t);return"$async"in n||(this.errors=n.errors),i}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return i.call(this,e,t);async function i(e,t){await s.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||r.call(this,n)}async function s(e){e&&!this.getSchema(e)&&await i.call(this,{$ref:e},!0)}async function r(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),r.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const n=await c.call(this,e);this.refs[e]||await s.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function c(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,i);return this}let s;if("object"==typeof e){const{schemaId:t}=this.opts;if(s=e[t],void 0!==s&&"string"!=typeof s)throw new Error(`schema ${t} must be string`)}return t=(0,h.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,i,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const i=this.validate(n,e);if(!i&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return i}getSchema(e){let t;for(;"string"==typeof(t=_.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,i=new l.SchemaEnv({schema:{},schemaId:n});if(t=l.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=_.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,h.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(I.call(this,n,t),!t)return(0,u.eachItem)(n,(e=>T.call(this,e))),this;B.call(this,t);const i={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(n,0===i.type.length?e=>T.call(this,e,i):e=>i.type.forEach((t=>T.call(this,e,i,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const i of t){const t=i.split("/").slice(1);let s=e;for(const e of t)s=s[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:i}=t.definition,r=s[e];i&&r&&(s[e]=D(r))}}return e}_removeAllSchemas(e,t){for(const n in e){const i=e[n];t&&!t.test(n)||("string"==typeof i?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,t,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let r;const{schemaId:o}=this.opts;if("object"==typeof e)r=e[o];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,h.normalizeId)(r||n);const c=h.getSchemaRefs.call(this,e,n);return a=new l.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:c}),this._cache.set(a.schema,a),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),i&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function b(e,t,n,i="error"){for(const s in e){const r=s;r in t&&this.logger[i](`${n}: option ${s}. ${e[r]}`)}}function _(e){return e=(0,h.normalizeId)(e),this.schemas[e]||this.refs[e]}function x(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function w(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function E(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function C(){const e={...this.opts};for(const t of f)delete e[t];return e}t.default=y,y.ValidationError=r.default,y.MissingRefError=o.default;const S={log(){},warn(){},error(){}};const M=/^[a-z_$][a-z0-9_$:-]*$/i;function I(e,t){const{RULES:n}=this;if((0,u.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!M.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function T(e,t,n){var i;const s=null==t?void 0:t.post;if(n&&s)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:r}=this;let o=s?r.post:r.rules.find((({type:e})=>e===n));if(o||(o={type:n,rules:[]},r.rules.push(o)),r.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?P.call(this,o,a,t.before):o.rules.push(a),r.all[e]=a,null===(i=t.implements)||void 0===i||i.forEach((e=>this.addKeyword(e)))}function P(e,t,n){const i=e.rules.findIndex((e=>e.keyword===n));i>=0?e.rules.splice(i,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function B(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=D(t)),e.validateSchema=this.compile(t,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function D(e){return{anyOf:[e,R]}}},18062:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(28926);i.code='require("ajv/dist/runtime/equal").default',t.default=i},75842:(e,t)=>{"use strict";function n(e){const t=e.length;let n,i=0,s=0;for(;s=55296&&n<=56319&&s{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},81600:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const i=n(56110),s=n(20530),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:i}=t;Array.isArray(i)?o(e,i):(0,s.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function o(e,t){const{gen:n,schema:r,data:o,keyword:a,it:l}=e;l.items=!0;const c=n.const("len",i._`${o}.length`);if(!1===r)e.setParams({len:t.length}),e.pass(i._`${c} <= ${t.length}`);else if("object"==typeof r&&!(0,s.alwaysValidSchema)(l,r)){const r=n.var("valid",i._`${c} <= ${t.length}`);n.if((0,i.not)(r),(()=>function(r){n.forRange("i",t.length,c,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:s.Type.Num},r),l.allErrors||n.if((0,i.not)(r),(()=>n.break()))}))}(r))),e.ok(r)}}t.validateAdditionalItems=o,t.default=r},88183:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r=n(17748),o=n(20530),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>s._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:l,errsCount:c,it:h}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:d,opts:u}=h;if(h.props=!0,"all"!==u.removeAdditional&&(0,o.alwaysValidSchema)(h,n))return;const p=(0,i.allSchemaProperties)(a.properties),f=(0,i.allSchemaProperties)(a.patternProperties);function m(e){t.code(s._`delete ${l}[${e}]`)}function g(i){if("all"===u.removeAdditional||u.removeAdditional&&!1===n)m(i);else{if(!1===n)return e.setParams({additionalProperty:i}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,o.alwaysValidSchema)(h,n)){const n=t.name("valid");"failing"===u.removeAdditional?(A(i,n,!1),t.if((0,s.not)(n),(()=>{e.reset(),m(i)}))):(A(i,n),d||t.if((0,s.not)(n),(()=>t.break())))}}}function A(t,n,i){const s={keyword:"additionalProperties",dataProp:t,dataPropType:o.Type.Str};!1===i&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(s,n)}t.forIn("key",l,(n=>{p.length||f.length?t.if(function(n){let r;if(p.length>8){const e=(0,o.schemaRefOrVal)(h,a.properties,"properties");r=(0,i.isOwnProperty)(t,e,n)}else r=p.length?(0,s.or)(...p.map((e=>s._`${n} === ${e}`))):s.nil;return f.length&&(r=(0,s.or)(r,...f.map((t=>s._`${(0,i.usePattern)(e,t)}.test(${n})`)))),(0,s.not)(r)}(n),(()=>g(n))):g(n)})),e.ok(s._`${c} === ${r.default.errors}`)}};t.default=a},68302:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20530),s={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const r=t.name("valid");n.forEach(((t,n)=>{if((0,i.alwaysValidSchema)(s,t))return;const o=e.subschema({keyword:"allOf",schemaProp:n},r);e.ok(r),e.mergeEvaluated(o)}))}};t.default=s},50120:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(57111).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=i},97458:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?i.str`must contain at least ${e} valid item(s)`:i.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?i._`{minContains: ${e}}`:i._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:a}=e;let l,c;const{minContains:h,maxContains:d}=r;a.opts.next?(l=void 0===h?1:h,c=d):l=1;const u=t.const("len",i._`${o}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,s.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,s.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,s.alwaysValidSchema)(a,n)){let t=i._`${u} >= ${l}`;return void 0!==c&&(t=i._`${t} && ${u} <= ${c}`),void e.pass(t)}a.items=!0;const p=t.name("valid");function f(){const e=t.name("_valid"),n=t.let("count",0);m(e,(()=>t.if(e,(()=>function(e){t.code(i._`${e}++`),void 0===c?t.if(i._`${e} >= ${l}`,(()=>t.assign(p,!0).break())):(t.if(i._`${e} > ${c}`,(()=>t.assign(p,!1).break())),1===l?t.assign(p,!0):t.if(i._`${e} >= ${l}`,(()=>t.assign(p,!0))))}(n)))))}function m(n,i){t.forRange("i",0,u,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:s.Type.Num,compositeRule:!0},n),i()}))}void 0===c&&1===l?m(p,(()=>t.if(p,(()=>t.break())))):(t.let(p,!1),0===l?t.if(i._`${o}.length > 0`,f,(()=>t.assign(p,!0))):f()),e.result(p,(()=>e.reset()))}};t.default=r},32790:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const i=n(56110),s=n(20530),r=n(57111);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const s=1===t?"property":"properties";return i.str`must have ${s} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:s}})=>i._`{property: ${e}, + missingProperty: ${s}, + depsCount: ${t}, + deps: ${n}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const i in e){if("__proto__"===i)continue;(Array.isArray(e[i])?t:n)[i]=e[i]}return[t,n]}(e);a(e,t),l(e,n)}};function a(e,t=e.schema){const{gen:n,data:s,it:o}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const h=(0,r.propertyInData)(n,s,l,o.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),o.allErrors?n.if(h,(()=>{for(const t of c)(0,r.checkReportMissingProp)(e,t)})):(n.if(i._`${h} && (${(0,r.checkMissingProp)(e,c,a)})`),(0,r.reportMissingProp)(e,a),n.else())}}function l(e,t=e.schema){const{gen:n,data:i,keyword:o,it:a}=e,l=n.name("valid");for(const c in t)(0,s.alwaysValidSchema)(a,t[c])||(n.if((0,r.propertyInData)(n,i,c,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:o,schemaProp:c},l);e.mergeValidEvaluated(t,l)}),(()=>n.var(l,!0))),e.ok(l))}t.validatePropertyDeps=a,t.validateSchemaDeps=l,t.default=o},17498:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>i.str`must match "${e.ifClause}" schema`,params:({params:e})=>i._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:r}=e;void 0===n.then&&void 0===n.else&&(0,s.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const a=o(r,"then"),l=o(r,"else");if(!a&&!l)return;const c=t.let("valid",!0),h=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);e.mergeEvaluated(t)}(),e.reset(),a&&l){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(h,d("then",n),d("else",n))}else a?t.if(h,d("then")):t.if((0,i.not)(h),d("else"));function d(n,s){return()=>{const r=e.subschema({keyword:n},h);t.assign(c,h),e.mergeValidEvaluated(r,c),s?t.assign(s,i._`${n}`):e.setParams({ifClause:n})}}e.pass(c,(()=>e.error(!0)))}};function o(e,t){const n=e.schema[t];return void 0!==n&&!(0,s.alwaysValidSchema)(e,n)}t.default=r},3698:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(81600),s=n(53609),r=n(38223),o=n(62490),a=n(97458),l=n(32790),c=n(13796),h=n(88183),d=n(11935),u=n(98289),p=n(62514),f=n(50120),m=n(16328),g=n(68302),A=n(17498),v=n(96105);t.default=function(e=!1){const t=[p.default,f.default,m.default,g.default,A.default,v.default,c.default,h.default,l.default,d.default,u.default];return e?t.push(s.default,o.default):t.push(i.default,r.default),t.push(a.default),t}},38223:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const i=n(56110),s=n(20530),r=n(57111),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,s.alwaysValidSchema)(n,t)||e.ok((0,r.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:r,parentSchema:o,data:a,keyword:l,it:c}=e;!function(e){const{opts:i,errSchemaPath:r}=c,o=n.length,a=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(i.strictTuples&&!a){const e=`"${l}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${r}"`;(0,s.checkStrictMode)(c,e,i.strictTuples)}}(o),c.opts.unevaluated&&n.length&&!0!==c.items&&(c.items=s.mergeEvaluated.items(r,n.length,c.items));const h=r.name("valid"),d=r.const("len",i._`${a}.length`);n.forEach(((t,n)=>{(0,s.alwaysValidSchema)(c,t)||(r.if(i._`${d} > ${n}`,(()=>e.subschema({keyword:l,schemaProp:n,dataProp:n},h))),e.ok(h))}))}t.validateTuple=a,t.default=o},62490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(57111),o=n(81600),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>i.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:i}=e,{prefixItems:a}=n;i.items=!0,(0,s.alwaysValidSchema)(i,t)||(a?(0,o.validateAdditionalItems)(e,a):e.ok((0,r.validateArray)(e)))}};t.default=a},62514:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20530),s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:s}=e;if((0,i.alwaysValidSchema)(s,n))return void e.fail();const r=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),e.failResult(r,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=s},16328:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>i._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;const a=n,l=t.let("valid",!1),c=t.let("passing",null),h=t.name("_valid");e.setParams({passing:c}),t.block((function(){a.forEach(((n,r)=>{let a;(0,s.alwaysValidSchema)(o,n)?t.var(h,!0):a=e.subschema({keyword:"oneOf",schemaProp:r,compositeRule:!0},h),r>0&&t.if(i._`${h} && ${l}`).assign(l,!1).assign(c,i._`[${c}, ${r}]`).else(),t.if(h,(()=>{t.assign(l,!0),t.assign(c,r),a&&e.mergeEvaluated(a,i.Name)}))}))})),e.result(l,(()=>e.reset()),(()=>e.error(!0)))}};t.default=r},98289:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r=n(20530),o=n(20530),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:l,it:c}=e,{opts:h}=c,d=(0,i.allSchemaProperties)(n),u=d.filter((e=>(0,r.alwaysValidSchema)(c,n[e])));if(0===d.length||u.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;const p=h.strictSchema&&!h.allowMatchingProperties&&l.properties,f=t.name("valid");!0===c.props||c.props instanceof s.Name||(c.props=(0,o.evaluatedPropsToName)(t,c.props));const{props:m}=c;function g(e){for(const t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function A(n){t.forIn("key",a,(r=>{t.if(s._`${(0,i.usePattern)(e,n)}.test(${r})`,(()=>{const i=u.includes(n);i||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:r,dataPropType:o.Type.Str},f),c.opts.unevaluated&&!0!==m?t.assign(s._`${m}[${r}]`,!0):i||c.allErrors||t.if((0,s.not)(f),(()=>t.break()))}))}))}!function(){for(const e of d)p&&g(e),c.allErrors?A(e):(t.var(f,!0),A(e),t.if(f))}()}};t.default=a},53609:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(38223),s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,i.validateTuple)(e,"items")};t.default=s},11935:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(43750),s=n(57111),r=n(20530),o=n(88183),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===a.additionalProperties&&o.default.code(new i.KeywordCxt(c,o.default,"additionalProperties"));const h=(0,s.allSchemaProperties)(n);for(const e of h)c.definedProperties.add(e);c.opts.unevaluated&&h.length&&!0!==c.props&&(c.props=r.mergeEvaluated.props(t,(0,r.toHash)(h),c.props));const d=h.filter((e=>!(0,r.alwaysValidSchema)(c,n[e])));if(0===d.length)return;const u=t.name("valid");for(const n of d)p(n)?f(n):(t.if((0,s.propertyInData)(t,l,n,c.opts.ownProperties)),f(n),c.allErrors||t.else().var(u,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(u);function p(e){return c.opts.useDefaults&&!c.compositeRule&&void 0!==n[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},u)}}};t.default=a},13796:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>i._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:r,it:o}=e;if((0,s.alwaysValidSchema)(o,n))return;const a=t.name("valid");t.forIn("key",r,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,i.not)(a),(()=>{e.error(!0),o.allErrors||t.break()}))})),e.ok(a)}};t.default=r},96105:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20530),s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,i.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=s},57111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const i=n(56110),s=n(20530),r=n(17748);function o(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:i._`Object.prototype.hasOwnProperty`})}function a(e,t,n){return i._`${o(e)}.call(${t}, ${n})`}function l(e,t,n,s){const r=i._`${t}${(0,i.getProperty)(n)} === undefined`;return s?(0,i.or)(r,(0,i.not)(a(e,t,n))):r}function c(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:s,it:r}=e;n.if(l(n,s,t,r.opts.ownProperties),(()=>{e.setParams({missingProperty:i._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},s,r){return(0,i.or)(...s.map((s=>(0,i.and)(l(e,t,s,n.ownProperties),i._`${r} = ${s}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=o,t.isOwnProperty=a,t.propertyInData=function(e,t,n,s){const r=i._`${t}${(0,i.getProperty)(n)} !== undefined`;return s?i._`${r} && ${a(e,t,n)}`:r},t.noPropertyInData=l,t.allSchemaProperties=c,t.schemaProperties=function(e,t){return c(t).filter((n=>!(0,s.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:s,schemaPath:o,errorPath:a},it:l},c,h,d){const u=d?i._`${e}, ${t}, ${s}${o}`:t,p=[[r.default.instancePath,(0,i.strConcat)(r.default.instancePath,a)],[r.default.parentData,l.parentData],[r.default.parentDataProperty,l.parentDataProperty],[r.default.rootData,r.default.rootData]];l.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const f=i._`${u}, ${n.object(...p)}`;return h!==i.nil?i._`${c}.call(${h}, ${f})`:i._`${c}(${f})`},t.usePattern=function({gen:e,it:{opts:t}},n){const s=t.unicodeRegExp?"u":"";return e.scopeValue("pattern",{key:n,ref:new RegExp(n,s),code:i._`new RegExp(${n}, ${s})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:r,it:o}=e,a=t.name("valid");if(o.allErrors){const e=t.let("valid",!0);return l((()=>t.assign(e,!1))),e}return t.var(a,!0),l((()=>t.break())),a;function l(o){const l=t.const("len",i._`${n}.length`);t.forRange("i",0,l,(n=>{e.subschema({keyword:r,dataProp:n,dataPropType:s.Type.Num},a),t.if((0,i.not)(a),o)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,s.alwaysValidSchema)(o,e)))&&!o.opts.unevaluated)return;const a=t.let("valid",!1),l=t.name("_valid");t.block((()=>n.forEach(((n,s)=>{const o=e.subschema({keyword:r,schemaProp:s,compositeRule:!0},l);t.assign(a,i._`${a} || ${l}`);e.mergeValidEvaluated(o,l)||t.if((0,i.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},84874:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},59730:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(84874),s=n(45403),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",i.default,s.default];t.default=r},45403:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const i=n(33482),s=n(57111),r=n(56110),o=n(17748),a=n(59336),l=n(20530),c={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:s}=e,{baseId:o,schemaEnv:l,validateName:c,opts:u,self:p}=s,{root:f}=l;if(("#"===n||"#/"===n)&&o===f.baseId)return function(){if(l===f)return d(e,c,l,l.$async);const n=t.scopeValue("root",{ref:f});return d(e,r._`${n}.validate`,f,f.$async)}();const m=a.resolveRef.call(p,f,o,n);if(void 0===m)throw new i.default(o,n);return m instanceof a.SchemaEnv?function(t){const n=h(e,t);d(e,n,t,t.$async)}(m):function(i){const s=t.scopeValue("schema",!0===u.code.source?{ref:i,code:(0,r.stringify)(i)}:{ref:i}),o=t.name("valid"),a=e.subschema({schema:i,dataTypes:[],schemaPath:r.nil,topSchemaRef:s,errSchemaPath:n},o);e.mergeEvaluated(a),e.ok(o)}(m)}};function h(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):r._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,i){const{gen:a,it:c}=e,{allErrors:h,schemaEnv:d,opts:u}=c,p=u.passContext?o.default.this:r.nil;function f(e){const t=r._`${e}.errors`;a.assign(o.default.vErrors,r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`),a.assign(o.default.errors,r._`${o.default.vErrors}.length`)}function m(e){var t;if(!c.opts.unevaluated)return;const i=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==c.props)if(i&&!i.dynamicProps)void 0!==i.props&&(c.props=l.mergeEvaluated.props(a,i.props,c.props));else{const t=a.var("props",r._`${e}.evaluated.props`);c.props=l.mergeEvaluated.props(a,t,c.props,r.Name)}if(!0!==c.items)if(i&&!i.dynamicItems)void 0!==i.items&&(c.items=l.mergeEvaluated.items(a,i.items,c.items));else{const t=a.var("items",r._`${e}.evaluated.items`);c.items=l.mergeEvaluated.items(a,t,c.items,r.Name)}}i?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(r._`await ${(0,s.callValidateCode)(e,t,p)}`),m(t),h||a.assign(n,!0)}),(e=>{a.if(r._`!(${e} instanceof ${c.ValidationError})`,(()=>a.throw(e))),f(e),h||a.assign(n,!1)})),e.ok(n)}():e.result((0,s.callValidateCode)(e,t,p),(()=>m(t)),(()=>f(t)))}t.getValidate=h,t.callRef=d,t.default=c},73348:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(2997),r={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>i._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:r,parentSchema:o,it:a}=e,{oneOf:l}=o;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");const c=r.propertyName;if("string"!=typeof c)throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");const h=t.let("valid",!1),d=t.const("tag",i._`${n}${(0,i.getProperty)(c)}`);function u(n){const s=t.name("valid"),r=e.subschema({keyword:"oneOf",schemaProp:n},s);return e.mergeEvaluated(r,i.Name),s}t.if(i._`typeof ${d} == "string"`,(()=>function(){const n=function(){var e;const t={},n=s(o);let i=!0;for(let t=0;te.error(!1,{discrError:s.DiscrError.Tag,tag:d,tagName:c}))),e.ok(h)}};t.default=r},2997:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))},610:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(59730),s=n(86020),r=n(3698),o=n(45036),a=n(99275),l=[i.default,s.default,(0,r.default)(),o.default,a.metadataVocabulary,a.contentVocabulary];t.default=l},88997:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>i.str`must match format "${e}"`,params:({schemaCode:e})=>i._`{format: ${e}}`},code(e,t){const{gen:n,data:s,$data:r,schema:o,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:h,schemaEnv:d,self:u}=l;c.validateFormats&&(r?function(){const r=n.scopeValue("formats",{ref:u.formats,code:c.code.formats}),o=n.const("fDef",i._`${r}[${a}]`),l=n.let("fType"),h=n.let("format");n.if(i._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>n.assign(l,i._`${o}.type || "string"`).assign(h,i._`${o}.validate`)),(()=>n.assign(l,i._`"string"`).assign(h,o))),e.fail$data((0,i.or)(!1===c.strictSchema?i.nil:i._`${a} && !${h}`,function(){const e=d.$async?i._`(${o}.async ? await ${h}(${s}) : ${h}(${s}))`:i._`${h}(${s})`,n=i._`(typeof ${h} == "function" ? ${e} : ${h}.test(${s}))`;return i._`${h} && ${h} !== true && ${l} === ${t} && !${n}`}()))}():function(){const r=u.formats[o];if(!r)return void function(){if(!1===c.strictSchema)return void u.logger.warn(e());throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${h}"`}}();if(!0===r)return;const[a,l,p]=function(e){const t=e instanceof RegExp?(0,i.regexpCode)(e):c.code.formats?i._`${c.code.formats}${(0,i.getProperty)(o)}`:void 0,s=n.scopeValue("formats",{key:o,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,i._`${s}.validate`];return["string",e,s]}(r);a===t&&e.pass(function(){if("object"==typeof r&&!(r instanceof RegExp)&&r.async){if(!d.$async)throw new Error("async format in sync schema");return i._`await ${p}(${s})`}return"function"==typeof l?i._`${p}(${s})`:i._`${p}.test(${s})`}())}())}};t.default=s},45036:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=[n(88997).default];t.default=i},99275:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},33103:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(18062),o={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>i._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:o,schemaCode:a,schema:l}=e;o||l&&"object"==typeof l?e.fail$data(i._`!${(0,s.useFunc)(t,r.default)}(${n}, ${a})`):e.fail(i._`${l} !== ${n}`)}};t.default=o},13139:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(18062),o={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>i._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:o,schema:a,schemaCode:l,it:c}=e;if(!o&&0===a.length)throw new Error("enum must have non-empty array");const h=a.length>=c.opts.loopEnum,d=(0,s.useFunc)(t,r.default);let u;if(h||o)u=t.let("valid"),e.block$data(u,(function(){t.assign(u,!1),t.forOf("v",l,(e=>t.if(i._`${d}(${n}, ${e})`,(()=>t.assign(u,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",l);u=(0,i.or)(...a.map(((t,s)=>function(e,t){const s=a[t];return"object"==typeof s&&null!==s?i._`${d}(${n}, ${e}[${t}])`:i._`${n} === ${s}`}(e,s))))}e.pass(u)}};t.default=o},86020:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(20897),s=n(75162),r=n(74905),o=n(22508),a=n(10082),l=n(86846),c=n(57569),h=n(55640),d=n(33103),u=n(13139),p=[i.default,s.default,r.default,o.default,a.default,l.default,c.default,h.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,u.default];t.default=p},57569:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return i.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>i._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s}=e,r="maxItems"===t?i.operators.GT:i.operators.LT;e.fail$data(i._`${n}.length ${r} ${s}`)}};t.default=s},74905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=n(20530),r=n(75842),o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return i.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>i._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:o,it:a}=e,l="maxLength"===t?i.operators.GT:i.operators.LT,c=!1===a.opts.unicode?i._`${n}.length`:i._`${(0,s.useFunc)(e.gen,r.default)}(${n})`;e.fail$data(i._`${c} ${l} ${o}`)}};t.default=o},20897:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s=i.operators,r={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},o={message:({keyword:e,schemaCode:t})=>i.str`must be ${r[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>i._`{comparison: ${r[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:o,code(e){const{keyword:t,data:n,schemaCode:s}=e;e.fail$data(i._`${n} ${r[t].fail} ${s} || isNaN(${n})`)}};t.default=a},10082:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return i.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>i._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s}=e,r="maxProperties"===t?i.operators.GT:i.operators.LT;e.fail$data(i._`Object.keys(${n}).length ${r} ${s}`)}};t.default=s},75162:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(56110),s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>i.str`must be multiple of ${e}`,params:({schemaCode:e})=>i._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:s,it:r}=e,o=r.opts.multipleOfPrecision,a=t.let("res"),l=o?i._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:i._`${a} !== parseInt(${a})`;e.fail$data(i._`(${s} === 0 || (${a} = ${n}/${s}, ${l}))`)}};t.default=s},22508:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>s.str`must match pattern "${e}"`,params:({schemaCode:e})=>s._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:r,schemaCode:o,it:a}=e,l=a.opts.unicodeRegExp?"u":"",c=n?s._`(new RegExp(${o}, ${l}))`:(0,i.usePattern)(e,r);e.fail$data(s._`!${c}.test(${t})`)}};t.default=r},86846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(57111),s=n(56110),r=n(20530),o={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>s.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>s._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:o,data:a,$data:l,it:c}=e,{opts:h}=c;if(!l&&0===n.length)return;const d=n.length>=h.loopRequired;if(c.allErrors?function(){if(d||l)e.block$data(s.nil,u);else for(const t of n)(0,i.checkReportMissingProp)(e,t)}():function(){const r=t.let("missing");if(d||l){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,r){e.setParams({missingProperty:n}),t.forOf(n,o,(()=>{t.assign(r,(0,i.propertyInData)(t,a,n,h.ownProperties)),t.if((0,s.not)(r),(()=>{e.error(),t.break()}))}),s.nil)}(r,n))),e.ok(n)}else t.if((0,i.checkMissingProp)(e,n,r)),(0,i.reportMissingProp)(e,r),t.else()}(),h.strictRequired){const t=e.parentSchema.properties,{definedProperties:i}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!i.has(e)){const t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(c,t,c.opts.strictRequired)}}function u(){t.forOf("prop",o,(n=>{e.setParams({missingProperty:n}),t.if((0,i.noPropertyInData)(t,a,n,h.ownProperties),(()=>e.error()))}))}}};t.default=o},55640:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(97349),s=n(56110),r=n(20530),o=n(18062),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>s.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>s._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:l,parentSchema:c,schemaCode:h,it:d}=e;if(!a&&!l)return;const u=t.let("valid"),p=c.items?(0,i.getSchemaTypes)(c.items):[];function f(r,o){const a=t.name("item"),l=(0,i.checkDataTypes)(p,a,d.opts.strictNumbers,i.DataType.Wrong),c=t.const("indices",s._`{}`);t.for(s._`;${r}--;`,(()=>{t.let(a,s._`${n}[${r}]`),t.if(l,s._`continue`),p.length>1&&t.if(s._`typeof ${a} == "string"`,s._`${a} += "_"`),t.if(s._`typeof ${c}[${a}] == "number"`,(()=>{t.assign(o,s._`${c}[${a}]`),e.error(),t.assign(u,!1).break()})).code(s._`${c}[${a}] = ${r}`)}))}function m(i,a){const l=(0,r.useFunc)(t,o.default),c=t.name("outer");t.label(c).for(s._`;${i}--;`,(()=>t.for(s._`${a} = ${i}; ${a}--;`,(()=>t.if(s._`${l}(${n}[${i}], ${n}[${a}])`,(()=>{e.error(),t.assign(u,!1).break(c)}))))))}e.block$data(u,(function(){const i=t.let("i",s._`${n}.length`),r=t.let("j");e.setParams({i,j:r}),t.assign(u,!0),t.if(s._`${i} > 1`,(()=>(p.length>0&&!p.some((e=>"object"===e||"array"===e))?f:m)(i,r)))}),s._`${h} === false`),e.ok(u)}};t.default=a},28926:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,s,r;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(s=i;0!=s--;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(r=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(s=i;0!=s--;)if(!Object.prototype.hasOwnProperty.call(n,r[s]))return!1;for(s=i;0!=s--;){var o=r[s];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n}},68125:e=>{"use strict";var t=e.exports=function(e,t,i){"function"==typeof t&&(i=t,t={}),n(t,"function"==typeof(i=t.cb||i)?i:i.pre||function(){},i.post||function(){},e,"",e)};function n(e,i,s,r,o,a,l,c,h,d){if(r&&"object"==typeof r&&!Array.isArray(r)){for(var u in i(r,o,a,l,c,h,d),r){var p=r[u];if(Array.isArray(p)){if(u in t.arrayKeywords)for(var f=0;f1){t[0]=t[0].slice(0,-1);for(var i=t.length-1,s=1;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=p-f,S=Math.floor,M=String.fromCharCode;function I(e){throw new RangeError(E[e])}function T(e,t){for(var n=[],i=e.length;i--;)n[i]=t(e[i]);return n}function P(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),i+T((e=e.replace(w,".")).split("."),t).join(".")}function B(e){for(var t=[],n=0,i=e.length;n=55296&&s<=56319&&n>1,e+=S(e/t);e>C*m>>1;i+=p)e=S(e/C);return S(i+(C+1)*e/(e+g))},N=function(e){var t=[],n=e.length,i=0,s=y,r=v,o=e.lastIndexOf(b);o<0&&(o=0);for(var a=0;a=128&&I("not-basic"),t.push(e.charCodeAt(a));for(var l=o>0?o+1:0;l=n&&I("invalid-input");var g=R(e.charCodeAt(l++));(g>=p||g>S((u-i)/h))&&I("overflow"),i+=g*h;var A=d<=r?f:d>=r+m?m:d-r;if(gS(u/_)&&I("overflow"),h*=_}var x=t.length+1;r=L(i-c,x,0==c),S(i/x)>u-s&&I("overflow"),s+=S(i/x),i%=x,t.splice(i++,0,s)}return String.fromCodePoint.apply(String,t)},k=function(e){var t=[],n=(e=B(e)).length,i=y,s=0,r=v,o=!0,a=!1,l=void 0;try{for(var c,h=e[Symbol.iterator]();!(o=(c=h.next()).done);o=!0){var d=c.value;d<128&&t.push(M(d))}}catch(e){a=!0,l=e}finally{try{!o&&h.return&&h.return()}finally{if(a)throw l}}var g=t.length,A=g;for(g&&t.push(b);A=i&&P<_&&(_=P)}}catch(e){w=!0,E=e}finally{try{!x&&T.return&&T.return()}finally{if(w)throw E}}var R=A+1;_-i>S((u-s)/R)&&I("overflow"),s+=(_-i)*R,i=_;var N=!0,k=!1,O=void 0;try{for(var U,F=e[Symbol.iterator]();!(N=(U=F.next()).done);N=!0){var V=U.value;if(Vu&&I("overflow"),V==i){for(var Q=s,z=p;;z+=p){var G=z<=r?f:z>=r+m?m:z-r;if(Q>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function z(e){for(var t="",n=0,i=e.length;n=194&&s<224){if(i-n>=6){var r=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&s)<<6|63&r)}else t+=e.substr(n,6);n+=6}else if(s>=224){if(i-n>=9){var o=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&s)<<12|(63&o)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function G(e,t){function n(e){var n=z(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,Q).replace(t.PCT_ENCODED,s)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,Q).replace(t.PCT_ENCODED,s)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,Q).replace(t.PCT_ENCODED,s)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,Q).replace(t.PCT_ENCODED,s)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,Q).replace(t.PCT_ENCODED,s)),e}function j(e){return e.replace(/^0*(.*)/,"$1")||"0"}function H(e,t){var n=e.match(t.IPV4ADDRESS)||[],i=h(n,2)[1];return i?i.split(".").map(j).join("."):e}function $(e,t){var n=e.match(t.IPV6ADDRESS)||[],i=h(n,3),s=i[1],r=i[2];if(s){for(var o=s.toLowerCase().split("::").reverse(),a=h(o,2),l=a[0],c=a[1],d=c?c.split(":").map(j):[],u=l.split(":").map(j),p=t.IPV4ADDRESS.test(u[u.length-1]),f=p?7:8,m=u.length-f,g=Array(f),A=0;A1){var b=g.slice(0,v.index),_=g.slice(v.index+v.length);y=b.join(":")+"::"+_.join(":")}else y=g.join(":");return r&&(y+="%"+r),y}return e}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Z=void 0==="".match(/(){0}/)[1];function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},i=!1!==t.iri?c:l;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var s=e.match(W);if(s){Z?(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5])):(n.scheme=s[1]||void 0,n.userinfo=-1!==e.indexOf("@")?s[3]:void 0,n.host=-1!==e.indexOf("//")?s[4]:void 0,n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=-1!==e.indexOf("?")?s[7]:void 0,n.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),n.host&&(n.host=$(H(n.host,i),i)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var r=V[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||r&&r.unicodeSupport)G(n,i);else{if(n.host&&(t.domainHost||r&&r.domainHost))try{n.host=F.toASCII(n.host.replace(i.PCT_ENCODED,z).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}G(n,l)}r&&r.parse&&r.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}function K(e,t){var n=!1!==t.iri?c:l,i=[];return void 0!==e.userinfo&&(i.push(e.userinfo),i.push("@")),void 0!==e.host&&i.push($(H(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(i.push(":"),i.push(String(e.port))),i.length?i.join(""):void 0}var Y=/^\.\.?\//,X=/^\/\.(\/|$)/,J=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(Y))e=e.replace(Y,"");else if(e.match(X))e=e.replace(X,"/");else if(e.match(J))e=e.replace(J,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(ee);if(!n)throw new Error("Unexpected dot segment condition");var i=n[0];e=e.slice(i.length),t.push(i)}return t.join("")}function ne(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?c:l,i=[],s=V[(t.scheme||e.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||s&&s.domainHost)try{e.host=t.iri?F.toUnicode(e.host):F.toASCII(e.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}G(e,n),"suffix"!==t.reference&&e.scheme&&(i.push(e.scheme),i.push(":"));var r=K(e,t);if(void 0!==r&&("suffix"!==t.reference&&i.push("//"),i.push(r),e.path&&"/"!==e.path.charAt(0)&&i.push("/")),void 0!==e.path){var o=e.path;t.absolutePath||s&&s.absolutePath||(o=te(o)),void 0===r&&(o=o.replace(/^\/\//,"/%2F")),i.push(o)}return void 0!==e.query&&(i.push("?"),i.push(e.query)),void 0!==e.fragment&&(i.push("#"),i.push(e.fragment)),i.join("")}function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={};return arguments[3]||(e=q(ne(e,n),n),t=q(ne(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=te(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=te(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=te(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function se(e,t,n){var i=o({scheme:"null"},n);return ne(ie(q(e,i),q(t,i),i,!0),i)}function re(e,t){return"string"==typeof e?e=ne(q(e,t),t):"object"===i(e)&&(e=q(ne(e,t),t)),e}function oe(e,t,n){return"string"==typeof e?e=ne(q(e,n),n):"object"===i(e)&&(e=ne(e,n)),"string"==typeof t?t=ne(q(t,n),n):"object"===i(t)&&(t=ne(t,n)),e===t}function ae(e,t){return e&&e.toString().replace(t&&t.iri?c.ESCAPE:l.ESCAPE,Q)}function le(e,t){return e&&e.toString().replace(t&&t.iri?c.PCT_ENCODED:l.PCT_ENCODED,z)}var ce={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},he={scheme:"https",domainHost:ce.domainHost,parse:ce.parse,serialize:ce.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var ue={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=de(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(de(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),i=h(n,2),s=i[0],r=i[1];e.path=s&&"/"!==s?s:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},pe={scheme:"wss",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize},fe={},me="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",Ae=n(n("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+n("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+n("%"+ge+ge)),ve="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ye=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),be="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",_e=new RegExp(me,"g"),xe=new RegExp(Ae,"g"),we=new RegExp(t("[^]",ve,"[\\.]",'[\\"]',ye),"g"),Ee=new RegExp(t("[^]",me,be),"g"),Ce=Ee;function Se(e){var t=z(e);return t.match(_e)?t:e}var Me={scheme:"mailto",parse:function(e,t){var n=e,i=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var s=!1,r={},o=n.query.split("&"),a=0,l=o.length;a{"use strict";n.d(t,{Z:()=>s});const i=function(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)},s={text:function(e,t){const n=window.URL.createObjectURL(new Blob([e],{type:"text/plain"}));i(n,t)},json:function(e,t){"object"==typeof e&&(e=JSON.stringify(e));const n=window.URL.createObjectURL(new Blob([e],{type:"text/json"}));i(n,t)},url:function(e,t){i(e,t)}}},47855:(e,t,n)=>{"use strict";n.d(t,{P:()=>s,ZP:()=>o});var i=n(96368);class s{constructor(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}static makeZeros(){return new s(0,0,0)}static makeOnes(){return new s(1,1,1)}static makeUnitX(){return new s(1,0,0)}static makeUnitY(){return new s(0,1,0)}static makeUnitZ(){return new s(0,0,1)}static makeCopy(e){return new s(e.x,e.y,e.z)}static makeFromScalar(e){return new s(e,e,e)}static makeFromArray(e){return new s(e[0],e[1],e[2])}static toString(e){return`[${e.x}, ${e.y}, ${e.z}]`}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}set(e,t,n){return this.x=e,this.y=t,this.z=n,this}setFromScalar(e){return this.x=e,this.y=e,this.z=e,this}setFromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}setZeros(){return this.x=0,this.y=0,this.z=0,this}setOnes(){return this.x=1,this.y=1,this.z=1,this}setUnitX(){return this.x=1,this.y=0,this.z=0,this}setUnitY(){return this.x=0,this.y=1,this.z=0,this}setUnitZ(){return this.x=0,this.y=0,this.z=1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}mul(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}div(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}mulScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}divScalar(e){return this.x/=e,this.y/=e,this.z/=e,this}translate(e,t,n){return this.x+=e,this.y+=t,this.z+=n,this}rotateX(e){const t=Math.cos(e),n=Math.sin(e),i=this.y,s=this.z;return this.y=t*i-n*s,this.z=n*i+t*s,this}rotateY(e){const t=Math.cos(e),n=Math.sin(e),i=this.x,s=this.z;return this.x=t*i+n*s,this.z=-n*i+t*s,this}rotateZ(e){const t=Math.cos(e),n=Math.sin(e),i=this.x,s=this.y;return this.x=t*i-n*s,this.y=n*i+t*s,this}scale(e,t,n){return this.x*=e,this.y*=t,this.z*=n,this}invert(){return this.x=1/this.x,this.y=1/this.y,this.z=1/this.z,this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}normalize(){const e=1/Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x*=e,this.y*=e,this.z*=e,this}homogenize(){return this.x/=this.z,this.y/=this.z,this.z=1,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}cross(e){const t=this.y*e.z-this.z*e.y,n=this.z*e.x-this.x*e.z,i=this.x*e.y-this.y*e.x;return this.x=t,this.y=n,this.z=i,this}length(){const e=this.x,t=this.y,n=this.z;return Math.sqrt(e*e+t*t+n*n)}lengthSquared(){const e=this.x,t=this.y,n=this.z;return e*e+t*t+n*n}distanceTo(e){const t=e.x-this.x,n=e.y-this.y,i=e.z-this.z;return Math.sqrt(t*t+n*n+i*i)}min(){return this.xthis.y?this.x>this.z?this.x:this.z:this.y>this.z?this.y:this.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}clone(){return new s(this.x,this.y,this.z)}toArray(e,t){return e?(void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e):[this.x,this.y,this.z]}toVector2(e){return e?(e.x=this.x,e.y=this.y,e):new i.Z(this.x,this.y)}toString(){return s.toString(this)}}s.zeros=new s(0,0,0),s.ones=new s(1,1,1),s.unitX=new s(1,0,0),s.unitY=new s(0,1,0),s.unitZ=new s(0,0,1);class r{constructor(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=i||0}static makeZeros(){return new r(0,0,0,0)}static makeOnes(){return new r(1,1,1,1)}static makeUnitX(){return new r(1,0,0,0)}static makeUnitY(){return new r(0,1,0,0)}static makeUnitZ(){return new r(0,0,1,0)}static makeUnitW(){return new r(0,0,0,1)}static makeCopy(e){return new r(e.x,e.y,e.z,e.w)}static makeFromScalar(e){return new r(e,e,e,e)}static makeFromArray(e){return new r(e[0],e[1],e[2],e[3])}static makeFromPosition(e){return new r(e.x,e.y,e.z,1)}static makeFromDirection(e){return new r(e.x,e.y,e.z,0)}static toString(e){return`[${e.x}, ${e.y}, ${e.z}, ${e.w}]`}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=void 0===i?1:i,this}setFromScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setFromArray(e,t=1){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}setPosition(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=1,this}setDirection(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=0,this}setZeros(){return this.x=0,this.y=0,this.z=0,this.w=0,this}setOnes(){return this.x=1,this.y=1,this.z=1,this.w=1,this}setUnitX(){return this.x=1,this.y=0,this.z=0,this.w=0,this}setUnitY(){return this.x=0,this.y=1,this.z=0,this.w=0,this}setUnitZ(){return this.x=0,this.y=0,this.z=1,this.w=0,this}setUnitW(){return this.x=0,this.y=0,this.z=0,this.w=1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}mul(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}div(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}normalize(){const e=1/Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}homogenize(){return this.x/=this.w,this.y/=this.w,this.z/=this.w,this.w=1,this}project(e){const t=this.dot(e)/this.lengthSquared();return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}length(){const e=this.x,t=this.y,n=this.z,i=this.w;return Math.sqrt(e*e+t*t+n*n+i*i)}lengthSquared(){const e=this.x,t=this.y,n=this.z,i=this.w;return e*e+t*t+n*n+i*i}isZero(){return 0===this.x&&0===this.y&&0===this.z&&0===this.w}clone(){return new r(this.x,this.y,this.z,this.w)}toArray(e,t){return e?(void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e):[this.x,this.y,this.z,this.w]}toVector3(e){return e?(e.x=this.x,e.y=this.y,e.z=this.z,e):new s(this.x,this.y,this.z)}toString(){return r.toString(this)}}r.zeros=new r(0,0,0,0),r.ones=new r(1,1,1,1),r.unitX=new r(1,0,0,0),r.unitY=new r(0,1,0,0),r.unitZ=new r(0,0,1,0),r.unitW=new r(0,0,0,1);class o{constructor(e=0,t=0,n=0,i=1){e instanceof o?(this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w):Array.isArray(e)?(this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0,this.w=void 0!==e[3]?e[3]:1):"string"==typeof e?this.setString(e):(this.x=e,this.y=t,this.z=n,this.w=i)}static fromString(e){return(new o).setString(e)}static fromArray(e){return new o(e)}get r(){return this.x}get g(){return this.y}get b(){return this.z}get a(){return this.w}set r(e){this.x=e}set g(e){this.y=e}set b(e){this.z=e}set a(e){this.w=e}get red(){return this.x}get green(){return this.y}get blue(){return this.z}get alpha(){return this.w}set red(e){this.x=e}set green(e){this.y=e}set blue(e){this.z=e}set alpha(e){this.w=e}get redByte(){return Math.floor(255*this.x)}get greenByte(){return Math.floor(255*this.y)}get blueByte(){return Math.floor(255*this.z)}get alphaByte(){return Math.floor(255*this.w)}set redByte(e){this.x=e/255}set greenByte(e){this.y=e/255}set blueByte(e){this.z=e/255}set alphaByte(e){this.w=e/255}inverseMultiply(e){return this.x=this.x*(1-e)+e,this.y=this.y*(1-e)+e,this.z=this.z*(1-e)+e,this}multiply(e){return this.x*=e,this.y*=e,this.z*=e,this}copy(e){this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w}clone(){return new o(this.x,this.y,this.z,this.w)}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=void 0===i?1:i,this}setBytes(e,t,n,i){return this.x=e/255,this.y=t/255,this.z=n/255,this.w=void 0===i?1:i/255,this}setUInt24RGB(e){return this.x=e>>16&255,this.y=e>>8&255,this.z=255&e,this.w=1,this}setUInt32RGBA(e){return this.x=e>>24&255,this.y=e>>16&255,this.z=e>>8&255,this.w=255&e,this.w=1,this}setRed(e){return this.x=e,this}setGreen(e){return this.y=e,this}setBlue(e){return this.z=e,this}setAlpha(e){return this.w=e,this}setRedByte(e){return this.x=e/255,this}setGreenByte(e){return this.y=e/255,this}setBlueByte(e){return this.z=e/255,this}setAlphaByte(e){return this.w=e/255,this}setHSV(e,t=1,n=1,i){"object"==typeof e&&(t=e.y,n=e.z,i=void 0!==e.w?e.w:i,e=e.x);const s=Math.floor(e/60),r=e/60-s,o=n*(1-t),a=n*(1-r*t),l=n*(1-(1-r)*t);let c,h,d;switch(s%6){case 0:c=n,h=l,d=o;break;case 1:c=a,h=n,d=o;break;case 2:c=o,h=n,d=l;break;case 3:c=o,h=a,d=n;break;case 4:c=l,h=o,d=n;break;case 5:c=n,h=o,d=a}return this.x=c,this.y=h,this.z=d,void 0!==i&&(this.w=i),this}setHSL(e,t=1,n=1,i){if("object"==typeof e&&(t=e.y,n=e.z,i=void 0!==e.w?e.w:i,e=e.x),0===t)this.x=this.y=this.z=n;else{function o(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}e/=360;var s=n<.5?n*(1+t):n+t-n*t,r=2*n-s;this.x=o(r,s,e+1/3),this.y=o(r,s,e),this.z=o(r,s,e-1/3)}return void 0!==i&&(this.w=i),this}fromArray(e){this.x=e[0]||0,this.y=e[1]||0,this.z=e[2]||0,this.w=void 0!==e[3]?e[3]:1}setString(e,t=1,n=!0){e=e.trim().toLowerCase();let i=(e=o.presets[e]||e).match(/^#?([0-9a-f]{3})$/i);if(i){const e=i[1],n=1/15;return this.x=Number.parseInt(e.charAt(0),16)*n,this.y=Number.parseInt(e.charAt(1),16)*n,this.z=Number.parseInt(e.charAt(2),16)*n,this.w=t,this}if(i=e.match(/^#?([0-9a-f]{6})$/i),i){const e=i[1],n=1/255;return this.x=Number.parseInt(e.substr(0,2),16)*n,this.y=Number.parseInt(e.substr(2,2),16)*n,this.z=Number.parseInt(e.substr(4,2),16)*n,this.w=t,this}if(0===e.indexOf("rgb")){let n=e.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const e=1/255;return this.x=Number.parseInt(n[1])*e,this.y=Number.parseInt(n[2])*e,this.z=Number.parseInt(n[3])*e,this.w=t,this}if(n=e.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+.*\d*)\s*\)$/i),n){const e=1/255;return this.x=Number.parseInt(n[1])*e,this.y=Number.parseInt(n[2])*e,this.z=Number.parseInt(n[3])*e,this.w=Number.parseFloat(n[4]),this}}if(0===e.indexOf("hsl")){let n=e.match(/(\d+(\.\d+)?)/g);return n&&this.setHSL(Number.parseFloat(n[0]),.01*Number.parseFloat(n[1]),.01*Number.parseFloat(n[2]),void 0!==n[3]?Number.parseFloat(n[3]):t),this}if(n)throw new RangeError("failed to parse color from string: "+e);return this}toUInt24RGB(){return Math.floor(255*this.x)<<16+Math.floor(255*this.y)<<8+Math.floor(255*this.z)}toUInt32RGBA(){return Math.floor(255*this.x)<<24+Math.floor(255*this.y)<<16+Math.floor(255*this.z)<<8+Math.floor(255*this.w)}toVector3(e){return e?(e.x=this.r,e.y=this.g,e.z=this.b,e):new s(this.r,this.g,this.b)}toVector4(e){return e?(e.x=this.r,e.y=this.g,e.z=this.b,e.w=this.a,e):new r(this.r,this.g,this.b,this.a)}toHSV(e){let t=this.x,n=this.y,i=this.z,r=Math.min(t,n,i),o=Math.max(t,n,i),a=o-r,l=0,c=0===o?0:a/o,h=o;return 0!==a&&(l=60*(t===o?(n-i)/a+(n.5?a/(2-o-r):a/(o+r),l=60*(t===o?(n-i)/a+(n{"use strict";n.d(t,{Z:()=>r});var i=n(82942),s=n(84292);class r extends i.Z{constructor(e){super(),this.addEvents("update","dispose"),e?this.fromJSON(e):this._data=this.init()}static generateId(){return(0,s.Z)()}get id(){return this._data.id}get data(){return this._data}set(e,t){this._data[e]=t,this.update()}get(e){return this._data[e]}update(){this.emit({type:"update",document:this})}dispose(){this.emit({type:"dispose",document:this}),this._data=null}fromJSON(e){return this._data={},this.inflate(e,this._data),this.update(),this}toJSON(e){return e=e||{},this.deflate(this._data,e),e}init(){return{}}inflate(e,t){Object.assign(t,e)}deflate(e,t){t=t||{},Object.assign(t,this._data)}}},97444:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(82942);const s=[];class r extends i.Z{constructor(e){super({knownEvents:!1});const t=e.typeName;if(!t)throw new Error("root type must have a 'typeName' member");this._rootTypeName=t,this._objLists={[this._rootTypeName]:[]},this._objTags={},this._objDict={}}static getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e}add(e){const t=e.id;if("string"==typeof t){if(void 0!==this._objDict[t])throw new Error("object already registered");this._objDict[t]=e}let n,i=e;const s=this._rootTypeName,r={type:"",add:!0,remove:!1,object:e};do{i=Object.getPrototypeOf(i),n=i.constructor.typeName,n&&((this._objLists[n]||(this._objLists[n]=[])).push(e),r.type=n,this.emit(r))}while(n!==s)}remove(e){const t=e.id;if("string"==typeof t){if(this._objDict[t]!==e)throw new Error("object not registered");delete this._objDict[t]}let n,i=e;const s=this._rootTypeName,r={type:"",add:!1,remove:!0,object:e};do{if(i=Object.getPrototypeOf(i),n=i.constructor.typeName,n){r.type=n;const t=this._objLists[n];t.splice(t.indexOf(e),1),this.emit(r)}}while(n!==s)}addByTag(e,t){if(!e||"tag"===e)throw new Error("illegal tag name");(this._objTags[e]||(this._objTags[e]=[])).push(t);const n={type:"tag",add:!0,remove:!1,object:t,tag:e};this.emit(n),n.type=e,this.emit(n)}removeByTag(e,t){if(!e||"tag"===e)throw new Error("illegal tag name");const n=this._objTags[e];if(n){const i=n.indexOf(t);if(i>=0){const s={type:"tag",add:!1,remove:!0,object:t,tag:e};return this.emit(s),s.type=e,this.emit(s),n.splice(i,1),!0}}return!1}clear(){this.cloneArray().forEach((e=>this.remove(e)))}get length(){return this._objLists[this._rootTypeName].length}count(e){const t=this._objLists[this.getTypeName(e)];return t?t.length:0}has(e){if("function"==typeof e){const t=this._objLists[e.typeName];return!!t&&t.length>0}if("string"==typeof e){const t=this._objLists[e];return!!t&&t.length>0}const t=this._objLists[e.constructor.typeName];return t&&t.indexOf(e)>=0}contains(e){const t=e.id;if("string"==typeof t)return!!this._objDict[t];const n=this._objLists[e.constructor.typeName];return n&&n.indexOf(e)>=0}get(e,t=!1){const n=this.getTypeName(e),i=this._objLists[n],s=i?i[0]:void 0;if(!t&&!s)throw new Error(`no instances of class '${n}' in object registry`);return s}getArray(e){return this._objLists[this.getTypeName(e)]||s}cloneArray(e){return this.getArray(e).slice()}getById(e){return this._objDict[e]}getDictionary(){return this._objDict}getByTag(e){return this._objTags[e]||s}on(e,t,n){super.on(this.getTypeName(e),t,n)}once(e,t,n){super.once(this.getTypeName(e),t,n)}off(e,t,n){super.off(this.getTypeName(e),t,n)}getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e||this._rootTypeName}}},82942:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const i=Symbol("Publisher private data"),s=Symbol("Publisher strict option");class r{constructor(e){const t=!e||e.knownEvents;this[i]={[s]:t}}on(e,t,n){if(Array.isArray(e))return void e.forEach((e=>{this.on(e,t,n)}));if(!t)throw new Error("missing callback function");let r=this[i][e];if(!r){if(this[i][s])throw new Error(`can't subscribe; unknown event: '${e}'`);r=this[i][e]=[]}let o={callback:t,context:n};r.push(o)}addEventListener(e,t,n){this.on(e,t,n)}once(e,t,n){if(Array.isArray(e))return void e.forEach((e=>{this.once(e,t,n)}));const i=s=>{this.off(e,i,n),t.call(n,s)};i.cb=t,this.on(e,i,n)}off(e,t,n){if("object"==typeof e){if(Array.isArray(e))e.forEach((e=>{this.off(e,t,n)}));else{const t=this[i];for(let n=0,i=Object.keys(t).length;n{this[i][e]||(this[i][e]=[])}))}hasEvent(e){return!!this[i][e]}listEvents(){return Object.getOwnPropertyNames(this[i])}}},25976:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{constructor(e,t,n){this._type=e,this._callback=t,this._context=n,this._publishers=[]}on(...e){return e.forEach((e=>{this._publishers.push(e),e.on(this._type,this._callback,this._context)})),this}off(){return this._publishers.forEach((e=>e.off(this._type,this._callback,this._context))),this._publishers.length=0,this}}},26041:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(82942);class s extends i.Z{constructor(){super(),this._dict={},this.addEvent("type")}add(e){if(Array.isArray(e))return void e.forEach((e=>this.add(e)));const t=e.typeName;if(!t)throw new Error("type must have a 'typeName' member");if(this._dict[t])throw new Error(`type '${t}' already registered`);this._dict[t]=e,this.emit({type:"type",add:!0,remove:!1,classType:e})}remove(e){if(Array.isArray(e))return void e.forEach((e=>this.remove(e)));const t=e.typeName;if(!t)throw new Error("type must have a 'typeName' member");if(!this._dict[t])throw new Error(`type '${t}' not registered`);delete this._dict[t],this.emit({type:"type",add:!1,remove:!0,classType:e})}getType(e){let t=e;return"function"==typeof e?t=e.typeName:"object"==typeof e&&(t=e.constructor.typeName),this._dict[t]}createInstance(e,...t){const n=this.getType(e);if(!n)throw new Error(`type '${e}' not registered`);return new n(...t)}}},96368:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{constructor(e,t){this.x=e||0,this.y=t||0}static makeZeros(){return new i(0,0)}static makeOnes(){return new i(1,1)}static makeUnitX(){return new i(1,0)}static makeUnitY(){return new i(0,1)}static makeCopy(e){return new i(e.x,e.y)}static makeFromScalar(e){return new i(e,e)}static makeFromArray(e){return new i(e[0],e[1])}static toString(e){return`[${e.x}, ${e.y}]`}copy(e){return this.x=e.x,this.y=e.y,this}set(e,t){return this.x=e,this.y=t,this}setFromScalar(e){return this.x=e,this.y=e,this}setFromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}setZeros(){return this.x=0,this.y=0,this}setOnes(){return this.x=1,this.y=1,this}setUnitX(){return this.x=1,this.y=0,this}setUnitY(){return this.x=0,this.y=1,this}add(e){return this.x+=e.x,this.y+=e.y,this}sub(e){return this.x-=e.x,this.y-=e.y,this}mul(e){return this.x*=e.x,this.y*=e.y,this}div(e){return this.x/=e.x,this.y/=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}subScalar(e){return this.x-=e,this.y-=e,this}mulScalar(e){return this.x*=e,this.y*=e,this}divScalar(e){return this.x/=e,this.y/=e,this}translate(e,t){return this.x+=e,this.y+=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),i=this.x,s=this.y;return this.x=t*i-n*s,this.y=n*i+t*s,this}scale(e,t){return this.x*=e,this.y*=t,this}invert(){return this.x=1/this.x,this.y=1/this.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){const e=1/Math.sqrt(this.x*this.x+this.y*this.y);return this.x*=e,this.y*=e,this}dot(e){return this.x*e.x+this.y*e.y}length(){const e=this.x,t=this.y;return Math.sqrt(e*e+t*t)}lengthSquared(){const e=this.x,t=this.y;return e*e+t*t}distanceTo(e){const t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)}angle(){return Math.atan2(this.y,this.x)}angleTo(e){const t=this.x,n=this.y,i=e.x,s=e.y;return Math.acos((t*i+n*s)/(Math.sqrt(t*t+n*n)+Math.sqrt(i*i+s*s)))}min(){return this.xthis.y?this.x:this.y}isZero(){return 0===this.x&&0===this.y}clone(){return new i(this.x,this.y)}toArray(e,t){return e?(void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e):[this.x,this.y]}toString(){return i.toString(this)}}i.zeros=new i(0,0),i.ones=new i(1,1),i.unitX=new i(1,0),i.unitY=new i(0,1)},28581:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});const i={PI:3.141592653589793,DOUBLE_PI:6.283185307179586,HALF_PI:1.5707963267948966,QUARTER_PI:.7853981633974483,DEG2RAD:.017453292519943295,RAD2DEG:57.29577951308232,limit:(e,t,n)=>en?n:e,limitInt:function(e,t,n){return(e=Math.trunc(e))n?n:e},normalize:(e,t,n)=>(e-t)/(n-t),normalizeLimit:(e,t,n)=>(e=(e-t)/(n-t))<0?0:e>1?1:e,denormalize:(e,t,n)=>(t+e)*(n-t),scale:(e,t,n,i,s)=>i+(e-t)/(n-t)*(s-i),scaleLimit:(e,t,n,i,s)=>i+((e=en?n:e)-t)/(n-t)*(s-i),deg2rad:function(e){return.017453292519943295*e},rad2deg:function(e){return 57.29577951308232*e},deltaRadians:function(e,t){return e=(e%=i.DOUBLE_PI)<0?e+i.DOUBLE_PI:e,(t=(t%=i.DOUBLE_PI)<0?t+i.DOUBLE_PI:t)-e>i.PI&&(e+=i.DOUBLE_PI),t-e},deltaDegrees:function(e,t){return e=(e%=i.DOUBLE_PI)<0?e+i.DOUBLE_PI:e,(t=(t%=i.DOUBLE_PI)<0?t+i.DOUBLE_PI:t)-e>i.PI&&(e+=i.DOUBLE_PI),t-e},curves:{linear:e=>e,easeIn:e=>Math.sin(e*i.HALF_PI),easeOut:e=>Math.cos(e*i.HALF_PI-i.PI)+1,ease:e=>.5*Math.cos(e*i.PI-i.PI)+.5,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e}},s=i},82507:(e,t,n)=>{"use strict";n.d(t,{q:()=>i});const i=function(e){return Object.keys(e).filter((e=>isNaN(Number(e))))}},84292:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});function i(e,t){let n;e&&"number"==typeof e||(e=12);do{n="";for(let t=0;t{"use strict";n.d(t,{ZP:()=>c,V5:()=>s.V5});var i=n(82942),s=n(31181),r=n(84292);class o extends i.Z{constructor(e){super(),this.addEvent("property"),this.linkable=e,this.properties=[]}get customProperties(){return this.properties.filter((e=>e.custom))}dispose(){this.unlinkAllProperties()}isInputGroup(){return this===this.linkable.ins}isOutputGroup(){return this===this.linkable.outs}createProperties(e,t){return Object.keys(e).forEach(((n,i)=>{const s=void 0===t?void 0:t+i,r=e[n];this.createProperty(r.path,r.schema,n,s)})),this}createProperty(e,t,n,i){const r=new s.ZP(e,t);return this.addProperty(r,n,i),r}createCustomProperty(e,t,n){const i=new s.ZP(e,t,!0);return this.addCustomProperty(i,n),i}addCustomProperty(e,t){const n=(0,r.Z)(5);this.addProperty(e,n,t)}addProperty(e,t,n){if(e.group)throw new Error("can't add, property already part of a group");if(this[t])throw new Error(`key '${t}' already exists in group`);e._group=this,e._key=t,void 0===n?this.properties.push(e):this.properties.splice(n,0,e),this[t]=e,this.emit({type:"property",add:!0,remove:!1,property:e})}removeProperty(e){if(e.group!==this)throw new Error("can't remove, property not in this group");if(e.hasLinks())throw new Error("can't remove, property has links");if(this[e.key]!==e)throw new Error(`property key '${e.key}' not found in group`);this.properties.slice(this.properties.indexOf(e),1),delete this[e.key],e._group=null,e._key="",this.emit({type:"property",add:!1,remove:!0,property:e})}getProperty(e){const t=this[e];if(!t)throw new Error(`no property found with key '${e}'`);return t}getKeys(e=!1){const t=[];return this.properties.forEach((n=>{(e||"object"!==n.type)&&t.push(n.key)})),t}getValues(e=!1){const t=[];return this.properties.map((n=>{(e||"object"!==n.type)&&t.push(n.value)})),t}cloneValues(e=!1){const t=[];return this.properties.map((n=>{(e||"object"!==n.type)&&t.push(n.cloneValue())})),t}setValues(e){Object.keys(e).forEach((t=>this.getProperty(t).value=e[t]))}copyValues(e){Object.keys(e).forEach((t=>this.getProperty(t).copyValue(e[t])))}unlinkAllProperties(){this.properties.forEach((e=>e.unlink()))}toJSON(){let e=null;return this.properties.forEach((t=>{const n=t.toJSON();n&&(e=e||{},e[t.key]=n)})),e}fromJSON(e){Object.keys(e).forEach((t=>{const n=e[t];if(n.schema){const e=new s.ZP(n.path,n.schema,!0);this.addProperty(e,t)}}))}linksFromJSON(e,t){Object.keys(e).forEach((n=>{this[n].fromJSON(e[n],t)}))}}var a=n(52226);class l{constructor(e,t){this._typeName=t?c.getTypeName(t):null,this._id=t instanceof c?t.id:void 0,this._system=e}get component(){return this._id&&this._system.components.getById(this._id)||null}set component(e){if(e&&this._typeName&&!(e instanceof this._system.registry.getType(this._typeName)))throw new Error(`can't assign component of class '${e.constructor.name||"unknown"}' to link of class '${this._typeName}'`);this._id=e?e.id:void 0}}n(90199);class c extends i.Z{constructor(e,t){super({knownEvents:!1}),this.ins=new o(this),this.outs=new o(this),this.changed=!0,this.updated=!1,this._name="",this._tags=new Set,this._trackers=[],this.node=e,this.id=t}static getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e||c.typeName}create(){this.node._addComponent(this),this.graph.isActive&&this.activate&&this.activate()}dispose(){this.graph.isActive&&this.deactivate&&this.deactivate(),this.emit({type:"dispose",component:this}),this.ins.dispose(),this.outs.dispose(),this._trackers.forEach((e=>e.dispose())),this.node&&(this.node._removeComponent(this),this.node=null)}get isNodeSingleton(){return this.constructor.isNodeSingleton}get isGraphSingleton(){return this.constructor.isGraphSingleton}get isSystemSingleton(){return this.constructor.isSystemSingleton}get typeName(){return this.constructor.typeName}get displayTypeName(){const e=this.typeName;return"Component"===e?e:e.substr(1)}get text(){return this.constructor.text}get icon(){return this.constructor.icon}get name(){return this._name}get displayName(){return this._name||this.text||this.displayTypeName}set name(e){this._name=e,this.emit({type:"change",component:this,what:"name"})}get tags(){return this._tags}addTag(e){this._tags.has(e)||(this._tags.add(e),this.node._addComponentTag(e,this))}removeTag(e){this._tags.has(e)&&(this._tags.delete(e),this.node._removeComponentTag(e,this))}get graph(){return this.node.graph}get system(){return this.node.system}get components(){return this.node.components}get isActive(){return this.graph.isActive}getComponent(e,t=!1){return this.node.components.get(e,t)}getComponents(e){return this.node.components.getArray(e)}getComponentsByTag(e){return this.node.components.getByTag(e)}createComponent(e){return this.node.createComponent(e)}getOrCreateComponent(e){return this.node.components.get(e,!0)||this.node.createComponent(e)}hasComponent(e){return this.node.components.has(e)}getGraphComponent(e,t=!1){return this.node.graph.components.get(e,t)}getGraphComponents(e){return this.node.graph.components.getArray(e)}getGraphComponentsByTag(e){return this.node.graph.components.getByTag(e)}hasGraphComponent(e){return this.node.graph.components.has(e)}getMainComponent(e,t=!1){return this.node.system.graph.components.get(e,t)}getMainComponents(e){return this.node.system.graph.components.getArray(e)}getMainComponentsByTag(e){return this.node.system.graph.components.getByTag(e)}hasMainComponent(e){return this.node.system.graph.components.has(e)}getSystemComponent(e,t=!1){return this.node.system.components.get(e,t)}getSystemComponents(e){return this.node.system.components.getArray(e)}getSystemComponentsByTag(e){return this.node.system.components.getByTag(e)}hasSystemComponent(e){return this.node.system.components.has(e)}getComponentById(e){return this.node.system.components.getById(e)}getNode(e,t=!1){return this.node.graph.nodes.get(e,t)}getNodes(e){return this.node.graph.nodes.getArray(e)}getNodesByTag(e){return this.node.graph.nodes.getByTag(e)}hasNode(e){return this.node.graph.nodes.has(e)}getMainNode(e,t=!1){return this.node.system.graph.nodes.get(e,t)}getMainNodes(e){return this.node.system.graph.nodes.getArray(e)}getMainNodesByTag(e){return this.node.system.graph.nodes.getByTag(e)}hasMainNode(e){return this.node.system.graph.nodes.has(e)}getSystemNode(e,t=!1){return this.node.system.nodes.get(e,t)}getSystemNodes(e){return this.node.system.nodes.getArray(e)}getSystemNodesByTag(e){return this.node.system.nodes.getByTag(e)}hasSystemNode(e){return this.node.system.nodes.has(e)}getNodeById(e){return this.node.system.nodes.getById(e)}activate(){}update(e){throw new Error("this should never be called")}tick(e){throw new Error("this should never be called")}tock(e){throw new Error("this should never be called")}deactivate(){}requestSort(){this.graph.requestSort()}is(e){const t=c.getTypeName(e);let n=this;do{if(n=Object.getPrototypeOf(n),n.constructor.typeName===t)return!0}while(n.constructor.typeName!==c.typeName);return!1}unlinkAllProperties(){this.ins.unlinkAllProperties(),this.outs.unlinkAllProperties()}resetChanged(){this.changed=!1;const e=this.ins.properties;for(let t=0,n=e.length;tt.dump(e+" IN "))),this.outs.properties.forEach((t=>t.dump(e+" OUT ")))}toJSON(){let e={};const t=this.ins.toJSON();t&&(e.ins=t);const n=this.outs.toJSON();return n&&(e.outs=n),e}fromJSON(e){e.ins&&this.ins.fromJSON(e.ins),e.outs&&this.outs.fromJSON(e.outs)}referencesFromJSON(e){const t=this.system.components.getDictionary();e.ins&&this.ins.linksFromJSON(e.ins,t),e.outs&&this.outs.linksFromJSON(e.outs,t)}addCustomInput(e,t,n){return this.changed=!0,this.ins.createCustomProperty(e,t,n)}allowCustomInput(e){return!1}addCustomOutput(e,t,n){return this.outs.createCustomProperty(e,t,n)}allowCustomOutput(e){return!1}addInputs(e,t){return this.ins.createProperties(e,t)}addOutputs(e,t){return this.outs.createProperties(e,t)}}c.typeName="Component",c.text="",c.icon="",c.isNodeSingleton=!0,c.isGraphSingleton=!1,c.isSystemSingleton=!1,c.prototype.activate=null,c.prototype.update=null,c.prototype.tick=null,c.prototype.tock=null,c.prototype.deactivate=null},52226:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s{constructor(e,t,n,s){this.typeName=i.ZP.getTypeName(t),this.didAdd=n,this.willRemove=s,this._registry=e,e.on(this.typeName,this.onComponent,this),this.component=e.get(t,!0),this.component&&n&&n(this.component)}dispose(){this._registry.off(this.typeName,this.onComponent,this),this.component=null,this.didAdd=null,this.willRemove=null}onComponent(e){e.add?(this.component=e.object,this.didAdd&&this.didAdd(e.object)):e.remove&&(this.willRemove&&this.willRemove(e.object),this.component=null)}}},83275:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(84292),s=n(82942);class r{constructor(){this.visited={},this.visiting={},this.sorted=[]}sort(e){for(let t=0,n=e.length;t0)throw new Error("graph not empty")}requestSort(){this._sortRequested=!0}sort(){this._sortedList=this._sorter.sort(this.components.getArray());this.parent&&(this.parent.name||this.parent.typeName)}createCustomNode(e,t,n){const s=this.system.registry.getType(e);if(!s)throw new Error(`node type '${a.Z.getTypeName(e)}' not registered`);const r=new s(this,n||(0,i.Z)(12,this.system.nodes.getDictionary()));return r.create(),t&&(r.name=t),n||(r.createComponents(),r.unlock()),r}createNode(e,t){const n=new a.Z(this,t||(0,i.Z)(12,this.system.nodes.getDictionary()));return n.create(),e&&(n.name=e),n.unlock(),n}findNodeByName(e,t){const n=this.nodes.getArray(t);for(let t=0,i=n.length;te.toString(!0))).join("\n"):i}dump(e=""){console.log(e+"%cGraph","color: red");this.findRootNodes().forEach((t=>t.dump(e+" ")))}toJSON(){const e={},t=[],n=this.nodes.getArray();for(let e=0,i=n.length;e0&&(e.nodes=t),e}fromJSON(e){e.nodes&&(e.nodes.forEach((e=>{this.createCustomNode(e.type,e.name,e.id).fromJSON(e)})),e.nodes.forEach((e=>{this.nodes.getById(e.id).referencesFromJSON(e)})))}nodeToJSON(e){return e.toJSON()}_addNode(e){this.nodes.add(e),this.system._addNode(e)}_removeNode(e){this.system._removeNode(e),this.nodes.remove(e)}_addNodeTag(e,t){this.nodes.addByTag(e,t),this.system._addNodeTag(e,t)}_removeNodeTag(e,t){this.system._removeNodeTag(e,t),this.nodes.removeByTag(e,t)}_addComponent(e){if(e.isGraphSingleton&&this.components.has(e))throw new Error(`only one component of type '${e.typeName}' allowed per graph`);this.components.add(e),this.system._addComponent(e),e.tock&&this._tockList.push(e),this._sortRequested=!0}_removeComponent(e){this.system._removeComponent(e),this.components.remove(e),e.tock&&this._tockList.splice(this._tockList.indexOf(e),1),this._sortRequested=!0}_addComponentTag(e,t){this.components.addByTag(e,t),this.system._addComponentTag(e,t)}_removeComponentTag(e,t){this.system._removeComponentTag(e,t),this.components.removeByTag(e,t)}_addRoot(e){this.roots.push(e),this.parent&&this.parent.onAddInnerRoot(e)}_removeRoot(e){this.parent&&this.parent.onRemoveInnerRoot(e),this.roots.splice(this.roots.indexOf(e),1)}}},90199:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(84292),s=n(82942),r=n(97444),o=n(80038);class a extends s.Z{constructor(e,t){super({knownEvents:!1}),this.graph=null,this.components=new r.Z(o.ZP),this._name="",this._tags=new Set,this._isLocked=void 0,this.graph=e,this.id=t}static getTypeName(e){return"function"==typeof e?e.typeName:"object"==typeof e?e.constructor.typeName:e||a.typeName}get typeName(){return this.constructor.typeName}get displayTypeName(){const e=this.typeName;return"Node"===e?e:e.substr(1)}get isLocked(){return this._isLocked}get text(){return this.constructor.text}get icon(){return this.constructor.icon}get name(){return this._name}get displayName(){return this._name||this.text||this.displayTypeName}set name(e){this._name=e,this.emit({type:"change",what:"name",node:this})}get tags(){return this._tags}addTag(e){this._tags.has(e)||(this._tags.add(e),this.graph._addNodeTag(e,this))}removeTag(e){this._tags.has(e)&&(this._tags.delete(e),this.graph._removeNodeTag(e,this))}get system(){return this.graph.system}getComponent(e,t=!1){return this.components.get(e,t)}getComponents(e){return this.components.getArray(e)}getComponentsByTag(e){return this.components.getByTag(e)}getOrCreateComponent(e){return this.components.get(e,!0)||this.createComponent(e)}hasComponent(e){return this.components.has(e)}getGraphComponent(e,t=!1){return this.graph.components.get(e,t)}getGraphComponents(e){return this.graph.components.getArray(e)}getGraphComponentsByTag(e){return this.graph.components.getByTag(e)}hasGraphComponent(e){return this.graph.components.has(e)}getMainComponent(e,t=!1){return this.graph.system.graph.components.get(e,t)}getMainComponents(e){return this.graph.system.graph.components.getArray(e)}getMainComponentsByTag(e){return this.graph.system.graph.components.getByTag(e)}hasMainComponent(e){return this.graph.system.graph.components.has(e)}getSystemComponent(e,t=!1){return this.graph.system.components.get(e,t)}getSystemComponents(e){return this.graph.system.components.getArray(e)}getSystemComponentsByTag(e){return this.graph.system.components.getByTag(e)}hasSystemComponent(e){return this.graph.system.components.has(e)}getComponentById(e){return this.graph.system.components.getById(e)}getNode(e,t=!1){return this.graph.nodes.get(e,t)}getNodes(e){return this.graph.nodes.getArray(e)}getNodesByTag(e){return this.graph.nodes.getByTag(e)}hasNode(e){return this.graph.nodes.has(e)}getMainNode(e,t=!1){return this.graph.system.graph.nodes.get(e,t)}getMainNodes(e){return this.graph.system.graph.nodes.getArray(e)}getMainNodesByTag(e){return this.graph.system.graph.nodes.getByTag(e)}hasMainNode(e){return this.graph.system.graph.nodes.has(e)}getSystemNode(e,t=!1){return this.graph.system.nodes.get(e,t)}getSystemNodes(e){return this.graph.system.nodes.getArray(e)}getSystemNodesByTag(e){return this.graph.system.nodes.getByTag(e)}hasSystemNode(e){return this.graph.system.nodes.has(e)}getNodeById(e){return this.graph.system.nodes.getById(e)}lock(){if(!1===this._isLocked)throw new Error("can't lock an unlocked node again");this._isLocked=!0}unlock(){this._isLocked=!1}create(){this.graph._addNode(this)}createComponents(){}clear(){this.components.getArray().slice().forEach((e=>e.dispose()))}dispose(){this.components.cloneArray().reverse().forEach((e=>e.dispose())),this.emit({type:"dispose",node:this}),this.graph&&(this.graph._removeNode(this),this.graph=null)}createComponent(e,t,n){if(!0===this._isLocked)throw new Error("node is locked, can't create component");const s=this.system.registry.getType(e);if(!s)throw new Error(`component type '${o.ZP.getTypeName(e)}' not registered`);const r=new s(this,n||(0,i.Z)(12,this.system.components.getDictionary()));return r.create(),t&&(r.name=t),r}is(e){const t=a.getTypeName(e);let n=this;do{if(n=Object.getPrototypeOf(n),n.constructor.typeName===t)return!0}while(n.constructor.typeName!==a.typeName);return!1}toString(e=!1){const t=this.components.getArray(),n=`Node '${this.name}' - ${t.length} components`;return e?n+"\n"+t.map((e=>" "+e.toString())).join("\n"):n}dump(e=""){console.log(e+`%cNode '${this.typeName}' (${this.displayName})`,"color: blue"),this.components.getArray().forEach((t=>t.dump(e+" ")))}toJSON(){const e={},t=[];this._isLocked&&(e.locked=!0);const n=this.components.getArray();for(let e=0,i=n.length;e0&&(e.components=t),e}fromJSON(e){this._isLocked=!!e.locked,e.components&&e.components.forEach((e=>this.componentFromJSON(e)))}componentFromJSON(e){this.createComponent(e.type,e.name,e.id).fromJSON(e)}referencesFromJSON(e){e.components&&e.components.forEach((e=>{this.components.getById(e.id).referencesFromJSON(e)}))}componentToJSON(e){return e.toJSON()}_addComponent(e){if(e.isNodeSingleton&&this.components.has(e))throw new Error(`only one component of type '${e.typeName}' allowed per node`);this.components.add(e),this.graph._addComponent(e)}_removeComponent(e){this.graph._removeComponent(e),this.components.remove(e)}_addComponentTag(e,t){this.components.addByTag(e,t),this.graph._addComponentTag(e,t)}_removeComponentTag(e,t){this.graph._removeComponentTag(e,t),this.components.removeByTag(e,t)}}a.typeName="Node",a.text="",a.icon=""},31181:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p,V5:()=>u.V5});var i=n(82942);const s=[function(e){return e},function(e,t){for(let n=0,i=t.length;n=0)throw new Error("non-array source property; can't link to element");if(1===t.elementCount&&i>=0)throw new Error("non-array destination property; can't link to element");this.source=e,this.destination=t,this.sourceIndex=n,this.destinationIndex=i;const s=void 0===n?-1:n,r=void 0===i?-1:i,o=e.elementCount>1&&s<0&&r<0;this.fnConvert=function(e,t,n){const i=n?1:0;return l[e][t][i]}(e.type,t.type,o);const a=function(e,t,n){return-1===e&&-1===t?n:e<=3&&t<=3?h[e+1][t+1]:function(n,i,s){return i[t]=s(n[e]),i}}(s,r,this.fnConvert);var c,d,u;this.fnCopy=(c=e.isMulti(),d=t.isMulti(),u=a,!1===c?!1===d?u:function(e,t,n){for(let n=0,i=t.length;n0&&(t=u(e[0],t)),t}:function(e,t,n){for(let n=0,i=e.length,s=t.length;n=0&&this.setValue(i,t,n)}copyValue(e,t){Array.isArray(e)&&(e=e.slice()),this.setValue(e,t)}set(e){e||(this.changed=!0,this.isInput()&&(this._group.linkable.changed=!0)),this.emit("value",this.value);const t=this.outLinks;for(let e=0,n=t.length;ei.source===e&&i.sourceIndex===t&&i.destinationIndex===n));return!!i&&(e.removeOutLink(i),this.removeInLink(i),!0)}unlink(){this.inLinks.slice().forEach((e=>{e.source.removeOutLink(e),this.removeInLink(e)}));if(this.outLinks.slice().forEach((e=>{this.removeOutLink(e),e.destination.removeInLink(e)})),0!==this.inLinks.length||0!==this.outLinks.length)throw new Error("fatal: leftover links")}addInLink(e){if(e.destination!==this)throw new Error("input link's destination must equal this");this.inLinks.push(e),this.requestSort(),this.emit({type:"link",add:!0,remove:!1,link:e})}addOutLink(e){if(e.source!==this)throw new Error("output link's source must equal this");this.outLinks.push(e),this.requestSort(),e.push()}removeInLink(e){const t=this.inLinks.indexOf(e);if(t<0)throw new Error("input link not found");this.inLinks.splice(t,1),this.requestSort(),0===this.inLinks.length&&"object"===this.type&&this.reset(),this.emit({type:"link",add:!1,remove:!0,link:e})}removeOutLink(e){const t=this.outLinks.indexOf(e);if(t<0)throw new Error("output link not found");this.outLinks.splice(t,1),this.requestSort()}canLinkTo(e,t,n){return e.canLinkFrom(this,t,n)}canLinkFrom(e,t,n){if(this.isOutput())return!1;const i=t>=0,s=n>=0;if(!e.isArray()&&i)throw new Error("non-array source property; can't link to element");if(!this.isArray()&&s)throw new Error("non-array destination property; can't link to element");const r=e.isArray()&&!i;return r===(this.isArray()&&!s)&&((!r||e.elementCount===this.elementCount)&&(!("object"===e.type&&"object"===this.type&&!function(e,t){if(!e||!t)return!1;let n=e.prototype;for(;n;){if(n===t.prototype)return!0;n=n.prototype}return!1}(e.schema.objectType,this.schema.objectType))&&(o=e.type,a=this.type,c[o][a])));var o,a}reset(){let e;if(this.isMulti()){let t=this.value;t?t.length=1:e=t=[],t[0]=this.clonePreset()}else e=this.clonePreset();this.setValue(e)}setMultiChannelCount(e){if(!this.isMulti())throw new Error("can't set multi channel count on non-multi property");const t=this.value,n=t.length;t.length=e;for(let i=n;i=e.length?0:t]||""}}isInput(){return this._group&&this._group===this._group.linkable.ins}isOutput(){return this._group&&this._group===this._group.linkable.outs}isArray(){return Array.isArray(this.schema.preset)}isMulti(){return!!this.schema.multi}isDefault(){const e=this.schema.multi?this.value[0]:this.value,t=this.schema.preset,n=Array.isArray(e)?e.length:-1;if(n!==(Array.isArray(t)?t.length:-1))return!1;if(n>=0){for(let i=0;i0||this.outLinks.length>0}hasInLinks(e){const t=this.inLinks;if(!(e>=0))return t.length>0;for(let n=0,i=t.length;n=0))return!0;return!1}hasOutLinks(e){const t=this.outLinks;if(!(e>=0))return t.length>0;for(let n=0,i=t.length;n0&&(e=e||{},e.links=this.outLinks.map((e=>{const t={id:e.destination._group.linkable.id,key:e.destination.key};return e.sourceIndex>=0&&(t.srcIndex=e.sourceIndex),e.destinationIndex>=0&&(t.dstIndex=e.destinationIndex),t}))),e}fromJSON(e,t){void 0!==e.value&&(this.value=e.value),void 0!==e.links&&e.links.forEach((e=>{t[e.id].ins[e.key].linkFrom(this,e.srcIndex,e.dstIndex)}))}toString(){const e=this.schema,t=e.event?"event":e.options?"enum":this.type;return`${this.path} [${t}]`}dump(e=""){console.log(e+`Property '${this.path}', key: ${this.key}, value: ${this.value}`)}validateValue(e){const t=this.schema;if(t.enum){const n=Math.trunc(e);return t.enum[n]?n:0}if(t.options){const n=Math.trunc(e);return n<0||n>=t.options.length?0:n}return"number"===this.type?(e=t.min?Math.max(t.min,e):e,e=t.max?Math.min(t.max,e):e):e}clonePreset(){const e=this.schema.preset;return Array.isArray(e)?e.slice():e}}},56166:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(82942),s=n(97444),r=n(26041),o=n(80038),a=n(90199),l=n(83275);class c extends i.Z{constructor(e){super({knownEvents:!1}),this.nodes=new s.Z(a.Z),this.components=new s.Z(o.ZP),this.registry=e||new r.Z,this.graph=new l.Z(this,null),this.graph.activate()}getComponent(e,t=!1){return this.components.get(e,t)}getComponents(e){return this.components.getArray(e)}getComponentsByTag(e){return this.components.getByTag(e)}hasComponents(e){return this.components.has(e)}getMainComponent(e,t=!1){return this.graph.components.get(e,t)}getMainComponents(e){return this.graph.components.getArray(e)}getMainComponentsByTag(e){return this.graph.components.getByTag(e)}hasMainComponents(e){return this.graph.components.has(e)}getNode(e,t=!1){return this.nodes.get(e,t)}getNodes(e){return this.nodes.getArray(e)}getNodesByTag(e){return this.nodes.getByTag(e)}hasNodes(e){return this.nodes.has(e)}getMainNode(e,t=!1){return this.graph.nodes.get(e,t)}getMainNodes(e){return this.graph.nodes.getArray(e)}getMainNodesByTag(e){return this.graph.nodes.getByTag(e)}hasMainNodes(e){return this.graph.nodes.has(e)}findNodeByName(e,t){const n=this.nodes.getArray(t);for(let t=0,i=n.length;te.toString(!0))).join("\n"):i}_addNode(e){this.nodes.add(e)}_removeNode(e){this.nodes.remove(e)}_addNodeTag(e,t){this.nodes.addByTag(e,t)}_removeNodeTag(e,t){this.nodes.removeByTag(e,t)}_addComponent(e){if(e.isSystemSingleton&&this.components.has(e))throw new Error(`only one component of type '${e.typeName}' allowed per system`);this.components.add(e)}_removeComponent(e){this.components.remove(e)}_addComponentTag(e,t){this.components.addByTag(e,t)}_removeComponentTag(e,t){this.components.removeByTag(e,t)}}},63833:(e,t,n)=>{"use strict";n.d(t,{$:()=>i,Z:()=>a});var i,s=n(80038),r=n(90199),o=n(47162);!function(e){e[e.Node=0]="Node",e[e.Graph=1]="Graph",e[e.Main=2]="Main",e[e.System=3]="System"}(i||(i={}));class a extends s.ZP{constructor(){super(...arguments),this._scope=i.Node,this._scopedNode=null,this._scopedGraph=null,this._activeComponent=null}get componentType(){return this.constructor.componentType}get followComponentSelection(){return this.constructor.followComponentSelection}get followNodeSelection(){return this.constructor.followNodeSelection}get retainSelection(){return this.constructor.retainSelection}get scope(){return this._scope}set scope(e){this._scope=e,this._activeComponent&&!this.isComponentInScope(this._activeComponent)&&(this.activeComponent=null)}get scopedNode(){return this._scopedNode}set scopedNode(e){e!==this._scopedNode&&(this._scopedNode=e,this._activeComponent&&!this.isComponentInScope(this._activeComponent)&&(this.activeComponent=null),this.onScopedComponents(),this.emit({type:"scoped-components"}))}get scopedGraph(){return this._scopedGraph}set scopedGraph(e){e!==this._scopedGraph&&(this._scopedGraph=e,this._activeComponent&&!this.isComponentInScope(this._activeComponent)&&(this.activeComponent=null),this.onScopedComponents(),this.emit({type:"scoped-components"}))}get scopedComponents(){switch(this._scope){case i.Node:return(this._scopedNode||this.node).getComponents(this.componentType);case i.Graph:return(this._scopedGraph?this._scopedGraph.innerGraph:this.graph).getComponents(this.componentType);case i.Main:return this.getMainComponents(this.componentType);case i.System:return this.getSystemComponents(this.componentType)}}get activeComponent(){return this._activeComponent}set activeComponent(e){const t=this.activeComponent;if(e!==t){if(t&&this.deactivateComponent(t),e){if(!this.isComponentInScope(e))throw new Error("can't activate, component out of scope");this.activateComponent(e)}this._activeComponent=e,this.onActiveComponent(t,e),this.emit({type:"active-component",previous:t,next:e})}}get selection(){return this.getSystemComponent(o.Z)}create(){super.create(),this.system.components.on(s.ZP,this.onComponent,this),this.followComponentSelection&&this.selection.selectedComponents.on(this.componentType,this.onSelectComponent,this),this.followNodeSelection&&this.selection.selectedNodes.on(r.Z,this.onSelectNode,this)}dispose(){this.activeComponent&&(this.activeComponent=null),this.system.components.off(s.ZP,this.onComponent,this),this.followComponentSelection&&this.selection.selectedComponents.off(this.componentType,this.onSelectComponent,this),this.followNodeSelection&&this.selection.selectedNodes.off(r.Z,this.onSelectNode,this),super.dispose()}activateComponent(e){}deactivateComponent(e){}onActiveComponent(e,t){}onScopedComponents(){}onComponent(e){e.remove&&e.object===this.activeComponent&&(this.activeComponent=null),this.isComponentInScope(e.object)&&(this.onScopedComponents(),this.emit({type:"scoped-components"}))}onSelectComponent(e){const t=e.object;this.isComponentInScope(t)&&(e.add?this.activeComponent=t:e.remove&&!this.retainSelection&&t===this.activeComponent&&(this.activeComponent=null))}onSelectNode(e){const t=e.object;if(this.isNodeInScope(t)){const n=t.getComponent(this.componentType);n&&this.onSelectComponent({type:n.typeName,object:n,add:e.add,remove:e.remove})}}isComponentInScope(e){if(!e.is(this.componentType))return!1;switch(this._scope){case i.Node:const t=this._scopedNode||this.node;return e.node===t;case i.Graph:const n=this._scopedGraph?this._scopedGraph.innerGraph:this.graph;return e.graph===n;case i.Main:return e.graph===this.system.graph;case i.System:return!0}return!1}isNodeInScope(e){switch(this._scope){case i.Node:return e===(this._scopedNode||this.node);case i.Graph:const t=this._scopedGraph?this._scopedGraph.innerGraph:this.graph;return e.graph===t;case i.Main:return e.graph===this.system.graph;case i.System:return!0}}}a.typeName="CComponentProvider",a.componentType=s.ZP,a.followComponentSelection=!0,a.followNodeSelection=!1,a.retainSelection=!0},18894:(e,t,n)=>{"use strict";n.d(t,{V5:()=>i.V5,ZP:()=>r});var i=n(80038),s=n(83275);n(90199);class r extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(r.graphIns),this._innerGraph=null,this._innerRoot=null,this._innerGraph=new s.Z(this.system,this)}get innerGraph(){return this._innerGraph}get innerNodes(){return this._innerGraph.nodes}get innerComponents(){return this._innerGraph.components}get innerRoots(){return this._innerGraph.roots}getInnerComponent(e,t=!1){return this._innerGraph.components.get(e,t)}getInnerComponents(e){return this._innerGraph.components.getArray(e)}hasInnerComponent(e){return this._innerGraph.components.has(e)}getInnerNode(e,t=!1){return this._innerGraph.nodes.get(e,t)}getInnerNodes(e){return this._innerGraph.nodes.getArray(e)}hasInnerNode(e){return this._innerGraph.nodes.has(e)}isEmpty(){return 0===this._innerGraph.nodes.count()}update(e){const t=this.ins;if(t.active.changed){const e=t.active.value;e!==this._innerGraph.isActive&&(e?this.activateInnerGraph():this.deactivateInnerGraph())}return!0}tick(e){return this._innerGraph.tick(e)}tock(e){return this._innerGraph.tock(e)}dispose(){this._innerGraph.clear(),this._innerGraph=null,this._innerRoot=null,super.dispose()}clearInnerGraph(){this._innerGraph.clear()}fromJSON(e){super.fromJSON(e),this._innerGraph.clear(),this._innerGraph.fromJSON(e.graph)}toJSON(){const e=super.toJSON();return e.graph=this._innerGraph.toJSON(),e}dump(e=""){super.dump(e),this.innerGraph.dump(e+" ")}onAddInnerRoot(e){}onRemoveInnerRoot(e){}activateInnerGraph(){this._innerGraph.activate()}deactivateInnerGraph(){this._innerGraph.deactivate()}}r.typeName="CGraph",r.graphIns={active:i.V5.Boolean("Graph.Active",!0)}},3474:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(80038),s=(n(90199),n(18894));const r=(e,t,n)=>{let i;const s=e.children;for(let e=0,n=s.length;e{let i;const s=e.children;for(let e=0,n=s.length;e{let i=[];const s=e.children;for(let e=0,n=s.length;ee.node.dispose())),this._parent&&this._parent.removeChild(this),this.graph._removeRoot(this),super.dispose()}getRootComponent(e){let t=this;for(;t._parent;)t=t._parent;return t?t.node.components.get(e):null}getParentComponent(e,t){let n=this;for(;;){if(n=n._parent,!n){const e=this.graph.parent;n=e?e.components.get(l):void 0}if(!n)return;const i=n.node.components.get(e,!0);if(i)return i;if(!t)return}}getParentNode(e,t){let n=this;for(;;){if(n=n._parent,!n){const e=this.graph.parent;n=e?e.components.get(l):void 0}if(!n)return;const i=n.node;if(i.is(e))return i;if(!t)return}}getSiblingNode(e){return this.getSiblingNodes(e)[0]}getSiblingNodes(e){const t=this._parent;return this.graph.nodes.getArray(e).filter((e=>{const n=e.components.get(l);return(n?n._parent:null)==t}))}hasChildComponents(e,t){return r(this,e,t)}getChildComponent(e,t){return o(this,e,t)}getChildComponents(e,t){return a(this,e,t)}traverseUp(e,t,n,i){if(e)if(t){const e=this.node.components.getArray();for(let t=0,n=e.length;t(e.emit(n),n.stopPropagation)))}propagateDown(e,t,n){this.traverseDown(!0,e,t,(e=>(e.emit(n),n.stopPropagation)))}addChild(e){if(e===this)throw new Error("can't add self as child");if(e._parent)throw new Error("can't add child, component has a parent");if(e.graph!==this.graph)throw new Error("can't add child, component in different graph");e._parent=this,this._children.push(e),this.graph._removeRoot(e);const t={type:"hierarchy",add:!0,remove:!1,parent:this,child:e};this.traverseUp(!0,!1,!0,(e=>e.emit(t))),this.traverseDown(!1,!1,!0,(e=>e.emit(t))),this.system.emit(t)}removeChild(e){if(e._parent!==this)throw new Error("component not a child of this");const t={type:"hierarchy",add:!1,remove:!0,parent:this,child:e};this.traverseUp(!0,!1,!0,(e=>e.emit(t))),this.traverseDown(!1,!1,!0,(e=>e.emit(t))),this.system.emit(t);const n=this._children.indexOf(e);this._children.splice(n,1),e._parent=null,this.graph._addRoot(e)}onComponent(e){if(e.object===this)return;const t={type:"child",add:e.add,remove:e.remove,component:e.object};this.traverseUp(!0,!1,!0,(e=>e.emit(t)))}toJSON(){const e=super.toJSON();return this._children.length>0&&(e.children=this._children.map((e=>e.id))),e}referencesFromJSON(e){super.referencesFromJSON(e);const t=this.system.components.getDictionary();e.children&&e.children.forEach((e=>{const n=t[e];this.addChild(n)}))}toString(){return super.toString()+` - children: ${this.children.length}`}dump(e=""){super.dump(e),this.children.length>0&&(console.log(e+"%cChildren","color: purple"),this.children.forEach((t=>t.node.dump(e+" "))))}}l.typeName="CHierarchy"},92989:(e,t,n)=>{"use strict";n.d(t,{F:()=>i,Z:()=>a});var i,s=n(80038),r=n(90199),o=n(47162);!function(e){e[e.Graph=0]="Graph",e[e.Main=1]="Main",e[e.System=2]="System"}(i||(i={}));class a extends s.ZP{constructor(){super(...arguments),this._scope=i.Graph,this._scopedGraph=null,this._activeNode=null}get nodeType(){return this.constructor.nodeType}get followNodeSelection(){return this.constructor.followNodeSelection}get followComponentSelection(){return this.constructor.followComponentSelection}get retainSelection(){return this.constructor.retainSelection}get scope(){return this._scope}set scope(e){this._scope=e,this._activeNode&&!this.isNodeInScope(this._activeNode)&&(this.activeNode=null)}get scopedGraph(){return this._scopedGraph}set scopedGraph(e){e!==this._scopedGraph&&(this._scopedGraph=e,this._activeNode&&!this.isNodeInScope(this._activeNode)&&(this.activeNode=null),this.onScopedNodes(),this.emit({type:"scoped-nodes"}))}get scopedNodes(){switch(this._scope){case i.Graph:return(this._scopedGraph?this._scopedGraph.innerGraph:this.graph).getNodes(this.nodeType);case i.Main:return this.getMainNodes(this.nodeType);case i.System:return this.getSystemNodes(this.nodeType)}}get activeNode(){return this._activeNode}set activeNode(e){const t=this.activeNode;if(e!==t){if(t&&this.deactivateNode(t),e){if(!this.isNodeInScope(e))throw new Error("can't activate, node out of scope");this.activateNode(e)}this._activeNode=e,this.onActiveNode(t,e),this.emit({type:"active-node",previous:t,next:e})}}get selection(){return this.getSystemComponent(o.Z)}create(){super.create(),this.system.nodes.on(r.Z,this.onNode,this),this.followNodeSelection&&this.selection.selectedNodes.on(this.nodeType,this.onSelectNode,this),this.followComponentSelection&&this.selection.selectedComponents.on(s.ZP,this.onSelectComponent,this)}dispose(){this.activeNode&&(this.activeNode=null),this.system.nodes.off(r.Z,this.onNode,this),this.followNodeSelection&&this.selection.selectedNodes.off(this.nodeType,this.onSelectNode,this),this.followComponentSelection&&this.selection.selectedComponents.off(s.ZP,this.onSelectComponent,this),super.dispose()}activateNode(e){}deactivateNode(e){}onActiveNode(e,t){}onScopedNodes(){}onNode(e){e.remove&&e.object===this.activeNode&&(this.activeNode=null),this.isNodeInScope(e.object)&&(this.onScopedNodes(),this.emit({type:"scoped-nodes"}))}onSelectNode(e){const t=e.object;this.isNodeInScope(t)&&(e.add?this.activeNode=t:e.remove&&!this.retainSelection&&t===this.activeNode&&(this.activeNode=null))}onSelectComponent(e){const t=e.object.node;t.is(this.nodeType)&&this.onSelectNode({type:t.typeName,object:t,add:e.add,remove:e.remove})}isNodeInScope(e){if(!e.is(this.nodeType))return!1;switch(this._scope){case i.Graph:const t=this._scopedGraph?this._scopedGraph.innerGraph:this.graph;return e.graph===t;case i.Main:return e.graph===this.system.graph;case i.System:return!0}return!1}}a.typeName="CNodeProvider",a.nodeType=r.Z,a.followNodeSelection=!0,a.followComponentSelection=!1,a.retainSelection=!0},26220:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s extends i.ZP{constructor(e,t){super(e,t),this.outs=this.addOutputs(s.pulseOuts),this._tockUpdated=!1,this.addEvent("pulse"),this.onAnimationFrame=this.onAnimationFrame.bind(this),this.context={time:new Date,secondsElapsed:0,secondsDelta:0,frameNumber:0},this._secondsStarted=.001*Date.now(),this._secondsStopped=this._secondsStarted,this._animHandler=0,this._pulseEvent={type:"pulse",context:this.context,systemUpdated:!1}}start(){0===this._animHandler&&(this._secondsStopped>0&&(this._secondsStarted+=.001*Date.now()-this._secondsStopped,this._secondsStopped=0),this._animHandler=window.requestAnimationFrame(this.onAnimationFrame))}stop(){0!==this._animHandler&&(0===this._secondsStopped&&(this._secondsStopped=.001*Date.now()),window.cancelAnimationFrame(this._animHandler),this._animHandler=0)}pulse(e){const{outs:t,context:n,_pulseEvent:i}=this;n.time.setTime(e);const s=.001*e-this._secondsStarted;n.secondsDelta=s-n.secondsElapsed,n.secondsElapsed=s,n.frameNumber++,t.time.setValue(n.secondsElapsed),t.frame.setValue(n.frameNumber);const r=this.system.graph.tick(n);i.systemUpdated=r||this._tockUpdated,this.emit(i),this._tockUpdated=this.system.graph.tock(n)}onAnimationFrame(){this.pulse(Date.now()),this._animHandler=window.requestAnimationFrame(this.onAnimationFrame)}}s.typeName="CPulse",s.isSystemSingleton=!0,s.pulseOuts={time:i.V5.Number("Pulse.Time"),frame:i.V5.Integer("Pulse.Frame")}},47162:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i=n(97444),s=n(89809),r=n(80038),o=n(90199),a=n(18894),l=n(82942);class c{constructor(e,t){this._args=e,this._props=t,this._args=e,this._state=null}get name(){return this._props.name||this._props.do.name.replace(/([A-Z])/g," $1").replace(/^./,(e=>e.toUpperCase()))}do(){if(this._state)throw new Error("undo should be called before execute can be applied again");this._state=this._props.do.apply(this._props.target,this._args)}undo(){if(!this._props.undo)throw new Error("can't undo this command");if(!this._state)throw new Error("execute should be called before undo can be applied");this._props.undo.call(this._props.target,this._state),this._state=null}canDo(){return!this._props.canDo||this._props.canDo()}canUndo(){return!!this._props.undo}}class h extends l.Z{constructor(e){super(),this.addEvent("update"),this.stack=[],this.pointer=-1,this.capacity=void 0!==e?e:h.defaultCapacity}register(e){let t;t="function"==typeof e?e:t=>new c(t,e);return(...e)=>{const n=t(e);this.do(n)}}setCapacity(e){for(this.capacity=e;this.stack.length>e;)this.stack.shift(),this.pointer--;this.pointer<0&&(this.stack=[],this.pointer=-1)}do(e){console.log(`Commander.do - '${e.name}'`),e.do(),e.canUndo()&&(this.stack.splice(this.pointer+1),this.stack.push(e),this.stack.length>this.capacity&&this.stack.shift(),this.pointer=this.stack.length-1,this.emit("update"))}undo(){if(this.pointer>=0){this.stack[this.pointer].undo(),this.pointer--,this.emit("update")}}redo(){if(this.pointer0&&(this.stack=[],this.pointer=-1,this.emit("update"))}canUndo(){return this.pointer>=0}canRedo(){return this.pointer=0?"Undo "+this.stack[this.pointer].name:"Can't Undo"}getRedoText(){return this.pointerthis.onSelectNode(e.object,e.add))),this.selectedComponents.on(r.ZP,(e=>this.onSelectComponent(e.object,e.add))),this._activeGraph=this.system.graph}getSelectedNode(e){return this.selectedNodes.get(e,!0)}getSelectedNodes(e){return this.selectedNodes.getArray(e)}getSelectedComponent(e){return this.selectedComponents.get(e,!0)}getSelectedComponents(e){return this.selectedComponents.getArray(e)}get activeGraph(){return this._activeGraph}set activeGraph(e){if(e!==this.activeGraph){this.clearSelection();const t=this._activeGraph;this._activeGraph=e,this.onActiveGraph(e),this.emit({type:"active-graph",previous:t,next:e})}}hasParentGraph(){return this._activeGraph&&this._activeGraph.parent}activateParentGraph(){this._activeGraph&&this._activeGraph.parent.graph&&(this.activeGraph=this._activeGraph.parent.graph)}hasChildGraph(){return this.selectedComponents.has(a.ZP)}activateChildGraph(){const e=this.selectedComponents.get(a.ZP,!0);e&&(this.activeGraph=e.innerGraph)}create(){super.create(),this.system.nodes.on(o.Z,this.onSystemNode,this),this.system.components.on(r.ZP,this.onSystemComponent,this)}dispose(){this.system.nodes.off(o.Z,this.onSystemNode,this),this.system.components.off(r.ZP,this.onSystemComponent,this),super.dispose()}createActions(e){return{selectNode:e.register({name:"Select Node",do:this.selectNode,target:this}),selectComponent:e.register({name:"Select Component",do:this.selectComponent,target:this}),clearSelection:e.register({name:"Clear Selection",do:this.clearSelection,target:this})}}nodeContainsSelectedComponent(e){const t=e.components.getArray();for(let e=0,n=t.length;e{"use strict";n.d(t,{P:()=>r,Z:()=>c});const i=Math.PI,s=.5*i;var r;!function(e){e[e.Linear=0]="Linear",e[e.EaseQuad=1]="EaseQuad",e[e.EaseInQuad=2]="EaseInQuad",e[e.EaseOutQuad=3]="EaseOutQuad",e[e.EaseCubic=4]="EaseCubic",e[e.EaseInCubic=5]="EaseInCubic",e[e.EaseOutCubic=6]="EaseOutCubic",e[e.EaseQuart=7]="EaseQuart",e[e.EaseInQuart=8]="EaseInQuart",e[e.EaseOutQuart=9]="EaseOutQuart",e[e.EaseQuint=10]="EaseQuint",e[e.EaseInQuint=11]="EaseInQuint",e[e.EaseOutQuint=12]="EaseOutQuint",e[e.EaseSine=13]="EaseSine",e[e.EaseInSine=14]="EaseInSine",e[e.EaseOutSine=15]="EaseOutSine"}(r||(r={}));const o={Linear:function(e){return e},EaseQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},EaseInQuad:function(e){return e*e},EaseOutQuad:function(e){return e*(2-e)},EaseCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},EaseInCubic:function(e){return e*e*e},EaseOutCubic:function(e){return--e*e*e+1},EaseQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},EaseInQuart:function(e){return e*e*e*e},EaseOutQuart:function(e){return 1- --e*e*e*e},EaseQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},EaseInQuint:function(e){return e*e*e*e*e},EaseOutQuint:function(e){return 1+--e*e*e*e*e},EaseSine:function(e){return-.5*(Math.cos(e*i)-1)},EaseInSine:function(e){return 1-Math.cos(e*s)},EaseOutSine:function(e){return Math.sin(e*s)}};var a=n(80038),l=n(84292);class c extends a.ZP{constructor(){super(...arguments),this.ins=this.addInputs(c.ins),this.outs=this.addOutputs(c.outs),this.targets=[],this.states={},this._currentValues=null,this._targetState=null,this._startTime=0,this._easingFunction=null}getState(e){return this.states[e]}setState(e){return e.id=e.id||(0,l.Z)(6),this.states[e.id]=e,e.id}deleteState(e){delete this.states[e]}clear(){this.targets.forEach((e=>e.property.off("dispose",this.onPropertyDispose,this))),this.targets.length=0,this.states={},this._currentValues=null,this._targetState=null,this._startTime=0,this._easingFunction=null}dispose(){this.clear(),super.dispose()}tweenTo(e,t){const n=this.states[e],i=this.outs;if(n)return this._targetState=n,this._currentValues=this.getCurrentValues(),this._startTime=t,this._easingFunction=(s=n.curve,o[r[s]]),i.switched.setValue(!1),i.tweening.setValue(!0),i.start.set(),!0;var s}update(e){const t=this.ins,n=this.states,i=t.id.value,s=n[i];if(s){if((t.tween.changed||t.recall.changed)&&(t.curve.setValue(s.curve),t.duration.setValue(s.duration),t.threshold.setValue(s.threshold)),t.tween.changed)return this.tweenTo(i,e.secondsElapsed),!0;if(t.recall.changed)return this.setValues(s.values),!0;(t.curve.changed||t.duration.changed||t.threshold.changed)&&(s.curve=t.curve.value,s.duration=t.duration.value,s.threshold=t.threshold.value),t.store.changed&&(s.values=this.getCurrentValues()),t.delete.changed&&delete n[i]}else if(i&&t.store.changed){const e={id:this.ins.id.value,curve:this.ins.curve.getValidatedValue(),duration:this.ins.duration.value,threshold:this.ins.threshold.value,values:this.getCurrentValues()};n[e.id]=e}return!0}tick(e){const t=this._targetState;if(!t)return!1;const n=this.outs,i=this._currentValues,s=this._startTime,r=e.secondsElapsed-s,o=r/t.duration;if(o<1){const e=this._easingFunction(o),s=o>=t.threshold&&!n.switched.value;this.setValues(i,t.values,e,s),n.time.setValue(r),n.completed.setValue(o),s&&(n.switched.setValue(!0),n.switch.set())}else this.setValues(i,t.values,1,!n.switched.value),n.tweening.setValue(!1),n.time.setValue(t.duration),n.completed.setValue(1),n.end.set(),n.switched.value||n.switched.setValue(!0),this._currentValues=null,this._targetState=null,this._startTime=0,this._easingFunction=null;return!0}addTargetProperty(e){if("object"===e.type||e.schema.event)throw new Error("can't add object or event properties");if(this.getTarget(e))throw new Error("can't add, target already exists");e.on("dispose",this.onPropertyDispose,this);const t="number"===e.type&&!e.schema.options,n=e.isArray();this.targets.push({property:e,isNumber:t,isArray:n});const i=this.states,s=Object.keys(i);for(let t=0,n=s.length;t{const t=this.getProperty(e.id,e.key);return{property:t,isNumber:!!t&&"number"===t.type&&!t.schema.options,isArray:!!t&&t.isArray()}}))),e.states&&e.states.forEach((e=>this.states[e.id]=e)),this._startTime=0}toJSON(){const e=super.toJSON(),t=this.stateToJSON();return t&&(e.state=t),e}stateToJSON(){const e={},t=this.targets;t.length>0&&(e.targets=t.map((e=>({id:e.property.group.linkable.id,key:e.property.key}))));const n=Object.keys(this.states);return n.length>0&&(e.states=n.map((e=>this.states[e]))),e}getTargetProperties(){return this.targets.map((e=>e.property))}onPropertyDispose(e){e.property.off("dispose",this.onPropertyDispose,this);const t=this.getTarget(e.property);this.removeTarget(t)}removeTarget(e){const t=this.targets.indexOf(e);this.targets.splice(t,1),this.removeChannel(t)}removeChannel(e){const t=this.states,n=Object.keys(t);for(let i=0,s=n.length;it.property===e))}getProperty(e,t){const n=this.system.components.getById(e);return n?n.ins[t]:null}setValues(e,t,n,i){const s=this.targets;for(let r=0,o=s.length;r{"use strict";n.d(t,{V5:()=>l});var i=n(82507);const s={xyzw:["X","Y","Z","W"],rgba:["R","G","B","A"]},r=function(e){return void 0===e||"object"==typeof e&&!Array.isArray(e)?e:{preset:e}},o=function(e,t,n){return{path:t,schema:(n=r(n))?Object.assign({},e,n):e}},a={Number:{preset:0},Integer:{preset:0,step:1,speed:.34,precision:0},Natural:{preset:0,step:1,speed:.34,precision:0,min:0},Unit:{preset:0,min:0,max:1,bar:!0},Percent:{preset:0,min:0,max:1,bar:!0,percent:!0},Vector2:{preset:[0,0]},Vector3:{preset:[0,0,0]},Vector4:{preset:[0,0,0,0]},Matrix2:{preset:[1,0,0,1]},Matrix3:{preset:[1,0,0,0,1,0,0,0,1]},Matrix4:{preset:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Scale:{preset:1},Scale2:{preset:[1,1]},Scale3:{preset:[1,1,1]},IntVec2:{preset:[0,0],step:1,speed:.34,precision:0},IntVec3:{preset:[0,0,0],step:1,speed:.34,precision:0},ColorRGB:{preset:[1,1,1],semantic:"color",labels:s.rgba,min:0,max:1,bar:!0},ColorRGBA:{preset:[1,1,1,1],semantic:"color",labels:s.rgba,min:0,max:1,bar:!0},Boolean:{preset:!1},String:{preset:""},AssetPath:{preset:"",semantic:"asset-path"},Object:{preset:null,objectType:Object},Event:{preset:0,event:!0}},l={Property:(e,t)=>o(void 0,e,t),Number:(e,t)=>o(a.Number,e,t),Integer:(e,t)=>o(a.Integer,e,t),Natural:(e,t)=>o(a.Natural,e,t),Unit:(e,t)=>o(a.Unit,e,t),Percent:(e,t)=>o(a.Percent,e,t),Vector2:(e,t)=>o(a.Vector2,e,t),Vector3:(e,t)=>o(a.Vector3,e,t),Vector4:(e,t)=>o(a.Vector4,e,t),IntVec2:(e,t)=>o(a.IntVec2,e,t),IntVec3:(e,t)=>o(a.IntVec3,e,t),Matrix2:(e,t)=>o(a.Matrix2,e,t),Matrix3:(e,t)=>o(a.Matrix3,e,t),Matrix4:(e,t)=>o(a.Matrix4,e,t),Scale:(e,t)=>o(a.Scale,e,t),Scale2:(e,t)=>o(a.Scale2,e,t),Scale3:(e,t)=>o(a.Scale3,e,t),ColorRGB:(e,t)=>o(a.ColorRGB,e,t),ColorRGBA:(e,t)=>o(a.ColorRGBA,e,t),Boolean:(e,t)=>o(a.Boolean,e,t),String:(e,t)=>o(a.String,e,t),AssetPath:(e,t)=>o(a.AssetPath,e,t),Enum:(e,t,n)=>function(e,t,n){n=r(n);const s={enum:e,options:(0,i.q)(e),preset:0};return{path:t,schema:n?Object.assign({},s,n):s}}(t,e,n),Option:(e,t,n)=>function(e,t,n){const i={options:e,preset:0};return{path:t,schema:(n=r(n))?Object.assign({},i,n):i}}(t,e,n),Object:(e,t,n)=>function(e,t,n){const i={preset:null,objectType:e};return{path:t,schema:(n=r(n))?Object.assign({},i,n):i}}(t,e,n),Event:(e,t)=>o(a.Event,e,t)}},87156:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o,t:()=>i});var i,s=n(26775),r=n(73130);!function(e){e[e.Single=0]="Single",e[e.HorizontalSplit=1]="HorizontalSplit",e[e.VerticalSplit=2]="VerticalSplit",e[e.Quad=3]="Quad"}(i||(i={}));class o extends r.Z{constructor(e,t,n){super(e,t,n),this._layout=i.Quad,this._horizontalSplit=.5,this._verticalSplit=.5,this.addEvent("layout"),this.layout=i.Single}set layout(e){if(e===this._layout)return;this._layout=e;const t=this.viewports;switch(this._layout){case i.Single:this.setViewportCount(1);break;case i.HorizontalSplit:case i.VerticalSplit:this.setViewportCount(2);break;case i.Quad:this.setViewportCount(4)}this.updateSplitPositions(),t[1]&&(t[1].setBuiltInCamera(s.mP.Orthographic,s.LY.Top),t[1].enableCameraControl(!0).orientationEnabled=!1),t[2]&&(t[2].setBuiltInCamera(s.mP.Orthographic,s.LY.Left),t[2].enableCameraControl(!0).orientationEnabled=!1),t[3]&&(t[3].setBuiltInCamera(s.mP.Orthographic,s.LY.Front),t[3].enableCameraControl(!0).orientationEnabled=!1),this.emit({type:"layout",layout:e})}get layout(){return this._layout}set horizontalSplit(e){this._horizontalSplit=e,this.updateSplitPositions()}get horizontalSplit(){return this._horizontalSplit}set verticalSplit(e){this._verticalSplit=e,this.updateSplitPositions()}get verticalSplit(){return this._verticalSplit}updateSplitPositions(){const e=this._horizontalSplit,t=this._verticalSplit;switch(this._layout){case i.Single:this.viewports[0].setSize(0,0,1,1);break;case i.HorizontalSplit:this.viewports[0].setSize(0,0,e,1),this.viewports[1].setSize(e,0,1-e,1);break;case i.VerticalSplit:this.viewports[0].setSize(0,1-t,1,t),this.viewports[1].setSize(0,0,1,1-t);break;case i.Quad:this.viewports[0].setSize(0,1-t,e,t),this.viewports[1].setSize(e,1-t,1-e,t),this.viewports[2].setSize(0,0,e,1-t),this.viewports[3].setSize(e,0,1-e,1-t)}}}},73130:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var i=n(64702),s=n(7177),r=n(75544),o=n(82942),a=n(3474),l=n(73902),c=n(12197),h=n(26060),d=n(15271),u=n(26775);class p extends o.Z{constructor(e,t,n){super(),this.viewports=[],this.rendererComponent=null,this.targetViewport=null,this.targetObject3D=null,this.targetComponent=null,this.targetScene=null,this.targetCamera=null,this.defaultScene=new i.x,this.defaultCamera=new u.ZP,this.system=e,this.canvas=t,this.overlay=n,this.renderer=new s.C({canvas:t,antialias:!0}),this.renderer.autoClear=!1,this.renderer.outputColorSpace=r.KI_,this.picker=new h.Z(this.renderer)}dispose(){this.renderer.dispose(),this.viewports.forEach((e=>e.dispose()))}get canvasWidth(){return this.canvas.width}get canvasHeight(){return this.canvas.height}attach(){const e=this.canvasWidth,t=this.canvasHeight;this.viewports.forEach((n=>n.setCanvasSize(e,t))),this.renderer.setSize(e,t,!1),this.rendererComponent=this.system.getComponent(d.Z,!0),this.rendererComponent.attachView(this)}detach(){this.rendererComponent=this.system.getComponent(d.Z,!0),this.rendererComponent.detachView(this),this.rendererComponent=null}renderImage(e,t,n,i){const s=this.canvas.width,r=this.canvas.height;this.setRenderSize(e,t),this.render();const o=this.canvas.toDataURL(n,i);return this.setRenderSize(s,r),o}render(){const e=this.rendererComponent.activeSceneComponent;if(!e)return;let t=e.scene,n=e.activeCamera;t&&n||(t=this.defaultScene,n=this.defaultCamera);const i=this.renderer;i.clear(),i.__view=this;const s=this.viewports;for(let e=0,r=s.length;en.setCanvasSize(e,t))),this.renderer.xr.isPresenting||this.renderer.setSize(e,t,!1)}resize(){this.setRenderSize(this.canvas.clientWidth,this.canvas.clientHeight),this.renderer.xr.isPresenting||this.render()}setViewportCount(e){const t=this.viewports;for(let n=e;n{"use strict";n.d(t,{u:()=>h,Z:()=>g});var i=n(2837),s=n(8035),r=n(75809),o=n(56963),a=n(31599),l=n(44428);class c extends l.j{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}var h,d=n(19588),u=n(93113);!function(e){e[e.Solid=0]="Solid",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient"}(h||(h={}));class p extends s.K{constructor(){super(new f,new m),this.frustumCulled=!1,this.renderOrder=-1/0,this.matrixAutoUpdate=!1}dispose(){this.geometry.dispose(),this.material.dispose()}updateMatrixWorld(e){}}class f extends r.u{constructor(){super();const e=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),t=new o.v(e,5);this.setIndex([0,1,2,0,2,3]),this.setAttribute("position",new a.k(t,3,0,!1)),this.setAttribute("uv",new a.k(t,2,3,!1))}}class m extends c{constructor(){super(...arguments),this.depthTest=!1,this.depthWrite=!1,this.transparent=!1,this.uniforms={style:{value:h.LinearGradient},color0:{value:new d.P(.15,.2,.25)},color1:{value:new d.P(0,0,0)},noise:{value:.02}},this.vertexShader=["precision highp float;","attribute vec3 position;","attribute vec2 uv;","varying vec2 ndc;","void main() {"," ndc = position.xy;"," gl_Position = vec4(position, 1.0);","}"].join("\n"),this.fragmentShader=["precision highp float;","uniform vec3 color0;","uniform vec3 color1;","uniform float noise;","uniform int style;","varying vec2 ndc;","float rand(vec2 co) {","float dt = dot(co.xy ,vec2(12.9898, 78.233));","float sn = mod(dt, 3.14);","return fract(sin(sn) * 43758.5453);","}","void main() {"," float f = style == 0 ? 0.0 : (style == 1 ? ndc.y * 0.5 + 0.5 : length(ndc) * 0.707);"," gl_FragColor = vec4(mix(color0, color1, f) + noise * rand(ndc), 1.0);","}"].join("\n")}set style(e){this.uniforms.style.value=e}get style(){return this.uniforms.style.value}set color0(e){if(e instanceof u.I){const t=this.uniforms.color0.value;t.x=e.r,t.y=e.g,t.z=e.b}else this.uniforms.color0.value.copy(e)}get color0(){return this.uniforms.color0.value}set color1(e){if(e instanceof u.I){const t=this.uniforms.color1.value;t.x=e.r,t.y=e.g,t.z=e.b}else this.uniforms.color1.value.copy(e)}get color1(){return this.uniforms.color1.value}set noise(e){this.uniforms.noise.value=e}get noise(){return this.uniforms.noise.value}}class g extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(g.backgroundIns),this.object3D=new p}get background(){return this.object3D}update(e){super.update(e);const t=this.ins,n=this.background.material;return t.style.changed&&(n.style=t.style.getValidatedValue()),t.color0.changed&&n.color0.fromArray(t.color0.value),t.color1.changed&&n.color1.fromArray(t.color1.value),t.noise.changed&&(n.noise=t.noise.value),!0}dispose(){this.background.dispose(),super.dispose()}}g.typeName="CBackground",g.backgroundIns={style:i.V5.Enum("Background.Style",h,h.RadialGradient),color0:i.V5.ColorRGB("Background.Color0",[.2,.25,.3]),color1:i.V5.ColorRGB("Background.Color1",[.01,.03,.05]),noise:i.V5.Number("Background.Noise",{min:0,max:1,bar:!0,preset:.02})}},76288:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(77656),s=n(80038),r=n(16967);class o extends r.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(o.dirLightIns),this.object3D=new i.O,this.light.target.matrixAutoUpdate=!1}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;if((n.color.changed||n.intensity.changed)&&(t.intensity=n.intensity.value*Math.PI),(n.position.changed||n.target.changed)&&(t.position.fromArray(n.position.value),t.target.position.fromArray(n.target.value),t.updateMatrix(),t.target.updateMatrix()),n.shadowSize.changed){const e=t.shadow.camera,i=.5*n.shadowSize.value;e.left=e.bottom=-i,e.right=e.top=i,e.near=.05*n.shadowSize.value,e.far=50*n.shadowSize.value,e.updateProjectionMatrix()}return!0}onAddToParent(e){super.onAddToParent(e),e.add(this.light.target)}onRemoveFromParent(e){super.onRemoveFromParent(e),e.remove(this.light.target)}}o.typeName="CDirectionalLight",o.dirLightIns={position:s.V5.Vector3("Light.Position"),target:s.V5.Vector3("Light.Target",[0,-1,0]),shadowSize:s.V5.Number("Shadow.Size",100)}},38080:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(s.ins),this.outs=this.addOutputs(s.outs),this._fullscreenElement=null,this.onFullscreenChange=this.onFullscreenChange.bind(this);const n=document.documentElement,i=n.requestFullscreen||n.mozRequestFullScreen||n.webkitRequestFullscreen;this.outs.fullscreenAvailable.setValue(!!i),this.ins.toggle.on("value",this.toggle,this)}get fullscreenElement(){return this._fullscreenElement}set fullscreenElement(e){e!==this._fullscreenElement&&(this._fullscreenElement&&this._fullscreenElement.removeEventListener("fullscreenchange",this.onFullscreenChange),this._fullscreenElement=e,e&&e.addEventListener("fullscreenchange",this.onFullscreenChange))}update(e){return!0}toggle(){const e=this.outs,t=this._fullscreenElement;if(t){const n=e.fullscreenActive.value;if(!n&&e.fullscreenAvailable.value)t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);else if(n){const e=document;e.exitFullscreen?e.exitFullscreen():e.cancelFullScreen?e.cancelFullScreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitCancelFullScreen&&e.webkitCancelFullScreen()}}}onFullscreenChange(e){const t=document,n=t.fullscreenElement||t.mozFullScreenElement||t.webkitFullscreenElement;this.outs.fullscreenActive.setValue(!!n)}}s.typeName="CFullscreen",s.ins={toggle:i.V5.Event("Fullscreen.Toggle")},s.outs={fullscreenAvailable:i.V5.Boolean("Fullscreen.Available",!1),fullscreenActive:i.V5.Boolean("Fullscreen.Active",!1)}},16967:(e,t,n)=>{"use strict";n.d(t,{B:()=>i,Z:()=>a});var i,s=n(80038),r=n(2837);!function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High"}(i||(i={}));const o={[i.Low]:512,[i.Medium]:1024,[i.High]:2048};class a extends r.ZP{constructor(){super(...arguments),this.ins=this.addInputs(a.lightIns)}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;if((n.color.changed||n.intensity.changed)&&(t.color.fromArray(n.color.value),t.intensity=n.intensity.value),"shadow"in t&&(n.shadowEnabled.changed&&(t.castShadow=n.shadowEnabled.value),n.shadowBlur.changed&&(t.shadow.radius=n.shadowBlur.value),n.shadowResolution.changed)){const e=o[n.shadowResolution.getValidatedValue()];t.shadow.mapSize.set(e,e),t.shadow.map=null}return!0}}a.typeName="CLight",a.lightIns={color:s.V5.ColorRGB("Light.Color"),intensity:s.V5.Number("Light.Intensity",1),shadowEnabled:s.V5.Boolean("Shadow.Enabled"),shadowResolution:s.V5.Enum("Shadow.Resolution",i,i.Medium),shadowBlur:s.V5.Number("Shadow.Blur",1)}},2837:(e,t,n)=>{"use strict";n.d(t,{V5:()=>r.V5,VZ:()=>l.VZ,ZP:()=>h});var i=n(19588),s=n(71050),r=n(80038),o=n(26060),a=n(36283),l=n(92642);const c=new i.P;class h extends r.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(h.object3DIns),this.outs=this.addOutputs(h.object3DOuts),this._object3D=null,this._isPickable=!1,this.addEvent("object"),this.node.components.on(this.parentComponentClass,this._onParent,this)}get parentComponentClass(){return this.constructor.parentComponentClass}get parentComponent(){return this.node.components.get(this.parentComponentClass,!0)}get transform(){return this.node.components.get(l.ZP,!0)}get scene(){const e=this.transform;return e?e.getParentComponent(a.Z,!0):void 0}get object3D(){return this._object3D}set object3D(e){const t=this._object3D;if(t&&(t.userData.component=null,this.unregisterPickableObject3D(t,!0),t.parent&&this.onRemoveFromParent(t.parent)),this.emit({type:"object",current:t,next:e}),this._object3D=e,e){e.userData.component=this,e.matrixAutoUpdate=!1,e.visible=this.ins.visible.value,this.registerPickableObject3D(e,!0);const t=this.parentComponent;t&&this.onAddToParent(t.object3D)}}update(e){const{visible:t,pickable:n}=this.ins;return t.changed&&this._object3D&&(this._object3D.visible=t.value),n.changed&&n.value!==this._isPickable&&(this._isPickable=n.value,n.value?this.enablePointerEvents():this.disablePointerEvents()),!0}dispose(){this.object3D=null,this.ins.pickable.value&&this.disablePointerEvents(),this.node.components.off(this.parentComponentClass,this._onParent,this),super.dispose()}preRender(e){}postRender(e){}toString(){return super.toString()+(this._object3D?` - type: ${this._object3D.type}`:" - (null)")}onPointer(e){const t=this.outs;"pointer-down"===e.type?(t.pointerDown.set(),t.pointerActive.setValue(!0)):"pointer-up"===e.type&&(t.pointerUp.set(),t.pointerActive.setValue(!1)),e.stopPropagation=!0}enablePointerEvents(){this.on("pointer-down",this.onPointer,this),this.on("pointer-up",this.onPointer,this)}disablePointerEvents(){this.off("pointer-down",this.onPointer,this),this.off("pointer-up",this.onPointer,this);const e=this.outs;e.pointerActive.value&&(e.pointerUp.set(),e.pointerActive.setValue(!1))}updateTransform(){const e=this._object3D;if(!e)return;const{position:t,rotation:n,order:i,scale:r}=this.ins;if(t.changed||n.changed||i.changed||r.changed){e.position.fromArray(t.value),c.fromArray(n.value).multiplyScalar(s.M8.DEG2RAD);const o=i.getOptionText();e.rotation.setFromVector3(c,o),e.scale.fromArray(r.value),e.updateMatrix()}return!0}onAddToParent(e){e.add(this._object3D)}onRemoveFromParent(e){e.remove(this._object3D)}addObject3D(e){this._object3D.add(e),this.registerPickableObject3D(e,!0)}removeObject3D(e){this.unregisterPickableObject3D(e,!0),this._object3D.remove(e)}registerPickableObject3D(e,t){o.Z.add(e,t)}unregisterPickableObject3D(e,t){o.Z.remove(e,t)}_onParent(e){this._object3D&&!this._object3D.parent&&e.add&&this.onAddToParent(e.object.object3D)}}h.typeName="CObject3D",h.parentComponentClass=l.ZP,h.object3DIns={visible:r.V5.Boolean("Object.Visible",!0),pickable:r.V5.Boolean("Object.Pickable")},h.object3DOuts={pointerDown:r.V5.Event("Pointer.Down"),pointerUp:r.V5.Event("Pointer.Up"),pointerActive:r.V5.Boolean("Pointer.Active")},h.transformIns=l.ZP.transformIns,h.prototype.preRender=null,h.prototype.postRender=null},18345:(e,t,n)=>{"use strict";n.d(t,{Z:()=>W});var i=n(80038),s=n(52226),r=n(47162),o=n(19588),a=n(82587),l=n(28092),c=n(37840),h=n(75809),d=n(35322),u=n(64026),p=n(93113),f=n(79961);const m=new o.P,g=new a.y;class A extends l.e{constructor(e,t){t=Object.assign({},A.defaultProps,t);const n=new c.Z;n.makeEmpty(),(0,f.sN)(e,n);const i=t.length,s=[n.min.x,n.min.y,n.min.z],r=[n.max.x,n.max.y,n.max.z],o=[(r[0]-s[0])*i,(r[1]-s[1])*i,(r[2]-s[2])*i];let a;a=isFinite(o[0])&&isFinite(o[1])&&isFinite(o[2])?[s[0],s[1],s[2],s[0]+o[0],s[1],s[2],s[0],s[1],s[2],s[0],s[1]+o[1],s[2],s[0],s[1],s[2],s[0],s[1],s[2]+o[2],r[0],s[1],s[2],r[0]-o[0],s[1],s[2],r[0],s[1],s[2],r[0],s[1]+o[1],s[2],r[0],s[1],s[2],r[0],s[1],s[2]+o[2],s[0],r[1],s[2],s[0]+o[0],r[1],s[2],s[0],r[1],s[2],s[0],r[1]-o[1],s[2],s[0],r[1],s[2],s[0],r[1],s[2]+o[2],s[0],s[1],r[2],s[0]+o[0],s[1],r[2],s[0],s[1],r[2],s[0],s[1]+o[1],r[2],s[0],s[1],r[2],s[0],s[1],r[2]-o[2],s[0],r[1],r[2],s[0]+o[0],r[1],r[2],s[0],r[1],r[2],s[0],r[1]-o[1],r[2],s[0],r[1],r[2],s[0],r[1],r[2]-o[2],r[0],s[1],r[2],r[0]-o[0],s[1],r[2],r[0],s[1],r[2],r[0],s[1]+o[1],r[2],r[0],s[1],r[2],r[0],s[1],r[2]-o[2],r[0],r[1],s[2],r[0]-o[0],r[1],s[2],r[0],r[1],s[2],r[0],r[1]-o[1],s[2],r[0],r[1],s[2],r[0],r[1],s[2]+o[2],r[0],r[1],r[2],r[0]-o[0],r[1],r[2],r[0],r[1],r[2],r[0],r[1]-o[1],r[2],r[0],r[1],r[2],r[0],r[1],r[2]-o[2]]:[-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1,0,0,1];const l=new h.u;l.setAttribute("position",new d.a$(a,3));super(l,new u.n({color:t.color,depthTest:!1})),this.renderOrder=1,this.onBeforeRender=()=>{e.updateMatrixWorld(!1),this.matrixWorld.copy(e.matrixWorld)}}dispose(){this.parent&&this.parent.remove(this),this.geometry.dispose()}static expandBoundingBox(e,t,n){const i=e.geometry;if(void 0!==i){let s=e;for(g.identity();s&&s!==t;)g.premultiply(s.matrix),s=s.parent;if(i.isGeometry){const e=i.vertices;for(let t=0,i=e.length;t0)&&f.push(t,s,a),(e!==n-1||l.9&&o<.1&&(t<.2&&(r[e+0]+=1),n<.2&&(r[e+2]+=1),i<.2&&(r[e+4]+=1))}}()}(),this.setAttribute("position",new d.a$(s,3)),this.setAttribute("normal",new d.a$(s.slice(),3)),this.setAttribute("uv",new d.a$(r,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new O(e.vertices,e.indices,e.radius,e.details)}}class U extends O{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new U(e.radius,e.detail)}}const F=new o.P,V=new p.I,Q=new p.I;class z extends _.T{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const i=new U(t);i.rotateY(.5*Math.PI),this.material=new T.v({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),r=new Float32Array(3*s.count);i.setAttribute("color",new d.Tl(r,3)),this.add(new I.K(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");V.copy(this.light.color),Q.copy(this.light.groundColor);for(let e=0,n=t.count;e{e.on("after-render",this.onSceneAfterRender,this)}),(e=>{e.off("after-render",this.onSceneAfterRender,this)}))}dispose(){this._sceneTracker.dispose(),this.system.off("pointer-up",this.onPointerUp,this),this._sceneTracker.dispose(),super.dispose()}update(){return!0}onSelectNode(e,t){super.onSelectNode(e,t);const n=e.getComponent(y.ZP,!0);n&&this.updateBracket(n,t)}onSelectComponent(e,t){super.onSelectComponent(e,t),(e instanceof v.ZP||e instanceof y.ZP)&&this.updateBracket(e,t)}onPointerUp(e){this.ins.viewportPicking.value&&e.isPrimary&&!e.isDragging&&(e.component?this.selectComponent(e.component,e.ctrlKey):e.ctrlKey||this.clearSelection())}onSceneAfterRender(e){if(!this.ins.viewportBrackets.value)return;const t=e.context.renderer,n=e.context.camera;for(let e of this._brackets.values())H.some((([t])=>e instanceof t))&&(e.update(),e.updateWorldMatrix(!0,!1)),t.render(e,n)}updateBracket(e,t){if(e){if(t){const t=e.object3D;if(t){let n;for(let[e,i]of H)t.children[0]instanceof i&&(n=new e(t.children[0],1),n.updateWorldMatrix(!0,!1));n||(n=new A(e.object3D)),this._brackets.set(e,n)}}else{const t=this._brackets.get(e);t&&(this._brackets.delete(e),t.dispose())}this.changed=!0}}}W.typeName="CPickSelection"},15271:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i,s=n(75544),r=n(80038),o=n(26220);!function(e){e[e.Basic=0]="Basic",e[e.PCF=1]="PCF",e[e.PCFSoft=2]="PCFSoft"}(i||(i={}));const a={[i.Basic]:s._MY,[i.PCF]:s._iA,[i.PCFSoft]:s.ntZ};class l extends r.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(l.ins),this.outs=this.addOutputs(l.outs),this.views=[],this._activeSceneComponent=null,this._forceRender=!1,this.addEvents("active-scene","active-camera")}get activeSceneComponent(){return this._activeSceneComponent}set activeSceneComponent(e){if(e!==this._activeSceneComponent){const t=this._activeSceneComponent,n=this.activeCameraComponent;t&&t.off("active-camera",this.onActiveCamera,this),e&&e.on("active-camera",this.onActiveCamera,this),this._activeSceneComponent=e;const i=this.activeCameraComponent,s={type:"active-scene",previous:t,next:e};this.emit(s);const r={type:"active-camera",previous:n,next:i};this.emit(r)}}get activeSceneGraph(){return this._activeSceneComponent?this._activeSceneComponent.graph:null}get activeScene(){return this._activeSceneComponent?this._activeSceneComponent.scene:null}get activeCameraComponent(){return this._activeSceneComponent?this._activeSceneComponent.activeCameraComponent:null}get activeCamera(){const e=this._activeSceneComponent?this._activeSceneComponent.activeCameraComponent:null;return e?e.camera:null}forceRender(){this._forceRender=!0}create(){super.create(),this.trackComponent(o.Z,(e=>{e.on("pulse",this.onPulse,this)}),(e=>{e.off("pulse",this.onPulse,this)}))}update(){const e=this.ins;return e.exposure.changed&&this.views.forEach((t=>t.renderer.toneMappingExposure=e.exposure.value)),e.gamma.changed,e.shadowsEnabled.changed&&this.views.forEach((t=>t.renderer.shadowMap.enabled=e.shadowsEnabled.value)),e.shadowMapType.changed&&this.views.forEach((t=>t.renderer.shadowMap.type=a[e.shadowMapType.getValidatedValue()])),!0}attachView(e){if(0===this.views.length){const t=e.renderer,n=this.outs;n.maxTextureSize.setValue(t.capabilities.maxTextureSize),n.maxCubemapSize.setValue(t.capabilities.maxCubemapSize)}this.views.push(e)}detachView(e){const t=this.views.indexOf(e);if(t<0)throw new Error("render view not registered");this.views.splice(t,1)}logInfo(){this.views.forEach((e=>{console.log(e.renderer.info)}))}onPulse(e){(e.systemUpdated||this._forceRender)&&(this.views.forEach((e=>{e.renderer.xr.isPresenting||e.render()})),this._forceRender=!1)}onActiveCamera(e){this.emit(e)}}l.typeName="CRenderer",l.isSystemSingleton=!0,l.ins={exposure:r.V5.Number("Shading.Exposure",1),gamma:r.V5.Number("Shading.Gamma",2),shadowsEnabled:r.V5.Boolean("Shadows.Enabled",!0),shadowMapType:r.V5.Enum("Shadows.MapType",i,i.PCF)},l.outs={maxTextureSize:r.V5.Integer("Caps.MaxTextureSize"),maxCubemapSize:r.V5.Integer("Caps.MaxCubemapSize")}},36283:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var i=n(64702),s=n(80038),r=n(15271),o=n(92642);const a={view:null,viewport:null,renderer:null,scene:null,camera:null},l={type:"before-render",component:null,context:a},c={type:"after-render",component:null,context:a},h={activate:s.V5.Event("Scene.Activate")};class d extends o.ZP{constructor(e,t){super(e,t),this._activeCameraComponent=null,this._preRenderList=[],this._postRenderList=[],this._renderListsNeedUpdate=!0,this.ins=this.addInputs(h,0),this.addEvents("before-render","after-render","active-camera")}get scene(){return this.object3D}get activeCameraComponent(){return this._activeCameraComponent}set activeCameraComponent(e){if(e!==this._activeCameraComponent){const t=this._activeCameraComponent;this._activeCameraComponent=e;const n={type:"active-camera",previous:t,next:e};this.emit(n)}}get activeCamera(){return this._activeCameraComponent?this._activeCameraComponent.camera:null}get renderer(){return this.getMainComponent(r.Z)}create(){super.create(),this.on("hierarchy",this.shouldUpdateRenderLists,this),this.on("child",this.shouldUpdateRenderLists,this);const e=this.renderer;e&&!e.activeSceneComponent&&(e.activeSceneComponent=this)}update(e){if(super.update(e),this.ins.activate.changed){const e=this.renderer;e&&(e.activeSceneComponent=this)}return!0}tick(e){return this._renderListsNeedUpdate&&(this.updateRenderLists(),this._renderListsNeedUpdate=!1),!1}dispose(){const e=this.renderer;e&&e.activeSceneComponent===this&&(e.activeSceneComponent=null),this.off("hierarchy",this.shouldUpdateRenderLists,this),this.off("child",this.shouldUpdateRenderLists,this),super.dispose()}preRender(e){const t=this._preRenderList;for(let n=0,i=t.length;n(e.preRender&&this._preRenderList.push(e),e.postRender&&this._postRenderList.push(e),!1))),this.changed=!0}_onBeforeRender(e,t,n){a.view=e.__view,a.viewport=e.__viewport,a.renderer=e,a.scene=t,a.camera=n,this.preRender(a),l.component=this,this.emit(l)}_onAfterRender(e,t,n){a.view=e.__view,a.viewport=e.__viewport,a.renderer=e,a.scene=t,a.camera=n,this.postRender(a),c.component=this,this.emit(c)}}d.typeName="CScene",d.isGraphSingleton=!0},92642:(e,t,n)=>{"use strict";n.d(t,{VZ:()=>f,ZP:()=>m});var i=n(19588),s=n(78943),r=n(82954),o=n(25499),a=n(28581),l=n(80038),c=n(3474);const h=new i.P,d=new i.P,u=new s._,p=new r.U;var f;!function(e){e[e.XYZ=0]="XYZ",e[e.YZX=1]="YZX",e[e.ZXY=2]="ZXY",e[e.XZY=3]="XZY",e[e.YXZ=4]="YXZ",e[e.ZYX=5]="ZYX"}(f||(f={}));class m extends c.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(m.transformIns),this.outs=this.addOutputs(m.transformOuts),this._object3D=this.createObject3D(),this._object3D.matrixAutoUpdate=!1}get transform(){return this}get object3D(){return this._object3D}get children(){return this._children||[]}get matrix(){return this._object3D.matrix}update(e){const t=this._object3D,{position:n,rotation:i,order:s,scale:r}=this.ins,{matrix:o}=this.outs;t.position.fromArray(n.value),h.fromArray(i.value).multiplyScalar(a.Z.DEG2RAD);const l=s.getOptionText();return t.rotation.setFromVector3(h,l),t.scale.fromArray(r.value),t.updateMatrix(),t.matrix.toArray(o.value),o.set(),!0}dispose(){this._object3D&&(this._object3D.children.slice().forEach((e=>this._object3D.remove(e))),this._object3D.parent&&this._object3D.parent.remove(this._object3D)),super.dispose()}setPropertiesFromMatrix(e){const t=!e;e=e||this._object3D.matrix;const{position:n,rotation:i,order:s,scale:r}=this.ins;e.decompose(h,u,d),h.toArray(n.value);const o=s.getOptionText();p.setFromQuaternion(u,o),h.setFromEuler(p),h.multiplyScalar(a.Z.RAD2DEG).toArray(i.value),d.toArray(r.value),n.set(t),i.set(t),r.set(t)}addChild(e){super.addChild(e),this._object3D.add(e._object3D)}removeChild(e){this._object3D.remove(e._object3D),super.removeChild(e)}createObject3D(){return new o.T}}m.typeName="CTransform",m.transformIns={position:l.V5.Vector3("Transform.Position"),rotation:l.V5.Vector3("Transform.Rotation"),order:l.V5.Enum("Transform.Order",f),scale:l.V5.Scale3("Transform.Scale")},m.transformOuts={matrix:l.V5.Matrix4("Transform.Matrix")}},67695:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>i.Mo,ZP:()=>r,dy:()=>i.dy});n(56166);var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class r extends i.ZP{constructor(e){super(),this.system=e}}s([(0,i.Cb)({attribute:!1})],r.prototype,"system",void 0)},28097:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var i=n(82587),s=n(37840),r=n(19588),o=n(28581),a=n(84538),l=n(82954),c=n(78943);const h=new a.L,d=(new a.L,new r.P),u=new r.P,p=new i.y,f=new l.U,m=new c._,g={PI:3.141592653589793,DOUBLE_PI:6.283185307179586,HALF_PI:1.5707963267948966,QUARTER_PI:.7853981633974483,DEG2RAD:.017453292519943295,RAD2DEG:57.29577951308232,composeOrbitMatrix:function(e,t,n){const s=e.x,r=e.y,o=e.z,a=t.x,l=t.y,c=t.z,h=Math.sin(s),d=Math.cos(s),u=Math.sin(r),p=Math.cos(r),f=Math.sin(o),m=Math.cos(o),g=p*m,A=m*u*h-f*d,v=m*u*d+f*h,y=p*f,b=h*u*f+m*d,_=f*u*d-m*h,x=-u,w=p*h,E=p*d,C=(n=n||new i.y).elements;return C[0]=g,C[1]=y,C[2]=x,C[3]=0,C[4]=A,C[5]=b,C[6]=w,C[7]=0,C[8]=v,C[9]=_,C[10]=E,C[11]=0,C[12]=a*g+l*A+c*v,C[13]=a*y+l*b+c*_,C[14]=a*x+l*w+c*E,C[15]=1,n},decomposeOrbitMatrix:function(e,t,n){f.setFromRotationMatrix(e,"ZYX"),t.setFromEuler(f),p.copy(e).invert(),h.set(0,0,0,1),h.applyMatrix4(p),n.x=-h.x,n.y=-h.y,n.z=-h.z},isMatrix4Identity:function(e){const t=e.elements;return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]},decomposeTransformMatrix:function(e,t,n,i){p.fromArray(e),p.decompose(d,m,u),f.setFromQuaternion(m,"XYZ"),d.toArray(t),u.toArray(i),d.setFromEuler(f),h.multiplyScalar(o.Z.RAD2DEG),d.toArray(n)}},A=new i.y,v=new s.Z,y=new r.P,b=new r.P;var _,x,w;!function(e){e[e.Orbit=0]="Orbit",e[e.FirstPerson=1]="FirstPerson"}(_||(_={})),function(e){e[e.Off=0]="Off",e[e.Pan=1]="Pan",e[e.Orbit=2]="Orbit",e[e.Dolly=3]="Dolly",e[e.Zoom=4]="Zoom",e[e.PanDolly=5]="PanDolly",e[e.Roll=6]="Roll"}(x||(x={})),function(e){e[e.Off=0]="Off",e[e.Active=1]="Active",e[e.Release=2]="Release"}(w||(w={}));class E{constructor(e){this.orbit=new r.P(0,0,0),this.offset=new r.P(0,0,50),this.minOrbit=new r.P(-90,-1/0,-1/0),this.maxOrbit=new r.P(90,1/0,1/0),this.minOffset=new r.P(-1/0,-1/0,.1),this.maxOffset=new r.P(1/0,1/0,1e3),this.orientationEnabled=!0,this.offsetEnabled=!0,this.mode=x.Off,this.phase=w.Off,this.prevPinchDist=0,this.deltaX=0,this.deltaY=0,this.deltaPinch=0,this.deltaWheel=0,this.viewportWidth=100,this.viewportHeight=100,this.camera=e}onPointer(e){if(e.isPrimary)if("pointer-down"===e.type)this.phase=w.Active;else if("pointer-up"===e.type)return this.phase=w.Release,!0;"pointer-down"===e.type&&(this.mode=this.getModeFromEvent(e));if(this.deltaX+=1*e.movementX,this.deltaY+=1*e.movementY,2===e.pointerCount){const t=e.activePositions,n=t[1].clientX-t[0].clientX,i=t[1].clientY-t[0].clientY,s=Math.sqrt(n*n+i*i),r=this.prevPinchDist||s;this.deltaPinch*=r>0?s/r:1,this.prevPinchDist=s}else this.deltaPinch=1,this.prevPinchDist=0;return!0}onTrigger(e){return"wheel"===e.type&&(this.deltaWheel+=o.Z.limit(e.wheel,-1,1),!0)}onKeypress(e){if("ArrowUp"===e.key||"ArrowDown"===e.key){const t="ArrowUp"===e.key?-1:1;return this.deltaY=20*t,this.mode=e.shiftKey?x.Pan:e.ctrlKey?x.Dolly:x.Orbit,!0}if("ArrowLeft"===e.key||"ArrowRight"===e.key){const t="ArrowLeft"===e.key?-1:1;return this.deltaX=20*t,this.mode=e.shiftKey?x.Pan:x.Orbit,!0}return!1}setViewportSize(e,t){this.viewportWidth=e,this.viewportHeight=t}updateController(e,t){const n=this.camera;e=e||n;const i=this.orbit,s=this.offset;g.decomposeOrbitMatrix(e.matrix,i,s),this.orbit.multiplyScalar(g.RAD2DEG),t&&(this.minOffset.min(s),this.maxOffset.max(s))}zoomExtents(e){const t=this.camera,n=this.offset;if(!t)return void console.warn("CameraController.zoomExtents - camera not set");y.copy(this.orbit).multiplyScalar(o.Z.DEG2RAD),b.setScalar(0),g.composeOrbitMatrix(y,b,A),v.copy(e).applyMatrix4(A.transpose()),v.getSize(y),v.getCenter(b),n.x=b.x,n.y=b.y;const i=Math.max(y.x/t.aspect,y.y);if(t.isOrthographicCamera)n.z=1.1*i;else{const e=1/(2*Math.tan(t.fov*o.Z.DEG2RAD*.5));n.z=b.z+i*e+.25*y.z}n.z>this.maxOffset.z&&(this.maxOffset.z=2*n.length())}updateCamera(e,t){const n=this.camera;return e=e||n,!(!this.update()&&!t)&&(y.copy(this.orbit).multiplyScalar(o.Z.DEG2RAD),b.copy(this.offset),n.isOrthographicCamera&&(b.z=this.maxOffset.z,n.size=this.offset.z,n.far=2*this.maxOffset.z,n.updateProjectionMatrix()),g.composeOrbitMatrix(y,b,e.matrix),e.matrixWorldNeedsUpdate=!0,!0)}update(){if(this.phase===w.Off&&0===this.deltaWheel&&0===this.deltaX&&0===this.deltaY)return!1;if(0!==this.deltaWheel)return this.updatePose(0,0,.07*this.deltaWheel+1,0,0,0),this.deltaWheel=0,!0;if(this.phase===w.Active)return(0!==this.deltaX||0!==this.deltaY||1!==this.deltaPinch)&&(this.updateByMode(),this.deltaX=0,this.deltaY=0,this.deltaPinch=1,!0);if(this.phase===w.Release){this.deltaX*=.85,this.deltaY*=.85,this.deltaPinch=1,this.updateByMode();return Math.abs(this.deltaX)+Math.abs(this.deltaY)<.1&&(this.mode=x.Off,this.phase=w.Off),!0}return(0!==this.deltaX||0!==this.deltaY)&&(this.updateByMode(),this.deltaX=0,this.deltaY=0,this.mode=x.Off,!0)}updateByMode(){switch(this.mode){case x.Orbit:this.updatePose(0,0,1,this.deltaY,this.deltaX,0);break;case x.Pan:this.updatePose(this.deltaX,this.deltaY,1,0,0,0);break;case x.Roll:this.updatePose(0,0,1,0,0,this.deltaX);break;case x.Dolly:this.updatePose(0,0,.0075*this.deltaY+1,0,0,0);break;case x.PanDolly:const e=.42*(this.deltaPinch-1)+1;this.updatePose(.75*this.deltaX,.75*this.deltaY,1/e,0,0,0)}}updatePose(e,t,n,i,s,r){const{orbit:a,minOrbit:l,maxOrbit:c,offset:h,minOffset:d,maxOffset:u}=this;if(this.orientationEnabled&&(a.x+=-1*i*220/this.viewportHeight,a.y+=-1*s*220/this.viewportHeight,a.z+=-1*r*220/this.viewportHeight,a.x=o.Z.limit(a.x,l.x,c.x),a.y=o.Z.limit(a.y,l.y,c.y),a.z=o.Z.limit(a.z,l.z,c.z)),this.offsetEnabled){const i=h.z=n*h.z;h.x+=e*i*-1/this.viewportHeight,h.y-=t*i*-1/this.viewportHeight,h.x=o.Z.limit(h.x,d.x,u.x),h.y=o.Z.limit(h.y,d.y,u.y),h.z=o.Z.limit(h.z,d.z,u.z)}}getModeFromEvent(e){if("mouse"===e.source){const t=e.originalEvent.button;if(0===t)return e.ctrlKey?x.Pan:e.altKey?x.Dolly:x.Orbit;if(2===t)return e.altKey?x.Roll:x.Pan;if(1===t)return x.Dolly}else if("touch"===e.source){const t=e.pointerCount;return 1===t?x.Orbit:2===t?x.PanDolly:x.Pan}}}},26060:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var i=n(19588),s=n(93113),r=n(37840),o=n(46953),a=n(44428);class l extends a.j{constructor(){super(...arguments),this.isIndexShader=!0,this.uniformsNeedUpdate=!1,this.lights=!1,this.uniforms={index:{value:[0,0,0]}},this.vertexShader=["void main() {"," #include "," #include ","}"].join("\n"),this.fragmentShader=["uniform vec3 index;","void main() {"," gl_FragColor = vec4(index, 1.0);","}"].join("\n")}static indexFromPixel(e){return e[0]+e[1]<<8+e[2]<<16}static zoneFromPixel(e){return e[3]}setIndex(e){const t=e>>16,n=(e>>8)-(t<<8),i=e-(t<<16)-(n<<8),s=this.uniforms.index.value;s[0]=i/255,s[1]=n/255,s[2]=t/255,this.uniformsNeedUpdate=!0}}class c extends a.j{constructor(){super(...arguments),this.isPositionShader=!0,this.uniforms={index:{value:0},range:{value:[-1,1]}},this.vertexShader=["varying vec3 vLocalPosition;","void main() {"," #include "," #include "," vLocalPosition = vec3(position);","}"].join("\n"),this.fragmentShader=["uniform float index;","uniform vec2 range;","varying vec3 vLocalPosition;","vec4 toVec4(float v) {"," float vn = (v - range.x) / (range.y - range.x);"," float b0 = floor(vn * 255.0) / 255.0; vn = (vn - b0) * 256.0;"," float b1 = floor(vn * 255.0) / 255.0; vn = (vn - b1) * 256.0;"," float b2 = floor(vn * 255.0) / 255.0; vn = (vn - b2) * 256.0;"," float b3 = floor(vn * 255.0) / 255.0;"," return vec4(clamp(b0, 0.0, 1.0), clamp(b1, 0.0, 1.0), clamp(b2, 0.0, 1.0), clamp(b3, 0.0, 1.0));","}","void main() {"," gl_FragColor = (index == 0.0 ? toVec4(vLocalPosition.x)"," : (index == 1.0 ? toVec4(vLocalPosition.y) : toVec4(vLocalPosition.z)));","}"].join("\n")}}class h extends a.j{constructor(){super(...arguments),this.isNormalShader=!0,this.uniforms={index:{value:0}},this.vertexShader=["varying vec3 vLocalNormal;","void main() {"," #include "," #include "," #include "," vLocalNormal = vec3(normal);","}"].join("\n"),this.fragmentShader=["uniform vec3 index;","varying vec3 vLocalNormal;","void main() {"," vec3 normal = normalize(vLocalNormal);"," gl_FragColor = vec4(normal * 0.5 + 0.5, 1.0);","}"].join("\n")}}const d=new i.P,u=new s.I,p=1e4,f=new r.Z(new i.P(-1e4,-1e4,-1e4),new i.P(p,p,p));class m{constructor(e){this.renderer=e,this.pickTextures=[];for(let e=0;e<3;++e)this.pickTextures[e]=new o.d(1,1,{stencilBuffer:!1});this.pickBuffer=new Uint8Array(4),this.indexShader=new l,this.positionShader=new c,this.normalShader=new h}static add(e,t){const n=e=>{e.material&&(e.onBeforeRender=function(t,n,i,s,r){r.isIndexShader&&r.setIndex(e.id)},e.onAfterRender=function(e,t,n,i,s){s.isIndexShader&&s.setIndex(0)})};t?e.traverse((e=>n(e))):n(e)}static remove(e,t){const n=e=>{e.material&&(e.onBeforeRender=null,e.onAfterRender=null)};t?e.traverse((e=>n(e))):n(e)}pickObject(e,t,n){const i=this.pickIndex(e,t,n);if(i>0)return e.getObjectById(i)}pickIndex(e,t,n){const i=n.viewport;(t=i.updateCamera(t)).layers.disable(1);const s=e.overrideMaterial;e.overrideMaterial=this.indexShader;const r=this.renderer,o=this.pickTextures[0];r.getClearColor(u),i.applyPickViewport(o,n),r.setRenderTarget(o),r.setClearColor(0);const a=r.xr.enabled;r.xr.enabled=!1,r.clear(),r.render(e,t),r.xr.enabled=a,r.setRenderTarget(null),r.setClearColor(u),e.overrideMaterial=s,t.layers.enable(1);const l=this.pickBuffer;return r.readRenderTargetPixels(o,0,0,1,1,l),l[0]+256*l[1]+65536*l[2]}pickPosition(e,t,n,s,r){s=s||f,r=r||new i.P;const o=n.viewport;(t=o.updateCamera(t)).layers.disable(1);const a=e.overrideMaterial,l=e.overrideMaterial=this.positionShader,c=this.renderer,h=this.pickTextures;c.getClearColor(u),c.setClearColor(0);for(let i=0;i<3;++i)l.uniforms.index.value=i,l.uniforms.range.value[0]=s.min.getComponent(i),l.uniforms.range.value[1]=s.max.getComponent(i),o.applyPickViewport(h[i],n),c.setRenderTarget(h[i]),c.clear(),c.render(e,t);c.setRenderTarget(null),c.setClearColor(u),e.overrideMaterial=a,t.layers.enable(1);const p=this.pickBuffer;for(let e=0;e<3;++e)c.readRenderTargetPixels(h[e],0,0,1,1,p),r.setComponent(e,2.337437050015319e-10*p[3]+5.983838848039216e-8*p[2]+1531862745098039e-20*p[1]+.003921568627451*p[0]);return s.getSize(d),r.multiply(d).add(s.min)}pickNormal(e,t,n,s){s=s||new i.P;const r=n.viewport;(t=r.updateCamera(t)).layers.disable(1);const o=e.overrideMaterial;e.overrideMaterial=this.normalShader;const a=this.renderer,l=this.pickTextures[0];a.getClearColor(u),r.applyPickViewport(l,n),a.setRenderTarget(l),a.setClearColor(0),a.clear(),a.render(e,t),a.setRenderTarget(null),a.setClearColor(u),e.overrideMaterial=o,t.layers.enable(1);const c=this.pickBuffer;return a.readRenderTargetPixels(l,0,0,1,1,c),s.set(c[0]/255*2-1,c[1]/255*2-1,c[2]/255*2-1).normalize()}}},94608:(e,t,n)=>{"use strict";n.d(t,{KB:()=>g,ZP:()=>m,hf:()=>f});var i=n(19588),s=n(40693),r=n(25499),o=n(51120),a=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const l=new i.P,c=new i.P,h=new i.P,d=new i.P,u=new s.F,p=new s.F;var f;!function(e){e[e.TopRight=0]="TopRight",e[e.TopLeft=1]="TopLeft",e[e.BottomLeft=2]="BottomLeft",e[e.BottomRight=3]="BottomRight"}(f||(f={}));class m extends r.T{constructor(){super(),this.isHTMLSprite=!0,this.viewAngle=0,this.orientationAngle=0,this.orientationQuadrant=f.TopLeft,this._elements=new Map,this._visible=!0,this.frustumCulled=!1}getVisible(){return this._visible}setVisible(e){e!==this._visible&&this._elements&&(this._visible=e,this._elements.forEach((t=>{t&&t.setVisible(e)})))}dispose(){this._elements.forEach(((e,t)=>{e&&t.removeChild(e)})),this._elements.clear()}disposeHTMLElement(e){const t=this._elements.get(e);t&&(this._elements.delete(e),e.removeChild(t))}update(){this._elements.forEach((e=>{e&&this.updateHTMLElement(e)}))}renderHTMLElement(e,t,n,i,s){i=i||this,l.set(0,0,0),l.applyMatrix4(i.modelViewMatrix),s?c.copy(s):c.set(0,1,0),c.applyMatrix4(i.modelViewMatrix),h.copy(c).sub(l).normalize(),d.set(0,0,1),this.viewAngle=h.angleTo(d),l.applyMatrix4(n.projectionMatrix),c.applyMatrix4(n.projectionMatrix),p.set(c.x,c.y),u.set(l.x,l.y),p.sub(u);const r=.5*(c.x+1)*t.clientWidth,o=.5*(1-c.y)*t.clientHeight;e.setPosition(r,o);const a=this.orientationAngle=p.angle();this.orientationQuadrant=Math.floor(2*a/Math.PI)}getHTMLElement(e){let t=this._elements.get(e);return t||(t=this.createHTMLElement(),t&&(t.setVisible(this._visible),e.appendChild(t),this._elements.set(e,t))),t}createHTMLElement(){return null}updateHTMLElement(e){e.requestUpdate()}}let g=class extends o.ZP{setVisible(e){this.style.display=e?"block":"none"}setOpacity(e){this.style.opacity=e.toString(),this.style.pointerEvents=e>0?"auto":"none"}setPosition(e,t){this.style.left=e.toString()+"px",this.style.top=t.toString()+"px"}};g=a([(0,o.Mo)("ff-sprite-element")],g)},28110:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(25499);n(94608);class s extends i.T{constructor(){super(...arguments),this.isHTMLSpriteGroup=!0,this._visible=!0}getVisible(){return this._visible}setVisible(e){if(e!==this._visible){this._visible=e;const t=this.children;for(let n=0,i=t.length;n{"use strict";n.d(t,{LY:()=>y,ZP:()=>b,mP:()=>v});var i=n(37840),s=n(19588),r=n(82587),o=n(68347),a=n(71050),l=n(67440),c=n(62257),h=n(28581);const d=.5*Math.PI,u=new i.Z,p=new s.P,f=new s.P,m=new s.P,g=new r.y,A=(new r.y,[new s.P(0,-d,0),new s.P(0,d,0),new s.P(-d,0,0),new s.P(d,0,0),new s.P(0,0,0),new s.P(0,Math.PI,0)]);var v,y;!function(e){e[e.Perspective=0]="Perspective",e[e.Orthographic=1]="Orthographic"}(v||(v={})),function(e){e[e.None=-1]="None",e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Top=2]="Top",e[e.Bottom=3]="Bottom",e[e.Front=4]="Front",e[e.Back=5]="Back"}(y||(y={}));class b extends o.V{constructor(e){super(),this.isUniversalCamera=!0,this.fov=50,this.size=20,this.aspect=1,this.distance=20,this.zoom=1,this.near=.1,this.far=2e3,this.focus=10,this.filmGauge=35,this.filmOffset=0,this.view=null,this.setProjection(e)}setProjection(e){e===v.Orthographic?(this.type="OrthographicCamera",this.isPerspectiveCamera=!1,this.isOrthographicCamera=!0):(this.type="PerspectiveCamera",this.isPerspectiveCamera=!0,this.isOrthographicCamera=!1),this.updateProjectionMatrix()}getProjection(){return this.isOrthographicCamera?v.Orthographic:v.Perspective}setPreset(e){e!==y.None?(this.rotation.setFromVector3(A[e],"XYZ"),this.position.set(0,0,this.distance).applyQuaternion(this.quaternion)):(this.rotation.set(0,0,0),this.position.set(0,0,0)),this.updateMatrix()}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*a.M8.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*a.M8.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*a.M8.RAD2DEG*Math.atan(Math.tan(.5*a.M8.DEG2RAD*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,r){this.isPerspectiveCamera?l.c.prototype.setViewOffset.call(this,e,t,n,i,s,r):c.i.prototype.setViewOffset.call(this,e,t,n,i,s,r)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}zoomToView(){}moveToView(e){this.updateMatrixWorld(!1),u.copy(e),g.extractRotation(this.matrixWorldInverse),u.applyMatrix4(g),u.getSize(p),u.getCenter(f);const t=Math.max(p.x/this.aspect,p.y);m.set(-f.x,-f.y,0),this.isPerspectiveCamera?m.z=p.z/(2*Math.tan(this.fov*h.Z.DEG2RAD*.5)):(this.size=.5*t,m.z=2*p.z,this.far=Math.max(this.far,2*m.z)),g.extractRotation(this.matrixWorld),m.applyMatrix4(g),this.matrix.decompose(this.position,this.quaternion,this.scale),this.position.copy(m),this.updateMatrix()}updateProjectionMatrix(){const e=this.near,t=this.far,n=this.aspect,i=this.zoom,s=this.view;if(this.isOrthographicCamera){const r=this.size,o=r/(2*i),a=o*n;let l=-a,c=a,h=o,d=-o;if(s&&s.enabled){const e=i/(s.width/s.fullWidth),t=i/(s.height/s.fullHeight),o=r*n/s.width,a=r/s.height;l+=o*(s.offsetX/e),c=l+o*(s.width/e),h-=a*(s.offsetY/t),d=h-a*(s.height/t)}this.projectionMatrix.makeOrthographic(l,c,h,d,e,t)}else{let o=e*Math.tan(.5*a.M8.DEG2RAD*this.fov)/i,l=2*o,c=n*l,h=-.5*c;s&&s.enabled&&(h+=s.offsetX*c/s.fullWidth,o-=s.offsetY*l/s.fullHeight,c*=s.width/s.fullWidth,l*=s.height/s.fullHeight);var r=this.filmOffset;0!==r&&(h+=e*r/this.getFilmWidth()),this.projectionMatrix.makePerspective(h,h+c,o,o-l,e,t)}this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}copy(e,t){return super.copy(e,t),this.type=e.type,this.isOrthographicCamera=e.isOrthographicCamera,this.isPerspectiveCamera=e.isPerspectiveCamera,this.fov=e.fov,this.size=e.size,this.aspect=e.aspect,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this.view=e.view?Object.assign({},e.view):null,this}clone(){return(new this.constructor).copy(this)}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.size=this.size,t.object.aspect=this.aspect,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}},73902:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(40693),s=n(82942),r=n(26775),o=n(12197),a=n(28097);class l extends s.Z{constructor(e){super(),this.next=null,this._canvasWidth=1,this._canvasHeight=1,this._overlay=null,this._camera=null,this._controller=null,this.addEvent("dispose"),this.next=null,e=e||{},this._relRect={x:e.x||0,y:e.y||0,width:e.width||1,height:e.height||1},this._absRect={x:0,y:0,width:1,height:1},e.overlay&&(this._overlay=e.overlay)}get x(){return this._absRect.x}get y(){return this._absRect.y}get width(){return this._absRect.width}get height(){return this._absRect.height}get canvasWidth(){return this._canvasWidth}get canvasHeight(){return this._canvasHeight}get camera(){return this._camera}get controller(){return this._controller}get overlay(){return this._overlay}set overlay(e){this._overlay=e,this.updateGeometry()}dispose(){this.emit({type:"dispose",viewport:this}),this._overlay&&(this._overlay.remove(),this._overlay=null)}setSize(e,t,n,i){const s=this._relRect;s.x=e,s.y=t,s.width=n,s.height=i,this.updateGeometry()}setCanvasSize(e,t){this._canvasWidth=e,this._canvasHeight=t,this.updateGeometry(),this._controller&&this._controller.setViewportSize(e,t)}setBuiltInCamera(e,t){this._camera?this._camera.setProjection(e):(this._camera=new r.ZP(e),this._camera.matrixAutoUpdate=!1),void 0!==t&&(this._camera.setPreset(t),this.overlay.setLabel(o.x.TopRight,"view",r.LY[t],"ff-label-box"))}unsetBuiltInCamera(){this._camera=null,this._controller=null,this.overlay.unsetLabel(o.x.TopRight,"view")}enableCameraControl(e){return!e&&this._controller?this._controller=null:e&&this._camera&&(this._controller||(this._controller=new a.Z(this._camera),this._controller.setViewportSize(this.width,this.height),this._controller.updateController())),this._controller}zoomExtents(e){const t=this._camera,n=this._controller;t&&n&&(n.zoomExtents(e),n.updateCamera(null,!0))}isInside(e){return this.isPointInside(e.localX,e.localY)}isPointInside(e,t){const n=this._absRect;return t=this.canvasHeight-t,e>=n.x&&e=n.y&&t{"use strict";n.d(t,{D7:()=>p,MO:()=>u,jU:()=>d,sN:()=>f});var i=n(19588),s=n(82587),r=n(82954),o=n(78943),a=n(71050);const l=new i.P,c=new s.y,h=new r.U;new o._;function d(e,t,n){const i=n||new o._;return l.fromArray(e).multiplyScalar(a.M8.DEG2RAD),h.setFromVector3(l,t),i.setFromEuler(h),i}function u(e,t,n){const i=n||[0,0,0];return h.setFromQuaternion(e,t),l.setFromEuler(h),l.multiplyScalar(a.M8.RAD2DEG).toArray(i),i}function p(e){const t=new Map,n=new Map,i=new Map;e.traverse((e=>{const s=e;if(s.isMesh){const e=s.geometry;e&&t.set(e.uuid,e);const r=s.material;if(r){n.set(r.uuid,r);for(let e in r){const t=r[e];t&&t.isTexture&&i.set(t.uuid,t)}}}}));for(let e of i)e[1].dispose();for(let e of n)e[1].dispose();for(let e of t)e[1].dispose()}function f(e,t,n){n||(n=e);const i=e.geometry;if(i&&e.visible){let s=e;for(c.identity();s&&s!==n;)c.premultiply(s.matrix),s=s.parent;if(i.isGeometry){const e=i.vertices;for(let n=0,i=e.length;n{"use strict";n.d(t,{Z:()=>a,x:()=>i});var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};!function(e){e[e.TopLeft=0]="TopLeft",e[e.TopCenter=1]="TopCenter",e[e.TopRight=2]="TopRight",e[e.BottomLeft=3]="BottomLeft",e[e.BottomCenter=4]="BottomCenter",e[e.BottomRight=5]="BottomRight"}(i||(i={}));let o=class extends s.ZP{constructor(){super(),this.labels=[],this.labels.push({},{},{},{},{},{})}setLabel(e,t,n,i){this.labels[e][t]={text:n,className:i},this.requestUpdate()}unsetLabel(e,t){delete this.labels[e][t],this.requestUpdate()}firstConnected(){this.classList.add("ff-container","ff-viewport-overlay")}render(){const e=this.labels;return s.dy`
+
${Object.keys(e[i.TopLeft]).map((t=>{const n=e[i.TopLeft][t];return s.dy`
${n.text}
`}))}
+
${Object.keys(e[i.TopCenter]).map((t=>{const n=e[i.TopCenter][t];return s.dy`
${n.text}
`}))}
+
${Object.keys(e[i.TopRight]).map((t=>{const n=e[i.TopRight][t];return s.dy`
${n.text}
`}))}
+
+
${Object.keys(e[i.BottomLeft]).map((t=>{const n=e[i.BottomLeft][t];return s.dy`
${n.text}
`}))}
+
${Object.keys(e[i.BottomCenter]).map((t=>{const n=e[i.BottomCenter][t];return s.dy`
${n.text}
`}))}
+
${Object.keys(e[i.BottomRight]).map((t=>{const n=e[i.BottomRight][t];return s.dy`
${n.text}
`}))}
+
`}};o=r([(0,s.Mo)("ff-viewport-overlay")],o);const a=o},98595:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});n(1239);var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let r=class extends i.ZP{constructor(){super(),this.name="",this.index=0,this.selectedIndex=-1,this.tabbingIndex=0,this.selected=!1,this.selectable=!1,this.disabled=!1,this.icon="",this.role="button",this.caret=!1,this.inline=!1,this.transparent=!1,this.addEventListener("click",(e=>this.onClick(e))),this.addEventListener("keydown",(e=>this.onKeyDown(e)))}firstConnected(){this.tabIndex=this.tabbingIndex,this.setAttribute("role",this.role),this.classList.add("ff-button")}shouldUpdate(e){return(e.has("selectedIndex")||e.has("index"))&&this.selectedIndex>=0&&(this.selected=this.index===this.selectedIndex),e.has("disabled")&&this.setClass("ff-disabled",this.disabled),!0}update(e){this.classList.remove("ff-inline","ff-transparent","ff-control"),this.inline?this.classList.add("ff-inline"):this.transparent?this.classList.add("ff-transparent"):this.classList.add("ff-control"),super.update(e)}render(){return i.dy`${this.renderIcon()}${this.renderText()}${this.renderCaret()}`}renderIcon(){return this.icon?i.dy``:null}renderText(){return this.text?i.dy`
${this.text}
`:null}renderCaret(){return this.caret?i.dy`
`:null}onClick(e){this.selectable&&(this.selected=!this.selected)}onKeyDown(e){(document.activeElement.shadowRoot?document.activeElement.shadowRoot.activeElement:document.activeElement)!==this||"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),this.dispatchEvent(new MouseEvent("click",{bubbles:!0})))}};s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"index",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"selectedIndex",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"tabbingIndex",void 0),s([(0,i.Cb)({type:Boolean,reflect:!0})],r.prototype,"selected",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"selectable",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"disabled",void 0),s([(0,i.Cb)()],r.prototype,"text",void 0),s([(0,i.Cb)()],r.prototype,"icon",void 0),s([(0,i.Cb)()],r.prototype,"role",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"caret",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"inline",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"transparent",void 0),r=s([(0,i.Mo)("ff-button")],r);const o=r},34834:(e,t,n)=>{"use strict";var i=n(28581),s=n(47855),r=(n(45716),n(61497)),o=n(96368),a=n(51120),l=n(69551),c=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let h=class extends a.ZP{constructor(){super(),this.value=new o.Z,this._offsetX=0,this._offsetY=0,this._knob=(new a.ZP).addClass("ff-knob").setStyle({display:"block",position:"relative "}),new l.Z(this)}setXY(e,t){this.value.set(e,t),this.requestUpdate()}dragStart(e){const t=this._knob,n=this.getBoundingClientRect();e.target===this._knob?(this._offsetX=e.clientX-t.offsetLeft+.5*(t.clientWidth-t.offsetWidth),this._offsetY=e.clientY-t.offsetTop+.5*(t.clientHeight-t.offsetHeight)):(this._offsetX=n.left+.8*t.clientWidth,this._offsetY=n.top+.8*t.clientHeight),this.dragMove(e)}dragMove(e){const t=this._knob,n=e.clientX-this._offsetX,s=e.clientY-this._offsetY;let r=n/(this.clientWidth-t.clientWidth);r=i.Z.limit(r,0,1);let o=1-s/(this.clientHeight-t.clientHeight);o=i.Z.limit(o,0,1),r===this.value.x&&o===this.value.y||(this.value=this.value.set(r,o),this.emitChangeEvent(!0))}dragEnd(){this.emitChangeEvent(!1)}firstConnected(){this.setStyle({position:"relative",touchAction:"none"}),this.setAttribute("touch-action","none"),this.setAttribute("tabindex","0"),this.classList.add("ff-control","ff-vector-slider"),this.appendChild(this._knob)}update(e){const t=100*this.value.x,n=100*(1-this.value.y);this._knob.style.left=`${t.toFixed(3)}%`,this._knob.style.top=`${n.toFixed(3)}%`,super.update(e)}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,isDragging:e},bubbles:!0}))}};c([(0,a.Cb)({attribute:!1})],h.prototype,"value",void 0),h=c([(0,a.Mo)("ff-vector-slider")],h);const d=h;var u=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const p=new s.ZP;let f=class extends a.ZP{constructor(){super(),this.color=new s.ZP,this.alpha=!1,this.numeric=!1,this.onLumSatChange=this.onLumSatChange.bind(this),this.onHueChange=this.onHueChange.bind(this),this.onAlphaChange=this.onAlphaChange.bind(this),this.addEventListener("click",(e=>e.stopPropagation())),this._hsv=new s.P,this._lumSatSlider=(new d).on("change",this.onLumSatChange),this._hueSlider=(new r.Z).addClass("ff-hue-slider").on("change",this.onHueChange),this._hueSlider.direction="vertical"}firstConnected(){this.classList.add("ff-flex-column","ff-control","ff-color-edit")}update(e){e.has("color")&&this.color.toHSV(this._hsv),e.has("alpha")&&(this.alpha&&!this._alphaSlider?(this._alphaSlider=(new r.Z).addClass("ff-alpha-slider").on("change",this.onAlphaChange),this._alphaSlider.direction="vertical"):!this.alpha&&this._alphaSlider&&this._alphaSlider.remove()),super.update(e)}render(){let e=null;if(this.numeric){const t=this.color,n=t.toString(!1).substr(1),i=this.alpha?a.dy` +
A
+ `:null;e=a.dy`
+
R
+
G
+
B
+ ${i} +
#
+
`}return a.dy`
+ ${this._lumSatSlider}${this._hueSlider}${this._alphaSlider} +
${e}`}updated(){this._hueSlider.value=1-this._hsv.x/360;const e=`linear-gradient(to bottom, transparent, black), linear-gradient(to right, white, ${p.setHSV(this._hsv.x).toString(!1)})`;if(this._lumSatSlider.style.backgroundImage=e,this._lumSatSlider.setXY(this._hsv.y,this._hsv.z),this.alpha){const e=this.color.toString(!1),t=getComputedStyle(this._alphaSlider).color,n=`linear-gradient(to top, transparent, ${e}), repeating-linear-gradient(-45deg, transparent, transparent 8px, ${t} 8px, ${t} 16px)`;this._alphaSlider.style.backgroundImage=n,this._alphaSlider.value=this.color.alpha}}onLumSatChange(e){e.stopPropagation();const t=e.detail.value;this._hsv.y=t.x,this._hsv.z=t.y,this.color.setHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(e.detail.isDragging)}onHueChange(e){e.stopPropagation(),this._hsv.x=360*(1-e.target.value),this.color.setHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(e.detail.isDragging)}onAlphaChange(e){e.stopPropagation(),this.color.alpha=e.target.value,this.requestUpdate(),this.emitChangeEvent(e.detail.isDragging)}onNumericEdit(e){e.stopPropagation();const t=e.target.name;if("string"===t)this.color.setString(e.detail.text,1,!1);else{let n=parseInt(e.detail.text);if(!isFinite(n))return;this.color[t]=i.Z.limit(n,0,255)}this.color.toHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(e.detail.isEditing)}onKeyDown(e){const t="ArrowRight"===e.code||"ArrowUp"===e.code,n="PageUp"===e.code,s="ArrowLeft"===e.code||"ArrowDown"===e.code,r="PageDown"===e.code;if(t||n||s||r)if(e.target===this._hueSlider||e.target===this._alphaSlider){const r=t||n?-1:1,o=t||s?.01:.1;e.target===this._hueSlider?(this._hsv.x=i.Z.limit(this._hsv.x+360*o*r,0,360),this.color.setHSV(this._hsv)):this.color.alpha=i.Z.limit(this.color.alpha+o*r,0,1),this.requestUpdate(),this.emitChangeEvent(!1)}else if(e.target===this._lumSatSlider&&(t||s)){const n=t?1:-1,s=e.shiftKey?.1:.01;"ArrowRight"===e.code||"ArrowLeft"===e.code?this._hsv.y=i.Z.limit(this._hsv.y+s*n,0,1):this._hsv.z=i.Z.limit(this._hsv.z+s*n,0,1),this.color.setHSV(this._hsv),this.requestUpdate(),this.emitChangeEvent(!1)}}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{detail:{color:this.color,isDragging:e},bubbles:!0}))}};u([(0,a.Cb)({attribute:!1})],f.prototype,"color",void 0),u([(0,a.Cb)({type:Boolean})],f.prototype,"alpha",void 0),u([(0,a.Cb)({type:Boolean})],f.prototype,"numeric",void 0),f=u([(0,a.Mo)("ff-color-edit")],f)},51120:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>z,ZP:()=>Q,dy:()=>d.dy,Cb:()=>E,sY:()=>d.sY});var i=n(93909),s=n(14056);function r(e,t){const{element:{content:n},parts:i}=e,s=document.createTreeWalker(n,133,null,!1);let r=a(i),o=i[r],l=-1,c=0;const h=[];let d=null;for(;s.nextNode();){l++;const e=s.currentNode;for(e.previousSibling===d&&(d=null),t.has(e)&&(h.push(e),null===d&&(d=e)),null!==d&&c++;void 0!==o&&o.index===l;)o.index=null!==d?-1:o.index-c,r=a(i,r),o=i[r]}h.forEach((e=>e.parentNode.removeChild(e)))}const o=e=>{let t=11===e.nodeType?0:1;const n=document.createTreeWalker(e,133,null,!1);for(;n.nextNode();)t++;return t},a=(e,t=-1)=>{for(let n=t+1;n`${e}--${t}`;let p=!0;void 0===window.ShadyCSS?p=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),p=!1);const f=e=>t=>{const n=u(t.type,e);let i=c.r.get(n);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},c.r.set(n,i));let r=i.stringsArray.get(t.strings);if(void 0!==r)return r;const o=t.strings.join(s.Jw);if(r=i.keyString.get(o),void 0===r){const n=t.getTemplateElement();p&&window.ShadyCSS.prepareTemplateDom(n,e),r=new s.YS(t,n),i.keyString.set(o,r)}return i.stringsArray.set(t.strings,r),r},m=["html","svg"],g=new Set,A=(e,t,n)=>{g.add(e);const i=n?n.element:document.createElement("template"),s=t.querySelectorAll("style"),{length:l}=s;if(0===l)return void window.ShadyCSS.prepareTemplateStyles(i,e);const h=document.createElement("style");for(let e=0;e{m.forEach((t=>{const n=c.r.get(u(t,e));void 0!==n&&n.keyString.forEach((e=>{const{element:{content:t}}=e,n=new Set;Array.from(t.querySelectorAll("style")).forEach((e=>{n.add(e)})),r(e,n)}))}))})(e);const d=i.content;n?function(e,t,n=null){const{element:{content:i},parts:s}=e;if(null==n)return void i.appendChild(t);const r=document.createTreeWalker(i,133,null,!1);let l=a(s),c=0,h=-1;for(;r.nextNode();)for(h++,r.currentNode===n&&(c=o(t),n.parentNode.insertBefore(t,n));-1!==l&&s[l].index===h;){if(c>0){for(;-1!==l;)s[l].index+=c,l=a(s,l);return}l=a(s,l)}}(n,h,d.firstChild):d.insertBefore(h,d.firstChild),window.ShadyCSS.prepareTemplateStyles(i,e);const p=d.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==p)t.insertBefore(p.cloneNode(!0),t.firstChild);else if(n){d.insertBefore(h,d.firstChild);const e=new Set;e.add(h),r(n,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const v={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},y=(e,t)=>t!==e&&(t==t||e==e),b={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y},_="finalized";class x extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach(((t,n)=>{const i=this._attributeNameForProperty(n,t);void 0!==i&&(this._attributeToPropertyMap.set(i,n),e.push(i))})),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach(((e,t)=>this._classProperties.set(t,e)))}}static createProperty(e,t=b){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n="symbol"==typeof e?Symbol():`__${e}`,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const s=this[e];this[t]=i,this.requestUpdateInternal(e,s,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||b}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty(_)||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const n of t)this.createProperty(n,e[n])}}static _attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,n=y){return n(e,t)}static _propertyValueFromAttribute(e,t){const n=t.type,i=t.converter||v,s="function"==typeof i?i:i.fromAttribute;return s?s(e,n):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const n=t.type,i=t.converter;return(i&&i.toAttribute||v.toAttribute)(e,n)}initialize(){this._updateState=0,this._updatePromise=new Promise((e=>this._enableUpdatingResolver=e)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((e,t)=>this[t]=e)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,n){t!==n&&this._attributeToProperty(e,n)}_propertyToAttribute(e,t,n=b){const i=this.constructor,s=i._attributeNameForProperty(e,n);if(void 0!==s){const e=i._propertyValueToAttribute(t,n);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(s):this.setAttribute(s,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const n=this.constructor,i=n._attributeToPropertyMap.get(e);if(void 0!==i){const e=n.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=n._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,n){let i=!0;if(void 0!==e){const s=this.constructor;n=n||s.getPropertyOptions(e),s._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((e,t)=>this._propertyToAttribute(t,this[t],e))),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}x.finalized=!0;const w=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}};function E(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):w(e,t)}const C=Element.prototype;C.msMatchesSelector||C.webkitMatchesSelector;const S=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,M=Symbol();class I{constructor(e,t){if(t!==M)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(S?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const T={};class P extends x{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,n)=>e.reduceRight(((e,n)=>Array.isArray(n)?t(n,e):(e.add(n),e)),n),n=t(e,new Set),i=[];n.forEach((e=>i.unshift(e))),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map((e=>{if(e instanceof CSSStyleSheet&&!S){const t=Array.prototype.slice.call(e.cssRules).reduce(((e,t)=>e+t.cssText),"");return new I(String(t),M)}return e}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?S?this.renderRoot.adoptedStyleSheets=e.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map((e=>e.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==T&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)})))}render(){return T}}P.finalized=!0,P.render=(e,t,n)=>{if(!n||"object"!=typeof n||!n.scopeName)throw new Error("The `scopeName` option is required.");const s=n.scopeName,r=l.L.has(t),o=p&&11===t.nodeType&&!!t.host,a=o&&!g.has(s),c=a?document.createDocumentFragment():t;if((0,l.s)(e,c,Object.assign({templateFactory:f(s)},n)),a){const e=l.L.get(c);l.L.delete(c);const n=e.value instanceof h.R?e.value.template:void 0;A(s,c,n),(0,i.r4)(t,t.firstChild),t.appendChild(c),l.L.set(t,e)}!r&&o&&window.ShadyCSS.styleElement(t.host)},P.shadowRootOptions={mode:"open"};const B=(e,t)=>{const n=e.startNode.parentNode,i=void 0===t?e.endNode:t.startNode,s=n.insertBefore((0,d.IW)(),i);n.insertBefore((0,d.IW)(),i);const r=new d.nt(e.options);return r.insertAfterNode(s),r},R=(e,t)=>(e.setValue(t),e.commit(),e),D=(e,t,n)=>{const i=e.startNode.parentNode,s=n?n.startNode:e.endNode,r=t.endNode.nextSibling;r!==s&&(0,d.V)(i,t.startNode,r,s)},L=e=>{(0,d.r4)(e.startNode.parentNode,e.startNode,e.endNode.nextSibling)},N=(e,t,n)=>{const i=new Map;for(let s=t;s<=n;s++)i.set(e[s],s);return i},k=new WeakMap,O=new WeakMap;(0,d.XM)(((e,t,n)=>{let i;return void 0===n?n=t:void 0!==t&&(i=t),t=>{if(!(t instanceof d.nt))throw new Error("repeat can only be used in text bindings");const s=k.get(t)||[],r=O.get(t)||[],o=[],a=[],l=[];let c,h,u=0;for(const t of e)l[u]=i?i(t,u):u,a[u]=n(t,u),u++;let p=0,f=s.length-1,m=0,g=a.length-1;for(;p<=f&&m<=g;)if(null===s[p])p++;else if(null===s[f])f--;else if(r[p]===l[m])o[m]=R(s[p],a[m]),p++,m++;else if(r[f]===l[g])o[g]=R(s[f],a[g]),f--,g--;else if(r[p]===l[g])o[g]=R(s[p],a[g]),D(t,s[p],o[g+1]),p++,g--;else if(r[f]===l[m])o[m]=R(s[f],a[m]),D(t,s[f],s[p]),f--,m++;else if(void 0===c&&(c=N(l,m,g),h=N(r,p,f)),c.has(r[p]))if(c.has(r[f])){const e=h.get(l[m]),n=void 0!==e?s[e]:null;if(null===n){const e=B(t,s[p]);R(e,a[m]),o[m]=e}else o[m]=R(n,a[m]),D(t,n,s[p]),s[e]=null;m++}else L(s[f]),f--;else L(s[p]),p++;for(;m<=g;){const e=B(t,o[g+1]);R(e,a[m]),o[m++]=e}for(;p<=f;){const e=s[p++];null!==e&&L(e)}k.set(t,o),O.set(t,l)}}));var U,F=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let V=U=class extends P{constructor(){super(...arguments),this._isFirstConnected=!1}static setStyle(e,t){Object.assign(e.style,t)}static setAttribs(e,t){for(let n in t)e.setAttribute(n,t[n])}get shady(){return this.constructor.shady}appendTo(e){return e.appendChild(this),this}removeChildren(){for(;this.firstChild;)this.removeChild(this.firstChild)}getChildrenArray(){return Array.from(this.children)}appendElement(e,t){return this.createElement(e,t,this)}createElement(e,t,n){let i;return i="string"==typeof e?document.createElement(e):e instanceof HTMLElement?e:new e,t&&Object.assign(i.style,t),n&&n.appendChild(i),i}setStyle(e){return U.setStyle(this,e),this}setAttribute(e,t){return super.setAttribute(e,t),this}setAttributes(e){return U.setAttribs(this,e),this}addClass(...e){return e.forEach((e=>this.classList.add(e))),this}removeClass(...e){return e.forEach((e=>this.classList.remove(e))),this}setClass(e,t){return t?this.classList.add(e):this.classList.remove(e),this}hasFocus(){return document.activeElement===this}on(e,t,n){return this.addEventListener(e,t,n),this}off(e,t,n){return this.removeEventListener(e,t,n),this}connectedCallback(){this._isFirstConnected||(this._isFirstConnected=!0,this.firstConnected()),this.connected(),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.disconnected()}createRenderRoot(){return this.shady?super.createRenderRoot():this}firstConnected(){}connected(){}disconnected(){}onUpdate(){this.requestUpdate()}};V.tagName="ff-custom-element",V.shady=!1,V=U=F([z("ff-custom-element")],V);const Q=V;function z(e){return t=>(t.tagName=e,customElements.define(t.tagName,t),t)}},69551:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{constructor(e){this.isEnabled=!0,this._isDragging=!1,this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this.target=e,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp)}get isDragging(){return this._isDragging}get startX(){return this._startX}get startY(){return this._startY}onPointerDown(e){e.isPrimary&&this.isEnabled&&(this._isDragging=!0,this._startX=this._lastX=e.clientX,this._startY=this._lastY=e.clientY,this.target.setPointerCapture(e.pointerId),this.target.dragStart(e)),e.stopPropagation(),e.preventDefault()}onPointerMove(e){if(e.isPrimary&&this._isDragging){const t=e.clientX-this._lastX;this._lastX=e.clientX;const n=e.clientY-this._lastY;this._lastY=e.clientY,this.target.dragMove(e,t,n)}e.stopPropagation(),e.preventDefault()}onPointerUp(e){this._isDragging&&e.isPrimary&&(this.target.dragEnd(e),this.target.releasePointerCapture(e.pointerId),this._isDragging=!1),e.stopPropagation(),e.preventDefault()}}},1239:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let o=i=class extends s.ZP{constructor(e){super(),this.template=null,this.name=e||""}static add(e,t){if(i.templates[e])throw new Error(`icon already registered: '${e}'`);i.templates[e]=t}static getTemplateNames(){return Object.keys(i.templates)}firstConnected(){this.classList.add("ff-icon")}render(){if(this.name){const e=this.constructor.templates[this.name];return e||console.warn(`icon not found: '${this.name}'`),e}return this.template?this.template:s.dy`[icon undefined]`}};o.templates={},r([(0,s.Cb)({attribute:!1})],o.prototype,"template",void 0),r([(0,s.Cb)({type:String})],o.prototype,"name",void 0),o=i=r([(0,s.Mo)("ff-icon")],o);const a=o;o.add("empty",s.dy``),o.add("check",s.dy``),o.add("close",s.dy``),o.add("grip",s.dy``),o.add("up",s.dy``),o.add("down",s.dy``),o.add("caret-up",s.dy``),o.add("caret-down",s.dy``),o.add("folder",s.dy``),o.add("file",s.dy``),o.add("info",s.dy``),o.add("warning",s.dy``),o.add("error",s.dy``),o.add("prompt",s.dy``)},45716:(e,t,n)=>{"use strict";var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let r=class extends i.ZP{constructor(){super(...arguments),this.name="",this.index=0,this.text="",this.placeholder="",this.align="left",this.initialValue="",this.requestFocus=!1}get inputElement(){return this.getElementsByTagName("input").item(0)}focus(){this.requestFocus=!0,this.performUpdate()}hasFocus(){const e=document.activeElement.shadowRoot?document.activeElement.shadowRoot.activeElement:document.activeElement;return this.inputElement===e}firstConnected(){this.classList.add("ff-control","ff-line-edit")}shouldUpdate(e){return!this.hasFocus()&&super.shouldUpdate(e)}render(){return i.dy``}updated(){this.requestFocus&&(this.requestFocus=!1,this.inputElement.focus())}onKeyDown(e){const t=e.target;"Enter"===e.key?(this.commit(t),t.blur()):"Escape"===e.key&&(this.revert(t),t.blur())}onChange(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!1)}onInput(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!0)}onFocus(e){this.initialValue=e.target.value,e.target.select()}onBlur(e){this.commit(e.target),this.requestUpdate()}revert(e){e.value=this.initialValue,this.dispatchChangeEvent(e.value,!1)}commit(e){this.initialValue=e.value,this.dispatchChangeEvent(e.value,!1)}dispatchChangeEvent(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{text:e,isEditing:t}}))}};s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"index",void 0),s([(0,i.Cb)({type:String})],r.prototype,"text",void 0),s([(0,i.Cb)({type:String})],r.prototype,"placeholder",void 0),s([(0,i.Cb)({type:String})],r.prototype,"align",void 0),r=s([(0,i.Mo)("ff-line-edit")],r)},61497:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(28581),s=n(51120),r=n(69551),o=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let a=class extends s.ZP{constructor(){super(),this.direction="horizontal",this.value=0,this._isVertical=!1,this._offsetX=0,this._offsetY=0,this._knob=(new s.ZP).addClass("ff-knob").setStyle({display:"block",position:"relative "}),new r.Z(this)}dragStart(e){const t=this._knob,n=this.getBoundingClientRect();e.target===this._knob?(this._offsetX=e.clientX-t.offsetLeft+.5*(t.clientWidth-t.offsetWidth),this._offsetY=e.clientY-t.offsetTop+.5*(t.clientHeight-t.offsetHeight)):(this._offsetX=n.left+.8*t.clientWidth,this._offsetY=n.top+.8*t.clientHeight),this.dragMove(e)}dragMove(e){const t=this._knob,n=e.clientX-this._offsetX,s=e.clientY-this._offsetY;let r=this._isVertical?1-s/(this.clientHeight-t.clientHeight):n/(this.clientWidth-t.clientWidth);r=i.Z.limit(r,0,1),r!==this.value&&(this.value=r,this.emitChangeEvent(!0))}dragEnd(){this.emitChangeEvent(!1)}firstConnected(){this.setStyle({position:"relative",touchAction:"none"}),this.setAttribute("touch-action","none"),this.setAttribute("tabindex","0"),this.classList.add("ff-control","ff-linear-slider"),this.appendChild(this._knob)}update(e){if(e.has("direction")&&(this._isVertical="vertical"===this.direction,this.setClass("ff-horizontal",!this._isVertical),this.setClass("ff-vertical",this._isVertical)),e.has("value")){const e=i.Z.limit(this.value,0,1),t=this._isVertical?0:100*e,n=this._isVertical?100*(1-e):0;this._knob.style.left=`${t.toFixed(3)}%`,this._knob.style.top=`${n.toFixed(3)}%`}super.update(e)}emitChangeEvent(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,isDragging:e},bubbles:!0}))}};o([(0,s.Cb)({type:String})],a.prototype,"direction",void 0),o([(0,s.Cb)({type:Number})],a.prototype,"value",void 0),a=o([(0,s.Mo)("ff-linear-slider")],a);const l=a},10564:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>h});n(1239);var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const o={info:"ff-info",success:"ff-success",warning:"ff-warning",error:"ff-error"},a={info:"info",success:"check",warning:"warning",error:"error"},l={info:2e3,success:2e3,warning:5e3,error:0};let c=i=class extends s.ZP{constructor(e,t,n){super(),this._handler=0,this.on("transitionend",this.remove.bind(this)),this.message=e||"",this.level=t||"info",this.timeout=void 0!==n?n:l[this.level];const s=(i.shadowRootNode||document).getElementById(i.stackId);s?s.appendChild(this):console.warn(`element '#${i.stackId}' not found`)}static show(e,t,n){new i(e,t,n)}close(){this._handler>0&&(window.clearTimeout(this._handler),this._handler=0),this.classList.add("ff-out")}firstUpdated(){this.classList.add("ff-notification",o[this.level]),this.timeout>0&&(this._handler=window.setTimeout((()=>this.close()),this.timeout))}render(){const e=a[this.level];return s.dy` +
${this.message}
+ `}onClose(e){e.stopPropagation(),this.close()}};c.stackId="ff-notification-stack",c.shadowRootNode=null,r([(0,s.Cb)({type:String})],c.prototype,"message",void 0),r([(0,s.Cb)({type:String})],c.prototype,"level",void 0),r([(0,s.Cb)({type:Number})],c.prototype,"timeout",void 0),c=i=r([(0,s.Mo)("ff-notification")],c);const h=c},34287:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>i.Mo,ZP:()=>o,dy:()=>i.dy});var i=n(51120),s=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let r=class extends i.ZP{constructor(){super(),this.anchor=null,this.portal=null,this.position=void 0,this.align=void 0,this.justify=void 0,this.positionX=0,this.positionY=0,this.offsetX=0,this.offsetY=0,this.keepVisible=!1,this.modal=!1,this._modalPlane=null,this.onResize=this.onResize.bind(this),this.onCaptureEvent=this.onCaptureEvent.bind(this),this.onEatEvent=this.onEatEvent.bind(this)}close(){this.dispatchEvent(new CustomEvent("close"))}connected(){if(this.calculatePosition(),window.addEventListener("resize",this.onResize),this.modal){const e=this._modalPlane=this.createElement("div");e.classList.add("ff-modal-plane"),e.addEventListener("mousedown",this.onEatEvent),e.addEventListener("contextmenu",this.onEatEvent),e.addEventListener("pointerdown",this.onEatEvent),this.parentElement.appendChild(e),setTimeout((()=>e.classList.add("ff-transition")))}else document.addEventListener("mousedown",this.onCaptureEvent,{capture:!0,passive:!0})}disconnected(){window.removeEventListener("resize",this.onResize),this._modalPlane?(this._modalPlane.remove(),this._modalPlane=null):document.removeEventListener("mousedown",this.onCaptureEvent)}firstConnected(){super.firstConnected(),this.setStyle({position:"fixed",zIndex:"1000"}),this.classList.add("ff-popup")}updated(){this.isConnected&&this.calculatePosition()}calculatePosition(){let e,t;const n=this.getBoundingClientRect();let i;if(t=this.portal?this.portal.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight},"center"===this.position)i=this.center(n,t);else if("anchor"===this.position){const s=this.anchor||this.parentElement;s&&(e=s.getBoundingClientRect(),i=this.positionToAnchor(n,e,t))}else i={x:this.positionX,y:this.positionY};this.keepVisible&&"center"!==this.position&&(i=this.keepElementVisible(i,n,t)),this.style.left=Math.round(i.x)+"px",this.style.top=Math.round(i.y)+"px"}center(e,t){return{x:Math.round(.5*(t.width-e.width)),y:Math.round(.5*(t.height-e.height))}}positionToAnchor(e,t,n){const i=this.align,s=this.justify,r=this.offsetX,o=this.offsetY,a={x:0,y:0};switch(i){case"start":a.x="start"!==s&&"end"!==s?t.left-e.width-r:t.left;break;case"end":a.x="start"!==s&&"end"!==s?t.right+r:t.right-e.width;break;case"fixed":a.x=this.positionX;break;default:a.x=t.left+.5*(t.width-e.width)}switch(s){case"start":a.y=t.top-e.height-o;break;case"end":a.y=t.bottom+o;break;case"fixed":a.y=this.positionY;break;default:a.y=t.top+.5*(t.height-e.height)}return a.x+=this.offsetX,a.y+=this.offsetY,a}keepElementVisible(e,t,n){const i=this.offsetX,s=this.offsetY;return t.width>n.width?e.x=.5*(n.width-t.width):e.xn.right&&(e.x=n.right-t.width-i),t.height>n.height?e.y=.5*(n.height-t.height):e.yn.bottom&&(e.y=n.bottom-t.height-s),e}onResize(){this.calculatePosition()}onCaptureEvent(e){e.target instanceof Node&&this.contains(e.target)||this.close()}onEatEvent(e){console.log("Popup.onEatEvent"),e.stopPropagation(),e.preventDefault()}};s([(0,i.Cb)({attribute:!1})],r.prototype,"anchor",void 0),s([(0,i.Cb)({attribute:!1})],r.prototype,"portal",void 0),s([(0,i.Cb)({type:String})],r.prototype,"position",void 0),s([(0,i.Cb)({type:String})],r.prototype,"align",void 0),s([(0,i.Cb)({type:String})],r.prototype,"justify",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"positionX",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"positionY",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"offsetX",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"offsetY",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"keepVisible",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"modal",void 0),r=s([(0,i.Mo)("ff-popup")],r);const o=r},39229:(e,t,n)=>{"use strict";var i,s=n(51120),r=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let o=i=class extends s.ZP{constructor(){super(),this.direction="horizontal",this.width=5,this.margin=20,this.detached=!1,this._isActive=!1,this._offset=0,this._position=0,this.addEventListener("pointerdown",(e=>this.onPointerDown(e))),this.addEventListener("pointermove",(e=>this.onPointerMove(e))),this.addEventListener("pointerup",(e=>this.onPointerUpOrCancel(e))),this.addEventListener("pointercancel",(e=>this.onPointerUpOrCancel(e)))}get position(){return this._position}isHorizontal(){return"horizontal"===this.direction}update(e){super.update(e);const t=this.isHorizontal(),n=this.width;this.setStyle({padding:t?`0 ${n}px`:`${n}px 0`,margin:t?`0 ${-n}px`:-n+"px 0",cursor:t?"col-resize":"row-resize"})}firstUpdated(){this.classList.add("ff-splitter"),this.setAttribute("touch-action","none"),this.setStyle({position:"relative",display:"block",zIndex:"1",touchAction:"none"})}onPointerDown(e){if(e.isPrimary){e.stopPropagation(),e.preventDefault(),this._isActive=!0,this.setPointerCapture(e.pointerId);const t=this.getBoundingClientRect();this._offset=this.isHorizontal()?t.left+.5*t.width-e.clientX:t.top+.5*t.height-e.clientY}}onPointerMove(e){if(e.isPrimary&&this._isActive){e.stopPropagation(),e.preventDefault();const t=this.parentElement;if(!t)return;const n=t.getBoundingClientRect(),s=this.isHorizontal(),r=s?n.width:n.height;let o=this._offset+(s?e.clientX-n.left:e.clientY-n.top),a=o/r;if(!this.detached){const e=this.previousElementSibling,n=this.nextElementSibling;if(e instanceof HTMLElement&&n instanceof HTMLElement){const l=Array.from(t.children);let c=0,h=r,d=!1;l.forEach((t=>{if(t instanceof i)return;if(t===e||t===n)return void(d=!0);const r=t.getBoundingClientRect(),o=s?r.width:r.height;h-=o,d||(c+=o)}));const u=this.margin,p=h-u;o-=c,o=op?p:o;const f=(h-o)/r;a=o/r,e.style.flexBasis=(100*a).toFixed(3)+"%",n.style.flexBasis=(100*f).toFixed(3)+"%",setTimeout((()=>window.dispatchEvent(new CustomEvent("resize"))),0)}}this._position=a,this.dispatchEvent(new CustomEvent(i.changeEvent,{detail:{direction:this.direction,position:this._position,isDragging:!0}}))}}onPointerUpOrCancel(e){e.isPrimary&&(e.preventDefault(),this._isActive=!1,this._position>0&&(e.stopPropagation(),this.dispatchEvent(new CustomEvent(i.changeEvent,{detail:{direction:this.direction,position:this._position,isDragging:!1}}))))}};o.changeEvent="ff-splitter-change",r([(0,s.Cb)({type:String})],o.prototype,"direction",void 0),r([(0,s.Cb)({type:Number})],o.prototype,"width",void 0),r([(0,s.Cb)({type:Number})],o.prototype,"margin",void 0),r([(0,s.Cb)({type:Boolean})],o.prototype,"detached",void 0),o=i=r([(0,s.Mo)("ff-splitter")],o)},13470:(e,t,n)=>{"use strict";var i=n(51120),s=n(53868);const r=new WeakMap,o=(0,s.XM)((e=>t=>{const n=r.get(t);if(void 0===e&&t instanceof s._l){if(void 0!==n||!r.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==n&&t.setValue(e);r.set(t,e)}));var a=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let l=class extends i.ZP{constructor(){super(...arguments),this.name="",this.index=0,this.text="",this.placeholder="",this.readonly=!1,this.align="left",this.maxLength=0,this.initialValue=""}get textArea(){return this.getElementsByTagName("textarea").item(0)}select(){const e=this.textArea;e&&e.select()}focus(){const e=this.textArea;e&&e.focus()}blur(){const e=this.textArea;e&&e.blur()}hasFocus(){const e=document.activeElement.shadowRoot?document.activeElement.shadowRoot.activeElement:document.activeElement;return this.textArea===e}firstConnected(){this.classList.add("ff-control","ff-text-edit")}shouldUpdate(e){return!this.hasFocus()&&super.shouldUpdate(e)}render(){var e;return i.dy``}onKeyDown(e){const t=e.target;"Escape"===e.key&&(this.revert(t),t.blur())}onChange(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!1)}onInput(e){e.stopPropagation(),e.preventDefault(),this.text=e.target.value,this.dispatchChangeEvent(this.text,!0)}onFocus(e){this.initialValue=e.target.value}onBlur(e){this.commit(e.target),this.requestUpdate()}revert(e){e.value=this.initialValue,this.dispatchChangeEvent(e.value,!1)}commit(e){this.initialValue=e.value,this.dispatchChangeEvent(e.value,!1)}dispatchChangeEvent(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{text:e,isEditing:t}}))}};a([(0,i.Cb)({type:String})],l.prototype,"name",void 0),a([(0,i.Cb)({type:Number})],l.prototype,"index",void 0),a([(0,i.Cb)({type:String})],l.prototype,"text",void 0),a([(0,i.Cb)({type:String})],l.prototype,"placeholder",void 0),a([(0,i.Cb)({type:Boolean})],l.prototype,"readonly",void 0),a([(0,i.Cb)({type:String})],l.prototype,"align",void 0),a([(0,i.Cb)({type:Number})],l.prototype,"maxLength",void 0),l=a([(0,i.Mo)("ff-text-edit")],l)},41029:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});class i{static registerType(e){if(this.types[e.typeName])throw new Error(`Annotation type '${e.typeName}' already registered.`);this.types[e.typeName]=e}static registerDefaultType(e){this.defaultType=e}static get typeNames(){return[this.defaultTypeName,...Object.keys(this.types).sort()]}static get defaultTypeName(){return this.defaultType.typeName}static getType(e){const t=this.types[e]||this.defaultType;if(!t)throw new Error(`type '${e}' not registered and no default type set.`);return t}static createInstance(e,t,n){return"Circle"===(t=t||e.data.style)?new(this.getType(t))(e,n):new(this.getType(t))(e)}}i.types={},i.defaultType=null},56752:(e,t,n)=>{"use strict";n.d(t,{m$:()=>A,ZP:()=>g});var i,s=n(19588),r=n(60531),o=n(94608),a=(n(44466),n(34287)),l=(n(98595),n(13470),n(53310)),c=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let h=i=class extends a.ZP{constructor(e,t){super(),this.content=null,this.sprite=null,this.resizeObserver=null,this.close=this.close.bind(this),this.onKeyDownMain=this.onKeyDownMain.bind(this),this.content=e,this.title="",this.sprite=t,this.position="center",this.modal=!0}static show(e,t,n){const s=new i(t,n);return e.appendChild(s),new Promise(((e,t)=>{s.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-annotation-overlay","sv-annotation")}connected(){super.connected(),this.sprite.addEventListener("link",this.close),this.resizeObserver||(this.resizeObserver=new ResizeObserver((()=>this.onResize()))),this.resizeObserver.observe(this)}disconnected(){this.resizeObserver.disconnect(),this.sprite.removeEventListener("link",this.close),super.disconnected()}render(){return a.dy` +
this.discardEvents(e)} @pointerdown=${e=>this.discardEvents(e)} aria-label="Annotation pop-up" aria-live="polite" aria-atomic="true" @keydown=${e=>this.onKeyDownMain(e)}> +
+
${this.title}
+ +
+
+ `}firstUpdated(e){super.firstUpdated(e),this.getElementsByClassName("ff-close-button")[0].focus();this.querySelector("#anno_container").append(this.content),setTimeout((()=>{this.title=this.sprite.annotation.title,this.requestUpdate()}),100)}onKeyDownMain(e){"Escape"===e.code?this.close():"Tab"===e.code&&(e.stopPropagation(),(0,l.e)((0,l.G)(this),e))}discardEvents(e){e.stopPropagation()}};h=i=c([(0,a.Mo)("sv-annotation-overlay")],h);const d=h,u=new s.P(0,1,0),p=new s.P,f=new s.P,m=new s.P;class g extends o.ZP{constructor(e,t){super(),this.isAdaptive=!0,this.isAnimating=!1,this.assetManager=null,this.audioManager=null,this.annotation=e,this.matrixAutoUpdate=!1}get typeName(){return this.constructor.typeName}update(){super.update();const e=this.annotation.data;this.position.fromArray(e.position),p.fromArray(e.direction).normalize(),this.quaternion.setFromUnitVectors(u,p),this.updateMatrix()}emitClickEvent(){const e={type:"click",annotation:this.annotation,sprite:this};this.dispatchEvent(e)}emitLinkEvent(e){const t={type:"link",annotation:this.annotation,sprite:this,link:e};this.dispatchEvent(t)}isBehindCamera(e,t){let n=null;n=t instanceof r.H&&t.cameras.length>0?t.cameras[0]:t;const i=n.matrixWorld.elements;return e.updateMatrixWorld(),f.setFromMatrixPosition(e.matrixWorld),m.setFromMatrixPosition(n.matrixWorld),p.set(-i[8],-i[9],-i[10]).normalize(),m.addScaledVector(p,n.near),m.sub(f),m.angleTo(p)<=Math.PI/2}}g.typeName="Annotation";class A extends o.KB{constructor(e){super(),this.isTruncated=!1,this.isOverlayed=!1,this.sprite=e,this.discardEvent=this.discardEvent.bind(this),this.addEventListener("pointercancel",this.discardEvent),this.addEventListener("click",this.discardEvent),this.setAttribute("aria-label","annotation"),this.setAttribute("aria-live","polite"),this.setAttribute("role","button")}get truncated(){return this.isTruncated}set truncated(e){this.isTruncated=e}get overlayed(){return this.isOverlayed}set overlayed(e){this.isOverlayed=e}firstConnected(){super.firstConnected(),this.classList.add("sv-annotation")}discardEvent(e){e.stopPropagation()}showOverlay(e){this.requestUpdate().then((()=>{d.show(this.parentElement,e,this.sprite).then((()=>{this.overlayed=!1,this.append(e),this.querySelector('[tabindex="0"]').focus(),this.requestUpdate()}))}))}}},10160:(e,t,n)=>{"use strict";var i=n(19588),s=n(29187),r=n(8035),o=n(75809),a=n(24479),l=n(51120),c=n(28581),h=n(47855),d=(n(98595),n(56752)),u=n(41029),p=n(19853),f=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const m=new h.ZP,g=new i.P(0,0,0),A=new i.P,v=new i.P,y=new i.P,b=new i.P;class _ extends d.ZP{constructor(e){super(e),this.adaptive=!0,this.offset=new s.Z,this.offset.matrixAutoUpdate=!1,this.add(this.offset),this.anchorMesh=new r.K(new o.u,new a.v),this.anchorMesh.frustumCulled=!1,this.anchorMesh.matrixAutoUpdate=!1,this.offset.add(this.anchorMesh),this.update()}dispose(){this.offset=null,this.anchorMesh=null,super.dispose()}update(){const e=this.annotation.data;this.anchorMesh.scale.setScalar(e.scale),this.anchorMesh.position.y=e.offset,this.anchorMesh.updateMatrix(),super.update()}renderHTMLElement(e,t,n){super.renderHTMLElement(e,t,n,this.anchorMesh,g);const i=this.anchorMesh;A.set(0,0,0),A.applyMatrix4(i.modelViewMatrix),v.set(0,1,0),v.applyMatrix4(i.modelViewMatrix),y.copy(v).sub(A).normalize(),b.set(0,0,1),this.viewAngle=y.angleTo(b);const s=c.Z.scaleLimit(this.viewAngle*c.Z.RAD2DEG,90,100,1,0),r=this.annotation.data.visible?s:0;e.setOpacity(r),e.setVisible(this.annotation.data.visible);const o=this.annotation.data,a=o.visible;this.offset.visible=a,this.adaptive!==this.isAdaptive&&(this.isAdaptive||(e.truncated=!1,e.classList.remove("sv-short"),e.requestUpdate()),this.adaptive=this.isAdaptive),this.setVisible(!this.isBehindCamera(this.offset,n)&&a),this.getVisible()||e.setVisible(this.getVisible()),this.adaptive&&!this.isAnimating&&o.expanded&&(e.truncated||(e.classList.contains("sv-expanded")?(this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth):e.requestUpdate().then((()=>{this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth,this.checkTruncate(e,t)}))),this.checkTruncate(e,t))}createHTMLElement(){return new x(this)}checkTruncate(e,t){e.getBoundingClientRect().left,t.getBoundingClientRect().left;const n=e.getBoundingClientRect().top-t.getBoundingClientRect().top+this.originalHeight>=t.offsetHeight;n!==e.truncated?(e.truncated=n,e.requestUpdate().then((()=>{this.checkBounds(e,t)}))):this.checkBounds(e,t)}checkBounds(e,t){const n=e.getBoundingClientRect().left-t.getBoundingClientRect().left,i=e.getBoundingClientRect().top-t.getBoundingClientRect().top;n+e.offsetWidth>=t.offsetWidth&&!e.classList.contains("sv-align-right")?(e.classList.add("sv-align-right"),e.requestUpdate()):n+e.offsetWidth=t.offsetHeight&&!e.classList.contains("sv-align-bottom")?(e.classList.add("sv-align-bottom"),e.requestUpdate()):i+e.offsetHeight0),s=this.sprite.audioManager;this.markerElement.innerText=n.marker;const r=l.dy` + ${this.isOverlayed?null:l.dy`
${t.title}
`} + ${n.imageUri&&!i?l.dy`
${t.imageAltText}${t.imageCredit?l.dy`
${t.imageCredit}
`:null}
`:null} + ${i?null:l.dy`

${(0,p.A)(t.lead)}

`} + ${n.audioId&&!this.isOverlayed?l.dy`
`:null} + ${n.articleId&&!i?l.dy``:null} + ${i?l.dy``:null}`;(0,l.sY)(r,this.contentElement),m.fromArray(n.color),this.markerElement.style.borderColor=m.toString(),this.isExpanded&&(this.contentElement.style.height="auto"),this.isExpanded===n.expanded||this.overlayed||(this.isExpanded=n.expanded,this.isExpanded?(n.audioId&&this.querySelector("#audio_container").append(s.getPlayerById(n.audioId)),this.classList.add("sv-expanded"),this.contentElement.style.display="block",this.contentElement.style.height="auto"):(this.classList.remove("sv-expanded"),this.contentElement.style.display="none",s.activeId==n.audioId&&this.sprite.audioManager.stop())),this.isExpanded&&(this.contentElement.style.removeProperty("transform"),this.classList.contains("sv-align-right")&&(this.contentElement.style.transform=`translateX(-${this.offsetWidth}px)`),this.classList.contains("sv-align-bottom")&&(this.contentElement.style.transform=`translateY(-${this.offsetHeight-this.markerElement.offsetHeight}px)`));const o=this.querySelector(".sv-audio-view");if(n.audioId&&!this.overlayed)if(n.expanded&&!o){this.querySelector("#audio_container").append(s.getPlayerById(n.audioId))}else!n.expanded&&o&&s.activeId==n.audioId&&s.stop()}onClickMarker(e){this.contentElement.style.display="block",e.stopPropagation(),this.sprite.emitClickEvent()}onClickArticle(e){e.stopPropagation(),this.sprite.emitLinkEvent(this.sprite.annotation.data.articleId)}onClickOverlay(e){e.stopPropagation();const t=this.contentElement;this.overlayed=!0,this.showOverlay(t)}onClickAudio(e){e.stopPropagation()}onKeyDown(e){if("Space"===e.code||"Enter"===e.code){"more-info"===e.target.id?this.onClickOverlay(e):this.sprite.emitClickEvent()}}onKeyDownArticle(e){if("Space"===e.code||"Enter"===e.code){"read-more"===e.target.id&&this.onClickArticle(e)}}};x=f([(0,l.Mo)("sv-circle-annotation")],x)},13301:(e,t,n)=>{"use strict";var i=n(19588),s=n(75809),r=n(64026),o=n(93122),a=n(28581),l=n(47855),c=n(51120),h=n(19853),d=(n(98595),n(56752)),u=n(41029),p=n(94608),f=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const m=["sv-q0","sv-q1","sv-q2","sv-q3"],g=new l.ZP,A=new i.P(0,1,0);class v extends d.ZP{constructor(e){super(e),this.quadrant=-1,this.adaptive=!0;const t=[];t.push(new i.P(0,0,0)),t.push(new i.P(0,1,0));const n=(new s.u).setFromPoints(t),a=new r.n({color:"#009cde",transparent:!0});a.toneMapped=!1,this.stemLine=new o.x(n,a),this.stemLine.frustumCulled=!1,this.stemLine.matrixAutoUpdate=!1,this.add(this.stemLine),this.update()}update(){const e=this.annotation.data;this.stemLine.scale.setScalar(e.scale),this.stemLine.position.y=e.offset,this.stemLine.updateMatrix();this.stemLine.material.color.fromArray(e.color),super.update()}renderHTMLElement(e,t,n){super.renderHTMLElement(e,t,n,this.stemLine,A);const i=a.Z.scaleLimit(this.viewAngle*a.Z.RAD2DEG,90,100,1,0),s=this.annotation.data.visible?i:0;if(this.stemLine.material.opacity=s,e.setOpacity(s),e.setVisible(this.annotation.data.visible),this.orientationQuadrant!==this.quadrant&&(e.classList.remove(m[this.quadrant]),e.classList.add(m[this.orientationQuadrant]),this.quadrant=this.orientationQuadrant),this.adaptive!==this.isAdaptive&&(this.isAdaptive?e.classList.remove("sv-static-width"):(e.classList.add("sv-static-width"),e.truncated=!1,e.classList.remove("sv-short"),e.requestUpdate()),this.adaptive=this.isAdaptive),this.setVisible(!this.isBehindCamera(this.stemLine,n)),this.adaptive&&!this.isAnimating&&this.annotation.data.expanded){if(!e.truncated){if(!e.classList.contains("sv-expanded"))return void e.requestUpdate().then((()=>{this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth,this.checkTruncate(e,t)}));this.originalHeight=e.offsetHeight,this.originalWidth=e.offsetWidth}this.checkTruncate(e,t)}}createHTMLElement(){return new y(this)}checkTruncate(e,t){const n=this.quadrant==p.hf.TopLeft||this.quadrant==p.hf.TopRight,i=this.quadrant==p.hf.TopRight||this.quadrant==p.hf.BottomRight,s=i?e.getBoundingClientRect().left-t.getBoundingClientRect().left:e.getBoundingClientRect().right-t.getBoundingClientRect().left,r=n?e.getBoundingClientRect().bottom-t.getBoundingClientRect().top:e.getBoundingClientRect().top-t.getBoundingClientRect().top,o=n?r-this.originalHeight<=0:r+this.originalHeight>=t.offsetHeight,a=i?s+this.originalWidth>=t.offsetWidth:s-this.originalWidth<=0,l=o||a;l!==e.truncated&&(e.truncated=l,l?e.classList.add("sv-short"):e.classList.remove("sv-short"),e.requestUpdate().then((()=>{})))}}v.typeName="Extended",u.Z.registerType(v);let y=class extends d.m${constructor(e){super(e),this.isExpanded=void 0,this.onClickTitle=this.onClickTitle.bind(this),this.onClickArticle=this.onClickArticle.bind(this),this.onClickAudio=this.onClickAudio.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyDownArticle=this.onKeyDownArticle.bind(this),this.onClickOverlay=this.onClickOverlay.bind(this),this.addEventListener("keydown",this.onKeyDown),this.titleElement=this.appendElement("div"),this.titleElement.classList.add("sv-title"),this.titleElement.addEventListener("click",this.onClickTitle),this.titleElement.setAttribute("tabindex","0"),this.wrapperElement=this.appendElement("div"),this.contentElement=this.createElement("div",null,this.wrapperElement),this.contentElement.classList.add("sv-annotation-body"),this.contentElement.style.display="none"}firstConnected(){super.firstConnected(),this.classList.add("sv-extended-annotation")}update(e){super.update(e);const t=this.sprite.annotation,n=this.sprite.annotation.data,i=this.sprite.audioManager,s=!this.overlayed&&this.truncated&&(n.imageUri||n.articleId||t.lead.length>0);this.titleElement.innerText=this.sprite.annotation.title;const r=c.dy` + ${n.imageUri&&!s?c.dy`
${t.imageAltText}${t.imageCredit?c.dy`
${t.imageCredit}
`:null}
`:null} + ${s?null:c.dy`

${(0,h.A)(t.lead)}

`} + ${n.audioId&&!this.overlayed?c.dy`
`:null} + ${n.articleId&&!s?c.dy``:null} + ${s?c.dy``:null}`;(0,c.sY)(r,this.contentElement),g.fromArray(n.color),this.style.borderColor=g.toString(),this.isExpanded&&(this.contentElement.style.height="auto"),this.isExpanded===n.expanded||this.overlayed||(this.isExpanded=n.expanded,this.isExpanded?(n.audioId&&this.querySelector("#audio_container").append(i.getPlayerById(n.audioId)),this.classList.add("sv-expanded"),this.style.minWidth=this.sprite.annotation.lead.length<40&&(!n.audioId||0==n.audioId.length)?"0":"",this.contentElement.style.display="block",this.contentElement.style.height="auto"):(this.classList.remove("sv-expanded"),this.contentElement.style.height="0",this.contentElement.style.display="none",i.activeId==n.audioId&&this.sprite.audioManager.stop()));const o=this.querySelector(".sv-audio-view");if(n.audioId&&!this.overlayed)if(n.expanded&&!o){this.querySelector("#audio_container").append(i.getPlayerById(n.audioId))}else!n.expanded&&o&&i.activeId==n.audioId&&i.stop()}onClickTitle(e){e.stopPropagation(),this.sprite.emitClickEvent()}onClickArticle(e){e.stopPropagation(),this.sprite.emitLinkEvent(this.sprite.annotation.data.articleId)}onClickAudio(e){e.stopPropagation()}onClickOverlay(e){e.stopPropagation();const t=this.contentElement;this.overlayed=!0,this.showOverlay(t)}onKeyDown(e){if("Space"===e.code||"Enter"===e.code){"more-info"===e.target.id?this.onClickOverlay(e):this.sprite.emitClickEvent()}}onKeyDownArticle(e){if("Space"===e.code||"Enter"===e.code){"read-more"===e.target.id&&this.onClickArticle(e)}}};y=f([(0,c.Mo)("sv-extended-annotation")],y)},91013:(e,t,n)=>{"use strict";var i=n(19588),s=n(75809),r=n(64026),o=n(93122),a=n(28581),l=n(47855),c=n(51120),h=(n(98595),n(56752)),d=n(41029),u=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};const p=["sv-q0","sv-q1","sv-q2","sv-q3"],f=new l.ZP,m=new i.P(0,1,0);class g extends h.ZP{constructor(e){super(e),this.quadrant=-1,this.adaptive=!0;const t=[];t.push(new i.P(0,0,0)),t.push(new i.P(0,1,0));const n=(new s.u).setFromPoints(t),a=new r.n({color:"#009cde",transparent:!0});a.toneMapped=!1,this.stemLine=new o.x(n,a),this.stemLine.frustumCulled=!1,this.stemLine.matrixAutoUpdate=!1,this.add(this.stemLine),this.update()}update(){const e=this.annotation.data;this.stemLine.scale.setScalar(e.scale),this.stemLine.position.y=e.offset,this.stemLine.updateMatrix();this.stemLine.material.color.fromArray(e.color),super.update()}renderHTMLElement(e,t,n){super.renderHTMLElement(e,t,n,this.stemLine,m);const i=a.Z.scaleLimit(this.viewAngle*a.Z.RAD2DEG,90,100,1,0),s=this.annotation.data.visible?i:0;this.stemLine.material.opacity=s,e.setOpacity(s),e.setVisible(this.annotation.data.visible),this.orientationQuadrant!==this.quadrant&&(e.classList.remove(p[this.quadrant]),e.classList.add(p[this.orientationQuadrant]),this.quadrant=this.orientationQuadrant),this.adaptive!==this.isAdaptive&&(this.isAdaptive?e.classList.remove("sv-static-width"):e.classList.add("sv-static-width"),this.adaptive=this.isAdaptive),this.setVisible(!this.isBehindCamera(this.stemLine,n))}createHTMLElement(){return new A(this)}}g.typeName="Standard",d.Z.registerDefaultType(g);let A=class extends h.m${constructor(e){super(e),this.onClickTitle=this.onClickTitle.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.titleElement=this.appendElement("div"),this.titleElement.classList.add("sv-title"),this.titleElement.addEventListener("click",this.onClickTitle),this.titleElement.addEventListener("keydown",this.onKeyDown),this.titleElement.setAttribute("tabindex","0")}firstConnected(){super.firstConnected(),this.classList.add("sv-standard-annotation")}update(e){super.update(e);const t=this.sprite.annotation.data;t.viewId.length?this.classList.add("sv-enable-events"):this.classList.remove("sv-enable-events"),this.titleElement.innerText=this.sprite.annotation.title,f.fromArray(t.color),this.style.borderColor=f.toString()}onClickTitle(e){e.stopPropagation(),this.sprite.emitClickEvent()}onKeyDown(e){"Space"!==e.code&&"Enter"!==e.code||(e.stopPropagation(),this.sprite.emitClickEvent())}};A=u([(0,c.Mo)("sv-standard-annotation")],A)},13772:(e,t,n)=>{"use strict";n.d(t,{Z:()=>X});var i=n(26041),s=n(10564),r=n(56166),o=n(89167),a=n(31491),l=n(22040),c=(n(98595),n(18257),n(85203),n(44661)),h=n(97008),d=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class u extends h.ZP{createView(){return new p(this)}}u.typeName="CVViewTool",u.text="View",u.icon="eye";let p=class extends h.v5{firstConnected(){super.firstConnected(),this.classList.add("sv-view-tool-view")}render(){const e=this.activeDocument;if(!e)return h.dy``;this.tool;const t=e.setup.navigation,n=e.setup.language,i=t.ins.projection,s=t.ins.preset,r=t.ins.zoomExtents,o=[c.LY.Front,c.LY.Back,c.LY.Left,c.LY.Right,c.LY.Top,c.LY.Bottom];return h.dy``}onActiveDocument(e,t){this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};p=d([(0,h.Mo)("sv-view-tool-view")],p);var f=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class m extends h.ZP{createView(){return new g(this)}}m.typeName="CVRenderTool",m.text="Material",m.icon="palette";let g=class extends h.v5{constructor(){super(...arguments),this.viewer=null}firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-render-tool-view")}render(){this.tool;const e=this.activeDocument,t=this.viewer;if(!t)return h.dy``;const n=t.ins.shader,i=e.setup.language;return h.dy`
+
+ +
+
`}onActiveDocument(e,t){this.viewer&&(this.viewer.ins.shader.off("value",this.onUpdate,this),this.viewer=null),t&&(this.viewer=t.setup.viewer,this.viewer.ins.shader.on("value",this.onUpdate,this))}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};g=f([(0,h.Mo)("sv-render-tool-view")],g);var A=n(76969),v=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class y extends h.ZP{createView(){return new b(this)}}y.typeName="CVEnvironmentTool",y.text="Environment",y.icon="environment";let b=class extends h.v5{firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-environment-tool-view")}render(){this.tool;if(!this.activeDocument)return h.dy`No active document`;const e=this.activeDocument.setup,t=e.grid,n=e.floor,i=e.background,s=i.ins.style.getValidatedValue()===A.u.Solid,r=e.environment,o=e.language;return h.dy`
+
+ + + ${s?null:h.dy``} + + + + + +
+
`}onActiveDocument(e,t){if(e){e.setup.background.ins.style.off("value",this.onUpdate,this)}if(t){t.setup.background.ins.style.on("value",this.onUpdate,this)}this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};b=v([(0,h.Mo)("sv-environment-tool-view")],b);var _=n(16967),x=(n(97010),n(90470),n(46436),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});class w extends h.ZP{constructor(){super(...arguments),this.lights=[],this.ins=this.addInputs(w.ins),this.outs=this.addOutputs(w.outs)}update(e){return this.outs.light.setValue(this.lights[this.ins.light.getValidatedValue()]),!0}createView(){return new E(this)}onActiveDocument(e,t){this.lights=t?t.getInnerComponents(_.Z):[],this.ins.light.setOptions(this.lights.map((e=>e.node.name))),this.outs.light.setValue(this.lights[0]),super.onActiveDocument(e,t)}}w.typeName="CVLightTool",w.text="Lights",w.icon="bulb",w.ins={light:h.V5.Option("Tool.Light",[])},w.outs={light:h.V5.Object("Tool.SelectedLight",_.Z)};let E=class extends h.v5{constructor(){super(...arguments),this.lights=null}firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-light-tool-view")}connected(){super.connected(),this.tool.outs.light.on("value",this.onUpdate,this)}disconnected(){this.tool.outs.light.off("value",this.onUpdate,this),super.disconnected()}render(){const e=this.tool,t=e.lights,n=this.activeDocument;if(!t||!n)return h.dy`No editable lights in this scene.`;const i=e.outs.light.value,s=n.setup.navigation,r=n.setup.language,o=i?h.dy`
+ +
+ + + +
+
`:null;return h.dy`${o}
+
+ + +
+
`}onActiveDocument(e,t){e&&e.setup.navigation.ins.lightsFollowCamera.off("value",this.onUpdate,this),t&&t.setup.navigation.ins.lightsFollowCamera.on("value",this.onUpdate,this),this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("sv-property-options")[0].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};E=x([(0,h.Mo)("sv-light-tool-view")],E);n(77804);var C=n(29767),S=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class M extends h.ZP{createView(){return new I(this)}}M.typeName="CVTapeTool",M.text="Measure",M.icon="tape";let I=class extends h.v5{constructor(){super(...arguments),this.firstRender=!0,this.statusMsg=""}firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-tape-tool-view")}render(){const e=this.activeDocument;if(!e)return h.dy``;this.tool;const t=e.setup.tape,n=t.ins.enabled,i=t.outs.state.value,s=t.outs.distance.value,r=e.setup.language;let o;if(n.value)if(0===s)o=r.getLocalizedString("Tap on model to set start of tape")+".";else if(i===C.T.SetStart){const t=e.root.scene.ins.units.getOptionText();o=`${s.toFixed(2)} ${t}`}else o=r.getLocalizedString("Tap on model to set end of tape")+".";else o=r.getLocalizedString("Switch on to take measurements")+".";return this.statusMsg=o,h.dy`
+
+ +
+
+
`}updated(e){super.updated(e);const t=this.getElementsByClassName("ff-string").item(0);t&&(t.innerHTML=this.statusMsg,this.firstRender&&(setTimeout((()=>{t.innerHTML=`
${this.statusMsg}
`}),200),this.firstRender=!1))}onActiveDocument(e,t){e&&e.setup.tape.off("update",this.onUpdate,this),t&&t.setup.tape.on("update",this.onUpdate,this),this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("ff-button")[1].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};I=S([(0,h.Mo)("sv-tape-tool-view")],I);var T=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class P extends h.ZP{createView(){return new B(this)}}P.typeName="CVSliceTool",P.text="Slice",P.icon="knife";let B=class extends h.v5{firstConnected(){super.firstConnected(),this.classList.add("sv-group","sv-slice-tool-view")}render(){const e=this.activeDocument;if(!e)return h.dy``;this.tool;const t=e.setup.slicer,n=t.ins.enabled,i=t.ins.axis,s=t.ins.position,r=e.setup.language;return h.dy`
+
+ + + +
+
`}onActiveDocument(e,t){this.requestUpdate()}async setFocus(){await this.updateComplete;this.getElementsByTagName("ff-button")[1].focus()}onClose(e){this.parentElement.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}};B=T([(0,h.Mo)("sv-slice-tool-view")],B);var R=n(90199);class D extends R.Z{get toolProvider(){return this.getComponent(l.Z)}createComponents(){this.createComponent(l.Z),this.createComponent(u),this.createComponent(m),this.createComponent(y),this.createComponent(w),this.createComponent(M),this.createComponent(P)}}D.typeName="NVTools";const L=[a.Z,l.Z,u,m,y,w,M,P,D];var N=n(47227),k=n(25864),O=n(63872),U=n(96180),F=n(11359),V=n(38303),Q=n(87203),z=n(94860),G=n(43875),j=n(30242),H=n(40490),$=n(60206),W=n(15271),Z=n(88300),q=n(26629),K=n(51462),Y=n(1594);class X{constructor(e,t,n){this.props=t||{},console.log(X.splashMessage);const s=new i.Z;s.add(o.Z),s.add(L);const a=this.system=new r.Z(s),l=a.graph.createCustomNode(V.Z);a.graph.createCustomNode(D),a.graph.createCustomNode(Q.Z),this.analytics.startTimer(),e&&new z.Z(this).appendTo(e),n||(this.documentProvider.createDocument(N),this.evaluateProps());(/^(iPad|iPhone|iPod)/.test(window.navigator.platform)||/^Mac/.test(window.navigator.platform)&&window.navigator.maxTouchPoints>1)&&(window.createImageBitmap=void 0),l.pulse.start()}get assetManager(){return this.system.getMainComponent(O.Z)}get assetReader(){return this.system.getMainComponent(U.Z)}get documentProvider(){return this.system.getMainComponent(k.Z)}get analytics(){return this.system.getMainComponent(F.Z)}dispose(){this.assetReader.dispose(),this.documentProvider.activeComponent.clearNodeTree(),this.system.getMainComponent(W.Z).views.forEach((e=>e.dispose()))}setBaseUrl(e){this.assetManager.baseUrl=e}loadDocument(e,t,n){const i=G.$l[n];return this.assetReader.getJSON(e).then((n=>(t=void 0===t?!n.lights&&!n.cameras:t,this.documentProvider.amendDocument(n,e,t)))).then((e=>(isFinite(i)&&e.setup.viewer.ins.quality.setValue(i),e)))}reloadDocument(){this.documentProvider.removeActiveDocument(),this.documentProvider.createDocument(N),this.evaluateProps()}loadModel(e,t){return this.documentProvider.appendModel(e,t)}loadGeometry(e,t,n,i,s){return this.documentProvider.appendGeometry(e,t,n,i,s)}evaluateProps(){const e=this.props,t=this.assetManager,n=new URL(window.location.href).searchParams;e.root=e.root||n.get("root")||n.get("r"),e.dracoRoot=e.dracoRoot||n.get("dracoRoot")||n.get("dr"),e.resourceRoot=e.resourceRoot||n.get("resourceRoot")||n.get("rr"),e.document=e.document||n.get("document")||n.get("d"),e.model=e.model||n.get("model")||n.get("m"),e.geometry=e.geometry||n.get("geometry")||n.get("g"),e.texture=e.texture||n.get("texture")||n.get("t"),e.occlusion=e.occlusion||n.get("occlusion")||n.get("o"),e.normals=e.normals||n.get("normals")||n.get("n"),e.quality=e.quality||n.get("quality")||n.get("q"),e.uiMode=e.uiMode||n.get("uiMode")||n.get("u"),e.bgColor=e.bgColor||n.get("bgColor")||n.get("bc"),e.bgStyle=e.bgStyle||n.get("bgStyle")||n.get("bs"),e.controls=e.controls||n.get("controls")||n.get("ct"),e.prompt=e.prompt||n.get("prompt")||n.get("pm"),e.reader=e.reader||n.get("reader")||n.get("rdr"),e.lang=e.lang||n.get("lang")||n.get("l");const i=e.root||e.document||e.model||e.geometry;if(this.setBaseUrl(new URL(i||".",window.location).href),e.uiMode){let t=0,n=!1;const i=Object.values(H.p).filter((e=>"string"==typeof e));e.uiMode.split("|").forEach((e=>{const s=e.toLowerCase();i.includes(s)&&(t+=H.p[s],n=!0)})),n&&this.documentProvider.activeComponent.setup.interface.ins.visibleElements.setValue(t)}e.dracoRoot&&this.assetReader.setDracoPath(e.dracoRoot),e.resourceRoot&&this.assetReader.setSystemAssetPath(e.resourceRoot),e.lang&&this.setLanguage(e.lang),e.document?(e.document=t.getAssetName(e.document),this.loadDocument(e.document,void 0,e.quality).then((()=>this.postLoadHandler(e))).catch((e=>s.ZP.show(`Failed to load document: ${e.message}`,"error")))):e.model?(e.model=t.getAssetName(e.model),this.assetReader.getText(e.model).then((()=>{this.loadModel(e.model,e.quality),this.postLoadHandler(e)})).catch((e=>s.ZP.show(`Bad Model Path: ${e.message}`,"error")))):e.geometry?(e.geometry=t.getAssetName(e.geometry),e.texture=t.getAssetName(e.texture),e.occlusion=t.getAssetName(e.occlusion),e.normals=t.getAssetName(e.normals),this.assetReader.getText(e.geometry).then((()=>{this.loadGeometry(e.geometry,e.texture,e.occlusion,e.normals,e.quality),this.postLoadHandler(e)})).catch((e=>s.ZP.show(`Bad Geometry Path: ${e.message}`,"error")))):e.root&&this.loadDocument("scene.svx.json",void 0).then((()=>this.postLoadHandler(e))).catch((()=>{}))}postLoadHandler(e){if(this.assetManager.ins.baseUrlValid.setValue(!0),e.bgColor){const t=e.bgColor.split(" ");this.setBackgroundColor(t[0],t[1]||null)}e.bgStyle&&this.setBackgroundStyle(e.bgStyle),e.controls&&this.enableNavigation(e.controls),e.prompt&&this.enablePrompt(e.prompt),e.reader&&this.enableReader(e.reader)}toggleAnnotations(){const e=this.system.getMainComponent(k.Z).activeComponent.setup.viewer.ins,t=this.system.getMainComponent(l.Z).ins;t.visible.value&&t.visible.setValue(!1),e.annotationsVisible.setValue(!e.annotationsVisible.value),this.analytics.sendProperty("Annotations_Visible",e.annotationsVisible.value)}toggleReader(){const e=this.system.getMainComponent(k.Z).activeComponent.setup.reader,t=e.ins;t.enabled.setValue(!t.enabled.value),t.focus.setValue(t.enabled.value),t.enabled.value&&t.articleId.setValue(1===e.articles.length?e.articles[0].article.id:""),this.analytics.sendProperty("Reader_Enabled",t.enabled.value)}toggleTours(){const e=this.system.getMainComponent(k.Z).activeComponent.setup.tours.ins,t=this.system.getMainComponent(k.Z).activeComponent.setup.reader.ins;e.enabled.value?e.enabled.setValue(!1):(t.enabled.value&&t.enabled.setValue(!1),e.enabled.setValue(!0),e.tourIndex.setValue(-1)),this.analytics.sendProperty("Tours_Enabled",e.enabled.value)}toggleTools(){const e=this.system.getMainComponent(l.Z).ins,t=this.system.getMainComponent(k.Z).activeComponent.setup.viewer.ins;t.annotationsVisible.value&&t.annotationsVisible.setValue(!1),e.visible.setValue(!e.visible.value),this.analytics.sendProperty("Tools_Visible",e.visible.value)}toggleMeasurement(){const e=this.system.getMainComponent(k.Z).activeComponent.setup.tape.ins;e.visible.setValue(!e.visible.value)}enableAR(){this.system.getMainComponent(j.Z).ins.enabled.setValue(!0),this.analytics.sendProperty("AR_enabled",!0)}getArticles(){return this.system.getMainComponent(k.Z).activeComponent.setup.reader.articles.map((e=>e.article.data))}getAnnotations(){const e=this.system.getComponent(q.Z).getGraphComponents(K.Z);let t=[];return e.forEach((e=>{t=t.concat(e.getAnnotations())})),t}getCameraOrbit(e){const t=this.system.getMainComponent(k.Z).activeComponent.setup.navigation.ins;let n=t.orbit.value;if(e){const i=e.toLowerCase();if("max"===i)n=t.maxOrbit.value;else if("min"===i)n=t.minOrbit.value;else if("active"!==i)return void console.error("Error: getCameraOrbit invalid type param.")}return n.slice(0,2)}setCameraOrbit(e,t){const n=this.system.getMainComponent(k.Z).activeComponent.setup.navigation.ins,i=parseFloat(e),s=parseFloat(t);isNaN(i)||isNaN(s)?console.error("Error: setCameraOrbit param is not a number."):n.orbit.setValue([i,s,0])}getCameraOffset(e){const t=this.system.getMainComponent(k.Z).activeComponent.setup.navigation.ins;let n=t.offset.value;if(e){const i=e.toLowerCase();if("max"===i)n=t.maxOffset.value;else if("min"===i)n=t.minOffset.value;else if("active"!==i)return void console.error("Error: getCameraOffset invalid type param.")}return n.slice(0,3)}setCameraOffset(e,t,n){const i=this.system.getMainComponent(k.Z).activeComponent.setup.navigation.ins;let s=parseFloat(e),r=parseFloat(t),o=parseFloat(n);if(isNaN(s)||isNaN(r)||isNaN(o))console.error("Error: setCameraOffset param is not a number.");else{const e=i.minOffset.value,t=i.maxOffset.value;s=(0,Z.u)(s,e[0],t[0]),r=(0,Z.u)(r,e[1],t[1]),o=(0,Z.u)(o,e[2],t[2]),i.offset.setValue([s,r,o])}}setBackgroundColor(e,t){const n=this.system.getMainComponent(k.Z).activeComponent.setup.background.ins,i=document.createElement("div");if(i.id="temp-color",i.style.color=e,document.body.appendChild(i),""!==i.style.color){const e=getComputedStyle(i).color.split("(")[1].split(")")[0].split(",").map((e=>parseInt(e)/255));n.color0.setValue(e)}else console.error("Error: Color0 param is invalid.");if(t)if(i.style.color=t,""!==i.style.color){const e=getComputedStyle(i).color.split("(")[1].split(")")[0].split(",").map((e=>parseInt(e)/255));n.color1.setValue(e)}else console.error("Error: Color1 param is invalid.");document.body.removeChild(i)}setBackgroundStyle(e){const t=this.system.getMainComponent(k.Z).activeComponent.setup.background.ins,n=Object.values($.u6).filter((e=>"string"==typeof e)).find((t=>t.toLowerCase()===e.toLowerCase()));void 0!==n?t.style.setValue($.u6[n]):console.error("Error: Style param is invalid.")}setTourStep(e,t,n){const i=this.system.getMainComponent(k.Z).activeComponent.setup.tours.ins,s=this.system.getMainComponent(k.Z).activeComponent.setup.tours.outs;let r=parseInt(e),o=parseInt(t);!isNaN(r)&&!isNaN(o)&&r>=0&&o>=0?(i.tourIndex.setValue(r),n?(s.stepIndex.setValue(o-1),i.next.set()):i.stepIndex.setValue(o)):console.error("Error: setTourStep param ["+r+" "+o+"] is not a valid number.")}enableNavigation(e){const t=this.isTrue(e);if(null!=t){this.system.getMainComponent(k.Z).activeComponent.setup.navigation.ins.pointerEnabled.setValue(t)}else console.error("Error: enableNavigation param is not valid.")}enablePrompt(e){const t=this.isTrue(e);if(null!=t){this.system.getMainComponent(k.Z).activeComponent.setup.navigation.ins.promptEnabled.setValue(t)}else console.error("Error: enablePrompt param is not valid.")}enableReader(e){const t=this.isTrue(e);if(null!=t){this.system.getMainComponent(k.Z).activeComponent.setup.reader.ins.visible.setValue(t)}else console.error("Error: enableReader param is not valid.")}setLanguage(e){const t=this.system.getMainComponent(k.Z).activeComponent.setup.language.ins,n=e.toUpperCase();n in Y.PD?t.language.setValue(Y.PD[n]):console.error("Error: setLanguage param is not a valid language id.")}setActiveArticle(e){const t=this.system.getMainComponent(k.Z).activeComponent.setup.reader;t.ins.enabled.setValue(!0),t.ins.articleId.setValue(e)}isTrue(e){let t;const n=e.toLowerCase();return"true"===n?t=!0:"false"===n&&(t=!1),t}}X.splashMessage="\n _________ .__ __ .__ .__ ________ ________ \n / _____/ _____ |__|/ |_| |__ __________ ____ |__|____ ____ \\_____ \\\\______ \\ \n \\_____ \\ / \\| \\ __\\ | \\ / ___/ _ \\ / \\| \\__ \\ / \\ _(__ < | | \\ \n / \\ Y Y \\ || | | Y \\\\___ ( <_> ) | \\ |/ __ \\| | \\ / \\| ` \\\n/_______ /__|_| /__||__| |___| /____ >____/|___| /__(____ /___| / /______ /_______ /\n \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \\/ \n \nVoyager - 3D Explorer and Tool Suite\n3D Foundation Project\n(c) 2024 Smithsonian Institution\n\nhttps://3d.si.edu\nhttps://github.com/smithsonian/dpo-voyager\n\n-----------------------------------------------------\nVersion: Voyager v0.43.0 PROD\n-----------------------------------------------------\n ",window.VoyagerExplorer=X},89167:(e,t,n)=>{"use strict";n.d(t,{Z:()=>fe,J:()=>pe});var i=n(18894),s=n(26220),r=n(63833),o=n(92989),a=n(403),l=n(15271),c=n(38080),h=n(18345),d=n(36283),u=n(90199),p=n(11359),f=n(63872),m=n(96180),g=n(48377),A=n(25864),v=n(26629),y=n(79815),b=n(13227),_=n(84678),x=n(3388),w=n(80038);class E extends w.ZP{constructor(){super(...arguments),this.ins=this.addInputs(E.ins)}get model(){return this.getComponent(x.Z)}update(e){return!0}}E.typeName="CVAnnotations",E.ins={};var C=n(51462),S=n(31105),M=n(27884),I=n(53414),T=n(19588),P=n(54992),B=n(16967);new T.P;class R extends B.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(R.pointLightIns),this.object3D=new P.c}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return n.position.changed&&(t.position.fromArray(n.position.value),t.updateMatrix()),(n.distance.changed||n.decay.changed)&&(t.distance=n.distance.value,t.decay=n.decay.value,t.shadow.camera.near=t.distance?t.distance/800:.5),t.updateMatrix(),!0}}R.typeName="CPointLight",R.pointLightIns={position:w.V5.Vector3("Light.Position"),distance:w.V5.Number("Light.Distance"),decay:w.V5.Number("Light.Decay",1)};class D extends R{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.distance,this.ins.decay,this.ins.shadowEnabled,this.ins.shadowResolution,this.ins.shadowBlur]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){this.ins.shadowEnabled.value&&this.light.shadow.map&&this.light.shadow.map.dispose(),super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==D.type)throw new Error("light type mismatch: not a point light");return n.point=n.point||{},i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,distance:n.point.distance||i.distance.schema.preset,decay:void 0!==n.point.decay?n.point.decay:i.decay.schema.preset,shadowEnabled:n.shadowEnabled||!1,shadowResolution:void 0!==n.shadowResolution&&B.B[n.shadowResolution]||1,shadowBlur:void 0!==n.shadowBlur?n.shadowBlur:i.shadowBlur.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value,point:{distance:n.distance.value,decay:n.decay.value}};i.type=D.type,n.shadowEnabled.value&&(i.shadowEnabled=!0,n.shadowBlur.isDefault()||(i.shadowBlur=n.shadowBlur.value),n.shadowResolution.isDefault()||(i.shadowResolution=B.B[n.shadowResolution.value])),e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}D.typeName="CVPointLight",D.type="point",D.text="Point Light",D.icon="bulb";var L=n(16426),N=n(71050);class k extends B.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(k.spotLightIns),this.object3D=new L.P,this.light.target.matrixAutoUpdate=!1}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return(n.position.changed||n.target.changed)&&(t.position.fromArray(n.position.value),t.target.position.fromArray(n.target.value),t.updateMatrix(),t.target.updateMatrix()),(n.distance.changed||n.decay.changed||n.angle.changed||n.penumbra.changed)&&(t.distance=n.distance.value,t.decay=n.decay.value,t.angle=n.angle.value*N.M8.DEG2RAD,t.penumbra=n.penumbra.value,t.shadow.camera.near=t.distance?t.distance/800:.5),!0}onAddToParent(e){super.onAddToParent(e),e.add(this.light.target)}onRemoveFromParent(e){super.onRemoveFromParent(e),e.remove(this.light.target)}}k.typeName="CSpotLight",k.spotLightIns={position:w.V5.Vector3("Light.Position"),target:w.V5.Vector3("Light.Target",[0,-1,0]),distance:w.V5.Number("Light.Distance"),decay:w.V5.Number("Light.Decay",1),angle:w.V5.Number("Light.Angle",45),penumbra:w.V5.Percent("Light.Penumbra",.5)};class O extends k{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.distance,this.ins.decay,this.ins.angle,this.ins.penumbra,this.ins.shadowEnabled,this.ins.shadowResolution,this.ins.shadowBlur]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){this.ins.shadowEnabled.value&&this.light.shadow.map&&this.light.shadow.map.dispose(),super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==O.type)throw new Error("light type mismatch: not a spot light");return n.spot=n.spot||{},i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,target:i.target.schema.preset,distance:n.spot.distance||i.distance.schema.preset,decay:void 0!==n.spot.decay?n.spot.decay:i.decay.schema.preset,angle:void 0!==n.spot.angle?n.spot.angle:i.angle.schema.preset,penumbra:n.spot.penumbra||i.penumbra.schema.preset,shadowEnabled:n.shadowEnabled||!1,shadowResolution:void 0!==n.shadowResolution&&B.B[n.shadowResolution]||1,shadowBlur:void 0!==n.shadowBlur?n.shadowBlur:i.shadowBlur.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value,spot:{distance:n.distance.value,decay:n.decay.value,angle:n.angle.value,penumbra:n.penumbra.value}};i.type=O.type,n.shadowEnabled.value&&(i.shadowEnabled=!0,n.shadowBlur.isDefault()||(i.shadowBlur=n.shadowBlur.value),n.shadowResolution.isDefault()||(i.shadowResolution=B.B[n.shadowResolution.value])),e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}O.typeName="CVSpotLight",O.type="spot",O.text="Spot Light",O.icon="spot";var U=n(40490),F=n(27643),V=n(5249),Q=n(44661),z=n(71507),G=n(97322),j=n(6461),H=n(29767),$=n(63531),W=n(7134),Z=n(74572),q=n(24856),K=n(30242),Y=n(93072),X=n(17467),J=n(38303),ee=n(87203),te=n(82567),ne=n(75222),ie=n(19816);class se extends ie._{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class re extends B.Z{constructor(e,t){super(e,t),this.object3D=new se}get light(){return this.object3D}}re.typeName="CAmbientLight";class oe extends re{get settingProperties(){return[this.ins.color,this.ins.intensity]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==oe.type)throw new Error("light type mismatch: not an ambient light");return n.point=n.point||{},i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value};i.type=oe.type,e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}oe.typeName="CVAmbientLight",oe.type="ambient",oe.text="Ambient Light",oe.icon="globe";var ae=n(57090);class le extends B.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(le.hemiLightIns),this.object3D=new ae.v}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return(n.ground.changed||n.intensity.changed)&&(t.groundColor.fromArray(n.ground.value),t.intensity=n.intensity.value),!0}}le.typeName="CHemisphereLight",le.hemiLightIns={ground:w.V5.ColorRGB("Light.Ground",[.31,.31,.125])};class ce extends le{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.ground]}get snapshotProperties(){return[this.ins.color,this.ins.intensity,this.ins.ground]}dispose(){super.dispose()}fromDocument(e,t){var n,i;if(!isFinite(t.light))throw new Error("light property missing in node");const s=e.lights[t.light],r=this.ins;if(s.type!==ce.type)throw new Error("light type mismatch: not an hemisphere light");return s.point=s.point||{},r.copyValues({color:void 0!==s.color?s.color:r.color.schema.preset,intensity:void 0!==s.intensity?s.intensity:r.intensity.schema.preset,ground:null!==(i=null===(n=s.hemisphere)||void 0===n?void 0:n.ground)&&void 0!==i?i:r.ground.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value,hemisphere:{ground:n.ground.cloneValue()}};i.type=ce.type,e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}ce.typeName="CVHemisphereLight",ce.type="hemisphere",ce.text="Hemisphere Light",ce.icon="half-sun";var he=n(50910);class de extends B.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(de.rectLightIns),this.object3D=new he.T}get light(){return this.object3D}update(e){super.update(e);const t=this.light,n=this.ins;return(n.position.changed||n.target.changed)&&(t.position.fromArray(n.position.value),t.updateMatrix()),!0}}de.typeName="CRectLight",de.rectLightIns={position:w.V5.Vector3("Light.Position",[0,1,0]),target:w.V5.Vector3("Light.Target",[0,0,0]),size:w.V5.Vector2("Light.Size",[10,10])};class ue extends de{get settingProperties(){return[this.ins.color,this.ins.intensity]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if(n.type!==ue.type)throw new Error(`light type mismatch: not a directional light (${n.type})`);return i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,target:i.target.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value};i.type=ue.type,e.lights=e.lights||[];const s=e.lights.length;return e.lights.push(i),s}}ue.typeName="CVRectLight",ue.type="rect",ue.text="Rectangular Light",ue.icon="area";const pe=[I.Z,D,O,oe,ce,ue],fe=[i.ZP,s.Z,r.Z,o.Z,a.Z,l.Z,c.Z,h.Z,d.Z,u.Z,p.Z,K.Z,f.Z,m.Z,g.Z,A.Z,v.Z,y.Z,b.Z,_.Z,x.Z,E,C.Z,S.Z,M.Z,...pe,U.Z,F.Z,V.ZP,Q.ZP,z.Z,G.Z,j.Z,H.Z,$.Z,W.Z,Z.Z,q.Z,Y.Z,X.Z,J.Z,ee.Z,te.Z,ne.Z]},30242:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Ke});var i={};n.r(i),n.d(i,{ArcCurve:()=>C,CatmullRomCurve3:()=>B,CubicBezierCurve:()=>N,CubicBezierCurve3:()=>k,EllipseCurve:()=>E,LineCurve:()=>O,LineCurve3:()=>U,QuadraticBezierCurve:()=>F,QuadraticBezierCurve3:()=>V,SplineCurve:()=>Q});var s=n(80038),r=n(15271),o=n(92642),a=n(26220),l=n(10564),c=n(82587),h=n(19588),d=n(40693),u=n(37840),p=n(78943),f=n(96643),m=n(45787);class g{constructor(e,t,n=0,i=1/0){this.ray=new f.z(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new m.S,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return v(e,this,n,t),n.sort(A),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i0)){l=i;break}l=i-1}if(i=l,n[i]===r)return i/(s-1);const c=n[i];return(i+(r-c)/(n[i+1]-c))/(s-1)}getTangent(e,t){const n=1e-4;let i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);const r=this.getPoint(i),o=this.getPoint(s),a=t||(r.isVector2?new d.F:new h.P);return a.copy(o).sub(r).normalize(),a}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new h.P,i=[],s=[],r=[],o=new h.P,a=new c.y;for(let t=0;t<=e;t++){const n=t/e;i[t]=this.getTangentAt(n,new h.P)}s[0]=new h.P,r[0]=new h.P;let l=Number.MAX_VALUE;const d=Math.abs(i[0].x),u=Math.abs(i[0].y),p=Math.abs(i[0].z);d<=l&&(l=d,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),p<=l&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],o),r[0].crossVectors(i[0],s[0]);for(let t=1;t<=e;t++){if(s[t]=s[t-1].clone(),r[t]=r[t-1].clone(),o.crossVectors(i[t-1],i[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(x.uZ(i[t-1].dot(i[t]),-1,1));s[t].applyMatrix4(a.makeRotationAxis(o,e))}r[t].crossVectors(i[t],s[t])}if(!0===t){let t=Math.acos(x.uZ(s[0].dot(s[e]),-1,1));t/=e,i[0].dot(o.crossVectors(s[0],s[e]))>0&&(t=-t);for(let n=1;n<=e;n++)s[n].applyMatrix4(a.makeRotationAxis(i[n],t*n)),r[n].crossVectors(i[n],s[n])}return{tangents:i,normals:s,binormals:r}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class E extends w{constructor(e=0,t=0,n=1,i=1,s=0,r=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=r,this.aClockwise=o,this.aRotation=a}getPoint(e,t){const n=t||new d.F,i=2*Math.PI;let s=this.aEndAngle-this.aStartAngle;const r=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(l)/s)+1)*s:0===c&&l===s-1&&(l=s-2,c=1),this.closed||l>0?o=i[(l-1)%s]:(M.subVectors(i[0],i[1]).add(i[0]),o=M);const d=i[l%s],u=i[(l+1)%s];if(this.closed||l+2i.length-2?i.length-1:r+1],h=i[r>i.length-3?i.length-1:r+2];return n.set(R(o,a.x,l.x,c.x,h.x),R(o,a.y,l.y,c.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const e=i[s]-n,r=this.curves[s],o=r.getLength(),a=0===o?0:1-e/o;return r.getPointAt(a,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class j extends G{constructor(e){super(e),this.uuid=x.DO(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n80*n){a=c=e[0],l=h=e[1];for(let t=n;tc&&(c=d),u>h&&(h=u);p=Math.max(c-a,h-l),p=0!==p?32767/p:0}return K(r,o,n,a,l,p,0),o};function Z(e,t,n,i,s){let r,o;if(s===function(e,t,n,i){let s=0;for(let r=t,o=n-i;r0)for(r=t;r=t;r-=i)o=me(r,e[r],e[r+1],o);return o&&ce(o,o.next)&&(ge(o),o=o.next),o}function q(e,t){if(!e)return e;t||(t=e);let n,i=e;do{if(n=!1,i.steiner||!ce(i,i.next)&&0!==le(i.prev,i,i.next))i=i.next;else{if(ge(i),i=t=i.prev,i===i.next)break;n=!0}}while(n||i!==t);return t}function K(e,t,n,i,s,r,o){if(!e)return;!o&&r&&function(e,t,n,i){let s=e;do{0===s.z&&(s.z=se(s.x,s.y,t,n,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==e);s.prevZ.nextZ=null,s.prevZ=null,function(e){let t,n,i,s,r,o,a,l,c=1;do{for(n=e,e=null,r=null,o=0;n;){for(o++,i=n,a=0,t=0;t0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(s=n,n=n.nextZ,a--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:e=s,s.prevZ=r,r=s;n=i}r.nextZ=null,c*=2}while(o>1)}(s)}(e,i,s,r);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,r?X(e,i,s,r):Y(e))t.push(a.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),ge(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?K(e=J(q(e),t,n),t,n,i,s,r,2):2===o&&ee(e,t,n,i,s,r):K(q(e),t,n,i,s,r,1);break}}function Y(e){const t=e.prev,n=e,i=e.next;if(le(t,n,i)>=0)return!1;const s=t.x,r=n.x,o=i.x,a=t.y,l=n.y,c=i.y,h=sr?s>o?s:o:r>o?r:o,p=a>l?a>c?a:c:l>c?l:c;let f=i.next;for(;f!==t;){if(f.x>=h&&f.x<=u&&f.y>=d&&f.y<=p&&oe(s,a,r,l,o,c,f.x,f.y)&&le(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function X(e,t,n,i){const s=e.prev,r=e,o=e.next;if(le(s,r,o)>=0)return!1;const a=s.x,l=r.x,c=o.x,h=s.y,d=r.y,u=o.y,p=al?a>c?a:c:l>c?l:c,g=h>d?h>u?h:u:d>u?d:u,A=se(p,f,t,n,i),v=se(m,g,t,n,i);let y=e.prevZ,b=e.nextZ;for(;y&&y.z>=A&&b&&b.z<=v;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==s&&y!==o&&oe(a,h,l,d,c,u,y.x,y.y)&&le(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==s&&b!==o&&oe(a,h,l,d,c,u,b.x,b.y)&&le(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;y&&y.z>=A;){if(y.x>=p&&y.x<=m&&y.y>=f&&y.y<=g&&y!==s&&y!==o&&oe(a,h,l,d,c,u,y.x,y.y)&&le(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==s&&b!==o&&oe(a,h,l,d,c,u,b.x,b.y)&&le(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function J(e,t,n){let i=e;do{const s=i.prev,r=i.next.next;!ce(s,r)&&he(s,i,i.next,r)&&pe(s,r)&&pe(r,s)&&(t.push(s.i/n|0),t.push(i.i/n|0),t.push(r.i/n|0),ge(i),ge(i.next),i=e=r),i=i.next}while(i!==e);return q(i)}function ee(e,t,n,i,s,r){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&ae(o,e)){let a=fe(o,e);return o=q(o,o.next),a=q(a,a.next),K(o,t,n,i,s,r,0),void K(a,t,n,i,s,r,0)}e=e.next}o=o.next}while(o!==e)}function te(e,t){return e.x-t.x}function ne(e,t){const n=function(e,t){let n,i=t,s=-1/0;const r=e.x,o=e.y;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){const e=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=r&&e>s&&(s=e,n=i.x=i.x&&i.x>=l&&r!==i.x&&oe(on.x||i.x===n.x&&ie(n,i)))&&(n=i,d=h)),i=i.next}while(i!==a);return n}(e,t);if(!n)return t;const i=fe(n,e);return q(i,i.next),q(n,n.next)}function ie(e,t){return le(e.prev,e,t.prev)<0&&le(t.next,e,e.next)<0}function se(e,t,n,i,s){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function re(e){let t=e,n=e;do{(t.x=(e-o)*(r-a)&&(e-o)*(i-a)>=(n-o)*(t-a)&&(n-o)*(r-a)>=(s-o)*(i-a)}function ae(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&he(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(pe(e,t)&&pe(t,e)&&function(e,t){let n=e,i=!1;const s=(e.x+t.x)/2,r=(e.y+t.y)/2;do{n.y>r!=n.next.y>r&&n.next.y!==n.y&&s<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(le(e.prev,e,t.prev)||le(e,t.prev,t))||ce(e,t)&&le(e.prev,e,e.next)>0&&le(t.prev,t,t.next)>0)}function le(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ce(e,t){return e.x===t.x&&e.y===t.y}function he(e,t,n,i){const s=ue(le(e,t,n)),r=ue(le(e,t,i)),o=ue(le(n,i,e)),a=ue(le(n,i,t));return s!==r&&o!==a||(!(0!==s||!de(e,n,t))||(!(0!==r||!de(e,i,t))||(!(0!==o||!de(n,e,i))||!(0!==a||!de(n,t,i)))))}function de(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function ue(e){return e>0?1:e<0?-1:0}function pe(e,t){return le(e.prev,e,e.next)<0?le(e,t,e.next)>=0&&le(e,e.prev,t)>=0:le(e,t,e.prev)<0||le(e,e.next,t)<0}function fe(e,t){const n=new Ae(e.i,e.x,e.y),i=new Ae(t.i,t.x,t.y),s=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=s,s.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function me(e,t,n,i){const s=new Ae(e,t,n);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function ge(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Ae(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class ve{static area(e){const t=e.length;let n=0;for(let i=t-1,s=0;s2&&e[t-1].equals(e[0])&&e.pop()}function be(e,t){for(let n=0;n{const e=navigator.userAgent||navigator.vendor||self.opera;let t=!1;return(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t})(),Ce=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!self.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,Se=Boolean(window.webkit&&window.webkit.messageHandlers),Me=(()=>{if(Ce){if(Se)return Boolean(/CriOS\/|EdgiOS\/|FxiOS\/|GSA\/|DuckDuckGo\//.test(navigator.userAgent));{const e=document.createElement("a");return Boolean(e.relList&&e.relList.supports&&e.relList.supports("ar"))}}return!1})(),Ie=(/\bCrOS\b/.test(navigator.userAgent),/android/i.test(navigator.userAgent));var Te=n(26629),Pe=n(79815),Be=n(1594),Re=n(37117),De=n(3388),Le=n(63872),Ne=n(77656),ke=n(63960),Oe=n(93113);class Ue extends ke.F{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Oe.I(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class Fe extends Ne.O{constructor(e,t,n){super(),this.shadowMaterial=new Ue,this.boundingBox=new u.Z,this.size=new h.P,this.isAnimated=!1,this.needsUpdate=!1,this.intensity=0,this.castShadow=!0,this.frustumCulled=!1,this.floor=new y.K(new b._,this.shadowMaterial),this.floor.rotateX(-Math.PI/2),this.floor.receiveShadow=!0,this.floor.castShadow=!1,this.floor.frustumCulled=!1,this.add(this.floor),this.shadow.camera.up.set(0,0,1),t.add(this),this.target=t,this.setModel(e,n)}setModel(e,t){this.boundingBox.copy(e.outs.boundingBox.value),e.outs.boundingBox.value.getSize(this.size);const{boundingBox:n,size:i}=this;if(this.isAnimated){const e=2*Math.max(i.x,i.y,i.z);i.y=e,n.expandByVector(i.subScalar(e).multiplyScalar(-.5)),n.max.y=n.min.y+e,i.set(e,e,e)}const s=.001*i.y;this.position.y=n.max.y+s,n.getCenter(this.floor.position),this.setSoftness(t)}setSoftness(e){const t=Math.pow(2,9-3*e);this.setMapSize(t)}setMapSize(e){const{camera:t,mapSize:n,map:i}=this.shadow,{size:s,boundingBox:r}=this;null!=i&&(i.dispose(),this.shadow.map=null),this.isAnimated&&(e*=2);const o=Math.floor(s.x>s.z?e:e*s.x/s.z),a=Math.floor(s.x>s.z?e*s.z/s.x:e);n.set(o,a);const l=2.5*s.x/o,c=2.5*s.z/a;t.left=-r.max.x-l,t.right=-r.min.x+l,t.bottom=r.min.z-c,t.top=r.max.z+c,this.setScaleAndOffset(t.zoom,0),this.shadow.updateMatrices(this),this.floor.scale.set(s.x+2*l,s.z+2*c,1),this.needsUpdate=!0}setIntensity(e){this.shadowMaterial.opacity=e,e>0?(this.visible=!0,this.floor.visible=!0):(this.visible=!1,this.floor.visible=!1)}getIntensity(){return this.shadowMaterial.opacity}setRotation(e){this.shadow.camera.up.set(Math.sin(e),0,Math.cos(e)),this.shadow.updateMatrices(this)}setScaleAndOffset(e,t){const n=this.size.y,i=1/e,s=.001*n;this.floor.position.y=2*s-n+t*i;const{camera:r}=this.shadow;r.zoom=e,r.near=0,r.far=n*e-t,r.projectionMatrix.makeOrthographic(r.left*e,r.right*e,r.top*e,r.bottom*e,r.near,r.far),r.projectionMatrixInverse.copy(r.projectionMatrix).invert(),this.shadow.updateMatrices(this)}updateMatrices(){this.shadow.updateMatrices(this)}dispose(){const{floor:e,shadowMaterial:t}=this;e.geometry.dispose(),t.dispose(),this.floor=null,this.shadowMaterial=null}}var Ve=n(53414),Qe=n(60206),ze=n(11359),Ge=n(84678);const je=new c.y,He=new h.P,$e=new d.F,We=new h.P,Ze=new u.Z,qe=new p._;class Ke extends s.ZP{constructor(){super(...arguments),this._shadowRoot=null,this._arCodeImage=null,this.ins=this.addInputs(Ke.ins),this.outs=this.addOutputs(Ke.outs),this.arLink=document.createElement("a"),this.raycaster=new g,this.initialHitTestSource=null,this.inputSource=null,this.transientHitTestSource=null,this.refSpace=null,this.frame=null,this.vScene=null,this.camera=null,this.cameraParent=null,this.cachedView=null,this.cachedQuality=null,this.cachedNearPlane=0,this.cachedFarPlane=0,this.xrCamera=null,this.hitPlane=null,this.selectionRing=null,this.session=null,this.setup=null,this.originalUnits=null,this.isTranslating=!1,this.isRotating=!1,this.isScaling=!1,this.lastDragValueX=0,this.lastDragValueY=0,this.totalDrag=0,this.lastScale=0,this.lastHitPosition=new h.P,this.lastFrameTime=0,this.targetOpacity=0,this.modelFloorOffset=0,this.optimalCameraDistance=0,this.shadow=null,this.lightTransform=null,this.lightsToReset=[],this.featuresToReset=[],this.annotationsAtLaunch=!1,this.scaleDisplay=null,this.updateScale=!1,this.placementRotation=new p._,this.onSessionEnded=()=>{this.outs.isPresenting.setValue(!1);const e=this.renderer.views[0].renderer;this.resetScene(),e.shadowMap.autoUpdate=!0;const t=this.initialHitTestSource;null!=t&&(t.cancel(),this.initialHitTestSource=null);const n=this.transientHitTestSource;null!=n&&(n.cancel(),this.transientHitTestSource=null),this.refSpace=null,this.frame=null,this.inputSource=null,this.xrCamera=null,this.cachedView=null,this.vScene=null,this.cachedView=null,this.camera=null;const i=this.session;i&&(i.removeEventListener("end",this.onSessionEnded),i.removeEventListener("selectstart",this.onSelectStart),i.removeEventListener("selectend",this.onSelectEnd),this.session=null),this.setup.reader.ins.enabled.off("value",this.endSession,this),e.setAnimationLoop(null),e.xr.enabled=!1,this.outs.isPlaced.setValue(!1),this.setup.navigation.ins.enabled.setValue(!0),this.renderer.views[0].render()},this.render=(e,t)=>{this.frame=t;const n=this.renderer.views[0].renderer,{camera:i,xrCamera:s,refSpace:r,initialHitTestSource:o,vScene:a,sceneNode:l,shadow:c,lastFrameTime:h}=this;if(!t||!t.getViewerPose(r))return;if(!s&&this.session){const e=n.xr.getCamera();return void(this.xrCamera=e.cameras[0])}if(s&&(n.xr.updateCamera(i),i.updateMatrixWorld(!0),i.projectionMatrix.fromArray(s.projectionMatrix.elements),i.projectionMatrixInverse.copy(s.projectionMatrix).invert()),null!=o&&s){const e=a.scene,{position:t}=e,n=2*l.outs.boundingRadius.value+s.near;s.projectionMatrixInverse.copy(s.projectionMatrix).invert();const r=i.getWorldDirection(He);e.rotation.y=Math.atan2(-r.x,-r.z),t.copy(i.position).add(r.multiplyScalar(n)),this.shadow.setRotation(e.rotation.y),e.updateMatrix(),e.updateMatrixWorld()}if(this.setInitialPosition(t),this.handleInput(t),this.outs.isPlaced.value){const t=e-h;this.updateOpacity(t,this.targetOpacity),this.lastFrameTime=e}const d=n.getContext();if(d.depthMask(!1),d.clear(d.DEPTH_BUFFER_BIT),d.depthMask(!0),c.needsUpdate&&(n.shadowMap.needsUpdate=!0,c.needsUpdate=!1),this.updateScale){const e=a.scene,t=this.scaleDisplay;He.copy(e.position);const n=this.renderer.views[0].viewports[0].width,i=this.renderer.views[0].viewports[0].height,r=n/2,o=i/2,l=n-t.clientWidth,c=i-t.clientHeight;He.project(s),He.x=Math.min(Math.max(He.x*r+r,0),l),He.y=Math.min(Math.max(-He.y*o+o,0),c),t.style.left=He.x.toString()+"px",t.style.top=He.y.toString()+"px",t.innerText=Math.round(100*e.scale.x).toString()+"%"}n.render(a.scene,i)},this.onSelectStart=e=>{const t=this.vScene.scene,n=this.transientHitTestSource;if(null==n)return;this.targetOpacity=.5;const i=this.frame.getHitTestResultsForTransientInput(n);if(1===i.length){this.inputSource=e.inputSource;const{axes:t}=this.inputSource.gamepad,n=this.raycaster;$e.set(t[0],-t[1]),n.setFromCamera($e,this.xrCamera);const i=n.intersectObject(this.hitPlane);i.length>0?(this.isTranslating=!0,this.lastHitPosition.copy(i[0].point)):!1===this.ins.wallMount.value&&(this.isRotating=!0),this.lastDragValueX=t[0],this.lastDragValueY=t[1]}else 2===i.length&&(this.isScaling=!0,this.lastScale=this.getFingerSeparation(i)/t.scale.x)},this.onSelectEnd=()=>{this.targetOpacity=0,this.totalDrag=0,this.isTranslating=!1,this.isRotating=!1,this.isScaling=!1,this.scaleDisplay.classList.remove("sv-show"),this.inputSource=null}}get renderer(){return this.getMainComponent(r.Z)}get pulse(){return this.getMainComponent(a.Z)}get sceneNode(){return this.getSystemComponent(Te.Z)}get analytics(){return this.system.getMainComponent(ze.Z)}get assetManager(){return this.getMainComponent(Le.Z)}get shadowRoot(){return this._shadowRoot}set shadowRoot(e){this._shadowRoot=e}get arCodeImage(){const e=document.documentURI;if(null==this._arCodeImage&&e.includes(".si.edu")&&e.includes("3d-api")){const t=e.split("/").pop().split(":").pop();36==t.length&&(this._arCodeImage="https://3d-api.si.edu/voyager/"+t+"/qrcode")}return this._arCodeImage}create(){super.create(),this.system.components.on(Ge.Z,this.onMetaComponent,this)}dispose(){this.system.components.off(Ge.Z,this.onMetaComponent,this),super.dispose()}update(){const{ins:e,outs:t}=this;if(e.enabled.changed){let n=e.enabled.value;n&&(we?(this.launchWebXR(),this.analytics.sendProperty("AR_Enabled","WebXR")):Ie?(this.launchSceneViewer(),this.analytics.sendProperty("AR_Enabled","SceneViewer")):Ce&&Me?(this.launchQuickLook(),this.analytics.sendProperty("AR_Enabled","QuickLook")):(n=!1,this.analytics.sendProperty("AR_Enabled","Unavailable"),l.ZP.show("AR unavailable on this platform.","warning"))),t.enabled.setValue(n)}return!0}launchWebXR(){var e,t,n;const i=null===(e=this.renderer)||void 0===e?void 0:e.views[0].renderer,s=this.vScene=null===(t=this.renderer)||void 0===t?void 0:t.activeSceneComponent,r=this.camera=null==s?void 0:s.activeCamera;this.cameraParent=r.parent;if(!(this.setup=this.getSystemComponent(Pe.Z)))return!1;const o=null===(n=this.sceneNode)||void 0===n?void 0:n.getGraphComponents(De.Z);let a=null;for(const e of o)if(a=e.derivatives.get(Re._U.Web3D,Re.$l.AR),null!=a)break;a&&(this.setup.navigation.setChanged(!0),this.cachedQuality=o[0].ins.quality.value,o.forEach((e=>{e.ins.quality.setValue(Re.$l.AR)})),i.setAnimationLoop(((e,t)=>this.render(e,t))),navigator.xr.requestSession("immersive-ar",{requiredFeatures:["hit-test"],optionalFeatures:["dom-overlay"],domOverlay:{root:this.shadowRoot.querySelector("ff-viewport-overlay")}}).then((e=>this.onSessionStarted(i,e))).catch((e=>{console.log("Error starting session: "+e),l.ZP.show("AR available but blocked. Please check your browser settings.","warning")})))}async onSessionStarted(e,t){const n=this.renderer.views[0].renderer.getContext();await n.makeXRCompatible(),t.updateRenderState({baseLayer:new XRWebGLLayer(t,n,{alpha:!0})}),this.setupScene(),e.shadowMap.autoUpdate=!1,e.xr.enabled=!0,e.xr.setReferenceSpaceType("local"),e.xr.setSession(t),await t.addEventListener("end",this.onSessionEnded),this.refSpace=await t.requestReferenceSpace("local");const i=await t.requestReferenceSpace("viewer");e.xr.cameraAutoUpdate=!1;const s=20*Math.PI/180,r=!0===this.ins.wallMount.value?void 0:new XRRay(new DOMPoint(0,0,0),{x:0,y:-Math.sin(s),z:-Math.cos(s)});t.requestHitTestSource({space:i,offsetRay:r}).then((e=>{this.initialHitTestSource=e})),this.outs.isPresenting.setValue(!0),this.session=t,this.lastFrameTime=performance.now(),this.setup.reader.ins.enabled.on("value",this.endSession,this)}endSession(){this.session&&this.session.end()}setupScene(){const{cameraParent:e,setup:t,featuresToReset:n}=this,i=this.sceneNode;e&&e.remove(this.camera),this.setup.background.hide(),this.setup.navigation.ins.enabled.setValue(!1);const s=i.graph.findNodeByName("Lights");(this.lightTransform=s.getComponent(o.ZP,!0)).ins.rotation.reset();const r=this.scaleDisplay=document.createElement("div");r.classList.add("sv-scale-annotation"),this.shadowRoot.querySelector("ff-viewport-overlay").appendChild(r),n.push(t.floor.ins.visible.value?1:0),n.push(t.grid.ins.visible.value?1:0),n.push(t.tape.ins.visible.value?1:0),n.push(t.slicer.ins.enabled.value?1:0),n.push(t.viewer.ins.shader.value),this.annotationsAtLaunch=t.viewer.ins.annotationsVisible.value,t.floor.ins.visible.setValue(!1),t.grid.ins.visible.setValue(!1),t.tape.ins.visible.setValue(!1),t.slicer.ins.enabled.setValue(!1),t.viewer.ins.shader.value!==Qe.pH.Default&&t.viewer.ins.shader.setValue(Qe.pH.Default),t.viewer.ins.annotationsVisible.setValue(!1);(this.originalUnits=i.ins.units.getValidatedValue())!=Be.f_.m&&this.sceneNode.ins.units.setValue(Be.f_.m);i.getGraphComponents(Ve.Z).forEach((e=>{e.ins.shadowEnabled.value&&(e.ins.shadowEnabled.setValue(!1),this.lightsToReset.push(e))})),this.pulse.pulse(Date.now()),i.update(null);(this.shadow=new Fe(this.sceneNode,this.vScene.scene,.5)).setIntensity(0),Ze.copy(this.sceneNode.outs.boundingBox.value),Ze.getSize(He),this.cachedNearPlane=this.camera.near,this.cachedFarPlane=this.camera.far,this.vScene.activeCameraComponent.ins.near.setValue(.01),this.vScene.activeCameraComponent.ins.far.setValue(1e3)}resetScene(){const{camera:e,cameraParent:t,setup:n,featuresToReset:i}=this,s=this.vScene.scene;t&&t.add(e),e.position.set(0,0,0),e.rotation.set(0,0,0),this.vScene.activeCameraComponent.ins.near.setValue(this.cachedNearPlane),this.vScene.activeCameraComponent.ins.far.setValue(this.cachedFarPlane),e.updateMatrix(),this.lightTransform.object3D.rotation.set(0,0,0),this.lightTransform.object3D.updateMatrix(),this.sceneNode.ins.units.setValue(this.originalUnits),s.position.setScalar(0),s.rotation.y=0,s.scale.setScalar(1),s.updateMatrix(),s.updateMatrixWorld(!0),i.reverse(),n.floor.ins.visible.setValue(!!i.pop()),n.grid.ins.visible.setValue(!!i.pop()),n.tape.ins.visible.setValue(!!i.pop()),n.slicer.ins.enabled.setValue(!!i.pop());const r=i.pop();r!==Qe.pH.Default&&n.viewer.ins.shader.setValue(r),this.lightsToReset.forEach((e=>{e.ins.shadowEnabled.setValue(!0)})),this.lightsToReset.length=0,n.background.show();this.sceneNode.getGraphComponents(De.Z).forEach((e=>{e.ins.quality.setValue(this.cachedQuality)}));const o=this.selectionRing;null!=o&&(s.remove(o),o.geometry.dispose(),o.material.dispose(),this.selectionRing=null);const a=this.hitPlane;null!=a&&(s.remove(a),a.geometry.dispose(),a.material.dispose(),this.hitPlane=null),this.scaleDisplay.remove();const l=this.shadow;null!=l&&(s.remove(l),l.dispose(),this.shadow=null),e.aspect=window.innerWidth/window.innerHeight,e.updateProjectionMatrix()}setInitialPosition(e){const t=this.initialHitTestSource;if(null==t)return;const n=e.getHitTestResults(t);if(0==n.length)return;const i=n[0],s=this.getHitPoint(i);if(null==s)return;this.placeModel(s),t.cancel(),this.initialHitTestSource=null;const{session:r}=e;r.addEventListener("selectstart",this.onSelectStart),r.addEventListener("selectend",this.onSelectEnd),r.requestHitTestSourceForTransientInput({profile:"generic-touchscreen"}).then((e=>{this.transientHitTestSource=e}))}getHitPoint(e){const t=e.getPose(this.refSpace);if(null==t)return null;const n=je.fromArray(t.transform.matrix),i=n.elements[5]>.75;if(!0===this.ins.wallMount.value&&!i){const e=this.vScene.scene;e.rotation.y=Math.atan2(n.elements[4],n.elements[6]),e.updateMatrix()}return i!==this.ins.wallMount.value?We.setFromMatrixPosition(n):null}handleInput(e){const t=this.transientHitTestSource;if(null==t)return;if(!this.isTranslating&&!this.isScaling&&!this.isRotating)return;const n=e.getHitTestResultsForTransientInput(t),i=this.vScene.scene,s=i.scale.x;if(this.isScaling)if(n.length<2)this.isScaling=!1,this.scaleDisplay.classList.remove("sv-show"),this.scaleDisplay.addEventListener("transitionend",(()=>{this.updateScale=!1}),{once:!0});else{let e=this.getFingerSeparation(n)/this.lastScale;e=e>.9&&e<1.1?1:e,this.scaleScene(i,e),this.scaleDisplay.classList.add("sv-show"),this.updateScale=!0}else{if(2===n.length)return this.isTranslating=!1,this.isRotating=!1,this.isScaling=!0,void(this.lastScale=this.getFingerSeparation(n)/s);if(this.isRotating){const e=this.inputSource.gamepad.axes[0];i.rotation.y+=1.5*(e-this.lastDragValueX),i.updateMatrix(),this.sceneRotateHelper(),this.lastDragValueX=e}else if(this.isTranslating){const e=this.inputSource.gamepad.axes,t=e[0]-this.lastDragValueX,s=e[1]-this.lastDragValueY;this.totalDrag+=Math.hypot(t,s),n.forEach((e=>{if(this.totalDrag<.01||e.inputSource!==this.inputSource||e.results.length<1)return;const t=this.getHitPoint(e.results[0]);null!=t&&(He.copy(t),He.sub(this.lastHitPosition),i.position.add(He),i.updateMatrix(),i.updateMatrixWorld(),this.lastHitPosition.copy(t),this.updateBoundingBox())})),this.shadow.updateMatrices()}}}getFingerSeparation(e){const t=e[0].inputSource.gamepad.axes,n=e[1].inputSource.gamepad.axes,i=n[0]-t[0],s=n[1]-t[1];return Math.sqrt(i*i+s*s)}placeModel(e){const t=this.vScene.scene,n=!0===this.ins.wallMount.value,{min:i,max:s}=Ze,r=this.sceneNode.outs.boundingRadius.value,o=Math.max(1.25*(s.x-i.x),.15),a=n?Math.max(1.25*(s.y-i.y),.15):Math.max(1.25*(s.z-i.z),.15),l=(i.x+s.x)/2,c=(i.z+s.z)/2,d=(i.y+s.y)/2,u=n?0:-Math.PI/2;this.lastHitPosition.copy(e);const p=this.hitPlane=new y.K(new b._(o,a),new _.v);p.position.set(l,n?d:i.y,n?i.z:c),p.rotation.set(u,0,0),p.visible=!1,t.add(p),this.placementRotation.copy(t.quaternion);const m=new j,g=new j,A=o>a?.025*o:.025*a;this.roundedRect(m,-o/2,-a/2,o,a,.5*A),this.roundedRect(g,-o/2+A,-a/2+A,o-2*A,a-2*A,.4*A),m.holes.push(g);let v=new _e(m);const x=this.selectionRing=new y.K(v,new _.v({side:xe.ehD,opacity:0}));x.position.set(l,n?d:i.y,n?i.z:c),x.rotation.set(u,0,0),x.material.transparent=!0,x.visible=!1,t.add(x),this.modelFloorOffset=i.y,t.position.set(e.x,n?e.y:e.y-i.y,e.z),t.updateMatrix(),t.updateMatrixWorld(!0),this.updateBoundingBox(),this.pulse.pulse(Date.now()),this.shadow.updateMatrices(),this.shadow.setIntensity(!0===this.ins.wallMount.value?0:.3),this.setup.viewer.ins.annotationsVisible.setValue(this.annotationsAtLaunch),1===this.ins.arScale.value||n||this.renderer.views[0].renderer.render(t,this.shadow.shadow.camera),this.scaleScene(this.vScene.scene,this.ins.arScale.value);const w=this.camera.position.clone(),E=e.clone().sub(w);if(E.length(){this.scaleDisplay.classList.remove("sv-show"),this.scaleDisplay.addEventListener("transitionend",(()=>{this.updateScale=!1}),{once:!0})}),1500))}launchSceneViewer(){const e=this.sceneNode.getGraphComponents(De.Z),t=e.findIndex((e=>null!==e.derivatives.get(Re._U.App3D,Re.$l.AR))),n=t>-1?e[t].derivatives.get(Re._U.App3D,Re.$l.AR):null;if(n){const e=this.arLink,t=n.findAsset(Re.hH.Model),i=`intent://arvr.google.com/scene-viewer/1.0?file=${this.assetManager.getAssetUrl(t.data.uri)}&mode=ar_only#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;end;`;e.setAttribute("href",i),e.click()}}launchQuickLook(){const e=this.sceneNode.getGraphComponents(De.Z),t=e.findIndex((e=>null!==e.derivatives.get(Re._U.iOSApp3D,Re.$l.AR))),n=t>-1?e[t].derivatives.get(Re._U.iOSApp3D,Re.$l.AR):null;if(n){const e=this.arLink,t=n.findAsset(Re.hH.Model),i=this.assetManager.getAssetUrl(t.data.uri);e.setAttribute("rel","ar");const s=document.createElement("img");e.appendChild(s),e.setAttribute("href",i.toString()),e.click(),e.removeChild(s)}}updateBoundingBox(){this.sceneNode.ins.sceneTransformed.set()}updateOpacity(e,t){const n=this.selectionRing.material,i=n.opacity;if(t===i)return;const s=t-i;n.opacity=s>0?Math.min(i+.002*e,t):Math.max(i-.002*e,t),this.selectionRing.visible=n.opacity>0}roundedRect(e,t,n,i,s,r){e.moveTo(t,n+r),e.lineTo(t,n+s-r),e.quadraticCurveTo(t,n+s,t+r,n+s),e.lineTo(t+i-r,n+s),e.quadraticCurveTo(t+i,n+s,t+i,n+s-r),e.lineTo(t+i,n+r),e.quadraticCurveTo(t+i,n,t+i-r,n),e.lineTo(t+r,n),e.quadraticCurveTo(t,n,t,n+r)}sceneRotateHelper(){const e=this.vScene.scene;qe.copy(e.quaternion),qe.invert(),qe.multiply(this.placementRotation),this.lightTransform.object3D.rotation.setFromQuaternion(qe),this.lightTransform.object3D.updateMatrix(),this.shadow.setRotation(e.rotation.y)}scaleScene(e,t){e.scale.setScalar(t),!1===this.ins.wallMount.value&&(e.position.y=this.lastHitPosition.y-this.modelFloorOffset*e.scale.y),e.updateMatrix(),e.updateMatrixWorld(),this.shadow.setScaleAndOffset(t,0),this.updateBoundingBox()}onMetaComponent(e){const t=e.object;e.add&&t.once("load",(()=>{const e=t.images.dictionary;Object.keys(e).forEach((t=>{const n=e[t];n.usage&&"ARCode"===n.usage&&(this._arCodeImage=this.assetManager.getAssetUrl(n.uri))}))}))}}Ke.typeName="CVARManager",Ke.text="ARManager",Ke.icon="",Ke.isSystemSingleton=!0,Ke.ins={enabled:s.V5.Boolean("State.Enabled"),wallMount:s.V5.Boolean("AR.wallMount",!1),arScale:s.V5.Number("AR.Scale",1)},Ke.outs={enabled:s.V5.Boolean("State.Enabled"),available:s.V5.Boolean("State.Available",Ee),isPlaced:s.V5.Boolean("AR.Placed",!1),isPresenting:s.V5.Boolean("AR.Presenting",!1)}},11359:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(80038);class s extends i.ZP{constructor(){super(...arguments),this._title="Untitled",this._timerStart=0}startTimer(){0===this._timerStart&&(this._timerStart=Date.now())}resetTimer(){this._timerStart=0}getTimerTime(){return this._timerStart>0?Date.now()-this._timerStart:0}setTitle(e){this._title=e}sendProperty(e,t){if("function"==typeof gtag){const n=void 0!==t?t.toString():"undefined";gtag("event",e.toLowerCase(),{scene_title:this._title,event_value:n})}}}s.typeName="CVAnalytics",s.text="Analytics",s.icon="",s.isSystemSingleton=!0},51462:(e,t,n)=>{"use strict";n.d(t,{Z:()=>_});var i=n(80038),s=n(28110),r=n(2837),o=n(15271),a=n(3388),l=n(84678),c=n(5249),h=n(15577),d=n(44466),u=n(41029),p=(n(91013),n(13301),n(10160),n(30242)),f=n(93072),m=n(1594),g=n(96180),A=n(17467),v=n(63872),y=n(74572),b=n(26220);class _ extends r.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(_.ins),this._activeAnnotation=null,this._annotations={},this._viewports=new Set,this._sprites={},this._truncateLock=!1,this._activeView=!1,this._hasNewActiveTags=!1,this.addEvents("active-annotation","group"),this.onSpriteClick=this.onSpriteClick.bind(this),this.onSpriteLink=this.onSpriteLink.bind(this),this.on("pointer-up",this.onPointerUp,this),this.system.on("pointer-up",this.onSystemPointerUp,this),this.arManager.outs.isPresenting.on("value",this.handleARStateChange,this),this.language.outs.language.on("value",this.updateLanguage,this),this.object3D=new s.Z}get model(){return this.getComponent(a.Z)}get meta(){return this.getComponent(l.Z,!0)}get reader(){return this.getGraphComponent(c.ZP,!0)}get language(){return this.getGraphComponent(f.Z,!0)}get audio(){return this.getGraphComponent(A.Z,!0)}get snapshots(){return this.getGraphComponent(y.Z,!0)}get articles(){const e=this.meta;return e?e.articles:null}get arManager(){return this.system.getMainComponent(p.Z)}get assetManager(){return this.system.getMainComponent(v.Z)}get renderer(){return this.getMainComponent(o.Z)}get assetReader(){return this.getMainComponent(g.Z)}get activeAnnotation(){return this._activeAnnotation}set activeAnnotation(e){if(e!==this._activeAnnotation){const t=this._activeAnnotation;t&&(t.set("expanded",!1),this.updateSprite(t)),this._activeAnnotation=e,e&&(e.set("expanded",!0),this.updateSprite(e),this._activeView&&(this._truncateLock=!0,this._activeView=!1));const n=this.ins;n.marker.setValue(e?e.data.marker:"",!0),n.title.setValue(e?e.title:"",!0),n.lead.setValue(e?e.lead:"",!0),n.tags.setValue(e?e.tags.join(", "):"",!0),n.style.setOption(e?e.data.style:u.Z.defaultTypeName,!0),n.scale.setValue(e?100*e.data.scale*(0,h.Z)(this.model.ins.localUnits.getValidatedValue(),m.f_.m):1,!0),n.offset.setValue(e?100*e.data.offset*(0,h.Z)(this.model.ins.localUnits.getValidatedValue(),m.f_.m):0,!0),n.tilt.setValue(e?e.data.tilt:0,!0),n.azimuth.setValue(e?e.data.azimuth:0,!0),n.color.setValue(e?e.data.color.slice():[1,1,1],!0);const i=this.reader.articles;if(i.length){const t=i.map((e=>e.article.title));t.unshift("(none)"),n.article.setOptions(t);const s=e?i.find((t=>t.article.id===e.data.articleId)):null;n.article.setValue(s?i.indexOf(s)+1:0,!0)}else n.article.setOptions(["(none)"]),n.article.setValue(0);n.audioId.setValue(e?e.data.audioId:null,!0),n.image.setValue(e?e.data.imageUri:"",!0),n.imageCredit.setValue(e?e.imageCredit:"",!0),n.imageAltText.setValue(e?e.imageAltText:"",!0),this.emit({type:"annotation-update",annotation:e})}}get hasAnnotations(){return Object.keys(this._annotations).length>0}setActiveAnnotationById(e){this.activeAnnotation=this._annotations[e]}update(e){super.update(e);const t=this.ins,n=this.object3D,i=this.activeAnnotation;if(t.unitScale.changed&&(n.scale.setScalar(t.unitScale.value),n.updateMatrix()),t.activeTags.changed){const e=t.activeTags.value.split(",").map((e=>e.trim())).filter((e=>e));for(const t in this._annotations){const n=this._annotations[t],i=n.tags;let s=0===i.length;e.forEach((e=>{i.indexOf(e)>=0&&(s=!0,this._hasNewActiveTags=!0)})),n.set("visible",s),this.updateSprite(n)}}if(t.visible.changed&&n.setVisible(t.visible.value),i){if(t.marker.changed&&i.set("marker",t.marker.value),t.title.changed&&(i.title=t.title.value),t.lead.changed&&(i.lead=t.lead.value),t.tags.changed&&(i.tags=t.tags.value.split(",").map((e=>e.trim())).filter((e=>e)),this.emit({type:"tag-update"})),t.style.changed&&(i.set("style",t.style.getOptionText()),this.createSprite(i)),t.scale.changed&&i.set("scale",t.scale.value*(0,h.Z)(m.f_.m,this.model.ins.localUnits.getValidatedValue())*.01),t.offset.changed&&i.set("offset",t.offset.value*(0,h.Z)(m.f_.m,this.model.ins.localUnits.getValidatedValue())*.01),t.tilt.changed&&i.set("tilt",t.tilt.value),t.azimuth.changed&&i.set("azimuth",t.azimuth.value),t.color.changed&&i.set("color",t.color.value.slice()),t.image.changed&&i.set("imageUri",t.image.value),t.imageCredit.changed&&(i.imageCredit=t.imageCredit.value),t.imageAltText.changed&&(i.imageAltText=t.imageAltText.value),t.article.changed){const e=this.reader.articles,n=e&&e[t.article.getValidatedValue()-1];i.set("articleId",n?n.article.id:"")}t.audioId.changed&&i.set("audioId",t.audioId.value),this.updateSprite(i),this.emit({type:"annotation-update",annotation:i})}return!0}tock(){if(this.updated)return!0}postRender(e){const t=e.viewport;this._viewports.has(t)||(t.on("dispose",this.onViewportDispose,this),this._viewports.add(t));if(this.object3D.render(t.overlay,e.camera),this._truncateLock){const e=this.activeAnnotation.data,t=this._sprites[e.id];this.snapshots.outs.tweening.value&&(t.isAnimating=!0,this.snapshots.outs.tweening.once("value",(()=>{t.isAnimating=!1}),this)),this._truncateLock=!1}this._hasNewActiveTags&&(this.emit({type:"active-tag-update"}),this._hasNewActiveTags=!1)}dispose(){this.object3D.dispose(),this.off("pointer-up",this.onPointerUp,this),this.system.off("pointer-up",this.onSystemPointerUp,this),this.arManager.outs.isPresenting.off("value",this.handleARStateChange,this),this.language.outs.language.off("value",this.updateLanguage,this),this._viewports.forEach((e=>e.off("dispose",this.onViewportDispose,this))),this._viewports.clear(),super.dispose()}getAnnotations(){return Object.keys(this._annotations).map((e=>this._annotations[e]))}addAnnotation(e){this._annotations[e.id]=e,this.createSprite(e),Object.keys(e.data.titles).forEach((e=>{this.language.addLanguage(m.PD[e])})),Object.keys(e.data.leads).forEach((e=>{this.language.addLanguage(m.PD[e])})),this.changed=!0}removeAnnotation(e){const t=Object.keys(this._annotations);if(delete this._annotations[e.id],this.removeSprite(e),e===this.activeAnnotation){const n=Math.min(t.indexOf(e.id)+1,t.length-1);this.activeAnnotation=n<0?null:this._annotations[t[n]],e.tags.length>0&&this.emit({type:"tag-update"})}this.changed=!0}updateAnnotation(e,t){t&&this.updateSprite(e),this.changed=!0}toJSON(){const e=super.toJSON(),t=this.toData();return t&&(e.data=t),e}fromJSON(e){e.data&&this.fromData(e.data)}toData(){const e=Object.keys(this._annotations);return 0===e.length?null:e.map((e=>this._annotations[e].toJSON()))}fromData(e){const t=this.language.outs.language.value;e.forEach((e=>{let n=new d.Z(e);n.language=t,this.addAnnotation(n)})),this.emit({type:"tag-update"})}handleARStateChange(){for(const e in this._annotations){const t=this._annotations[e];this._sprites[t.id].isAdaptive=!this.arManager.outs.isPresenting.value}}onPointerUp(e){if(e.isDragging)return;let t=e.object3D;for(;t&&!t.isHTMLSprite;)t=t.parent;const n=t&&t.annotation;n&&(this.emit({type:"click",sprite:t,annotation:n}),e.stopPropagation=!0)}onSystemPointerUp(e){e.isDragging||this.emit({type:"click",sprite:null,annotation:null})}onViewportDispose(e){this.object3D.disposeHTMLElements(e.viewport.overlay)}onSpriteClick(e){this.emit(e);const t=e.annotation;if(t&&t.data.viewId.length&&!this.arManager.outs.isPresenting.value){this.normalizeViewOrbit(t.data.viewId);const e=this.snapshots.getTargetProperties().findIndex((e=>"ActiveId"==e.name));if(e>=0){this.snapshots.getState(t.data.viewId).values[e]=t.data.id}const n=this.getMainComponent(b.Z);this.snapshots.tweenTo(t.data.viewId,n.context.secondsElapsed),this._activeView=!0}}onSpriteLink(e){this.reader&&(this.reader.ins.articleId.setValue(e.annotation.data.articleId),this.reader.ins.enabled.setValue(!0),this.reader.ins.focus.setValue(!0))}createSprite(e){this.removeSprite(e);const t=u.Z.createInstance(e);t.addEventListener("click",this.onSpriteClick),t.addEventListener("link",this.onSpriteLink),t.assetManager=this.assetManager,t.audioManager=this.audio,this._sprites[e.id]=t,this.object3D.add(t),this.registerPickableObject3D(t,!0)}removeSprite(e){const t=this._sprites[e.id];t&&(t.removeEventListener("click",this.onSpriteClick),t.removeEventListener("link",this.onSpriteLink),t.dispose(),this._sprites[e.id]=void 0,this.object3D.remove(t),this.unregisterPickableObject3D(t,!0))}updateSprite(e){const t=this._sprites[e.id];t&&t.update()}updateLanguage(){if(!this.getComponent(a.Z,!0))return;const e=this.ins,t=this._activeAnnotation,n=this.language;this.getAnnotations().forEach((e=>{e.language=n.outs.language.value})),e.activeTags.set();for(const e in this._annotations){const t=this._annotations[e],n=this._sprites[t.id];n&&n.update()}e.title.setValue(t?t.title:"",!0),e.lead.setValue(t?t.lead:"",!0),e.tags.setValue(t?t.tags.join(", "):""),e.imageCredit.setValue(t?t.imageCredit:"",!0),e.imageAltText.setValue(t?t.imageAltText:"",!0);const i=this.reader.articles.map((e=>e.article.title));i.unshift("(none)"),e.article.setOptions(i)}normalizeViewOrbit(e){const t=this.snapshots.getTargetProperties().findIndex((e=>"Orbit"==e.name)),n=this.snapshots.getState(e),i=this.snapshots.getCurrentValues()[t];let s=0;i.forEach(((e,i)=>{const r=Math.round((e-n.values[t][i])/360);n.values[t][i]+=360*r,s+=Math.abs(e-n.values[t][i])})),n.duration=s>.01?1:0}}_.typeName="CVAnnotationView",_.ins={unitScale:i.V5.Number("Transform.UnitScale",{preset:1,precision:5}),activeTags:i.V5.String("Tags.Active"),title:i.V5.String("Annotation.Title"),lead:i.V5.String("Annotation.Lead"),marker:i.V5.String("Annotation.Marker"),tags:i.V5.String("Annotation.Tags"),style:i.V5.Option("Annotation.Style",u.Z.typeNames),scale:i.V5.Scale("Annotation.Scale",{preset:1,precision:3}),offset:i.V5.Number("Annotation.Offset",{preset:0,precision:3}),article:i.V5.Option("Annotation.Article",[]),image:i.V5.String("Annotation.Image"),imageCredit:i.V5.String("Image.Credit"),imageAltText:i.V5.String("Image.AltText"),audioId:i.V5.String("Annotation.AudioID"),tilt:i.V5.Number("Annotation.Tilt"),azimuth:i.V5.Number("Annotation.Azimuth"),color:i.V5.ColorRGB("Annotation.Color")}},63872:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(58754),s=n(80038);class r extends s.ZP{constructor(){super(...arguments),this.ins=this.addInputs(r.ins),this.outs=this.addOutputs(r.outs),this._loadingManager=new o(this),this._baseUrl=window.location.href,this._initialLoad=!1}get loadingManager(){return this._loadingManager}get baseUrl(){return this._baseUrl}set baseUrl(e){this._baseUrl=new URL(e,window.location.href).href}get initialLoad(){return this._initialLoad}set initialLoad(e){this._initialLoad=e}getAssetName(e){return e.split("/").pop()}getAssetUrl(e){const t=new URL(e,this._baseUrl).href;return this.loadingManager.resolveURL(t)}getAssetPath(e){const t=this._baseUrl,n=e.indexOf(t);return n>=0?e.substr(n+t.length):e}getAssetBasePath(e){const t=this.getAssetPath(e).split("/");t.pop();const n=t.join("/");return n?n+"/":n}getRelativeAssetPath(e,t){const n=this.getAssetUrl(e),i=this.getAssetUrl(t),s=n.indexOf(i);return s>=0?n.substr(s+i.length):this.getAssetPath(n)}create(){super.create()}update(){const{ins:e,outs:t}=this;if(e.busy.changed){const n=e.busy.value||this._loadingManager.isBusy;t.busy.setValue(n),n||t.completed.set()}return!0}}r.typeName="CVAssetManager",r.text="AssetManager",r.icon="",r.isSystemSingleton=!0,r.ins={busy:s.V5.Boolean("State.Busy"),baseUrlValid:s.V5.Boolean("Settings.BaseURLValid")},r.outs={busy:s.V5.Boolean("State.Busy"),completed:s.V5.Event("State.Completed")};class o extends i.l{constructor(e){super(),this._manager=e,this._isBusy=!1,this.onStart=this.onLoadingStart.bind(this),this.onProgress=this.onLoadingProgress.bind(this),this.onLoad=this.onLoadingCompleted.bind(this),this.onError=this.onLoadingError.bind(this)}get isBusy(){return this._isBusy}onLoadingStart(){this._isBusy=!0,this._manager.ins.busy.set()}onLoadingProgress(e,t,n){0}onLoadingCompleted(){this._isBusy=!1,this._manager.ins.busy.set()}onLoadingError(){this._isBusy=!1,this._manager.ins.busy.set()}}},96180:(e,t,n)=>{"use strict";n.d(t,{x:()=>Xn,Z:()=>Jn});var i=n(80038);class s{constructor(e){this._loadingManager=e}async getJSON(e){return this._loadingManager.itemStart(e),fetch(e,{headers:{Accept:"application/json"}}).then((t=>{if(!t.ok)throw this._loadingManager.itemError(e),this._loadingManager.itemEnd(e),new Error(`failed to fetch from '${e}', status: ${t.status} ${t.statusText}`);return this._loadingManager.itemEnd(e),t.json()}))}async getText(e){return fetch(e,{headers:{Accept:e.endsWith(".html")?"text/html":"text/plain, *"}}).then((t=>{if(!t.ok)throw new Error(`failed to fetch from '${e}', status: ${t.status} ${t.statusText}`);return t.text()}))}}var r=n(40693),o=n(6965),a=n(93113),l=n(71050);class c extends o.W{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new r.F(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return l.uZ(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new a.I(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new a.I(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new a.I(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}var h=n(75544),d=n(8173),u=n(17393),p=n(19588),f=n(84538),m=n(60206);const g=n(8669).Z,A=n(9849).Z;class v extends c{constructor(e){super(),this._clayColor=new a.I("#a67a6c").convertLinearToSRGB(),this._wireColor=new a.I("#004966").convertLinearToSRGB(),this._wireEmissiveColor=new a.I("#004966").convertLinearToSRGB(),this._objectSpaceNormalMap=!1,this._paramCopy={},this._sideCopy=h.Wl3,this.type="UberPBRAdvMaterial",this.isUberPBRMaterial=!0,this.isMeshStandardMaterial=!0,this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:!0,PHYSICAL:!0,OBJECTSPACE_NORMALMAP:!1,MODE_NORMALS:!1,MODE_XRAY:!1,CUT_PLANE:!1,USE_ZONEMAP:!1},this.uniforms=d.rD.merge([u.V.physical.uniforms,{aoMapMix:{value:new p.P(.25,.25,.25)},cutPlaneDirection:{value:new f.L(0,0,-1,0)},cutPlaneColor:{value:new p.P(1,0,0)},zoneMap:{value:null}}]),this._aoMapMix=this.uniforms.aoMapMix.value,this._cutPlaneDirection=this.uniforms.cutPlaneDirection.value,this._cutPlaneColor=this.uniforms.cutPlaneColor.value,this._zoneMap=this.uniforms.zoneMap.value,this.vertexShader=A,this.fragmentShader=g,this.color=new a.I(16777215),this.roughness=.7,this.metalness=0,e&&this.setValues(e)}set cutPlaneDirection(e){this._cutPlaneDirection.copy(e)}get cutPlaneDirection(){return this._cutPlaneDirection}set cutPlaneColor(e){this._cutPlaneColor.copy(e)}get cutPlaneColor(){return this._cutPlaneColor}set aoMapMix(e){this._aoMapMix.copy(e)}get aoMapMix(){return this._aoMapMix}set zoneMap(e){this._zoneMap=e,this.uniforms.zoneMap.value=e,this.needsUpdate=!0}get zoneMap(){return this._zoneMap}setShaderMode(e){switch(Object.assign(this,this._paramCopy),this.defines.MODE_NORMALS=!1,this.defines.MODE_XRAY=!1,this.defines.OBJECTSPACE_NORMALMAP=!(!this.normalMap||!this._objectSpaceNormalMap),this.side=this.defines.CUT_PLANE?h.ehD:this.side,this.needsUpdate=!0,e){case m.pH.Clay:this._paramCopy={color:this.color,map:this.map,roughness:this.roughness,metalness:this.metalness,aoMapIntensity:this.aoMapIntensity,blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite,envMap:this.envMap,transmission:this.transmission},this.color=this._clayColor,this.map=null,this.envMap=null,this.transmission=0,this.roughness=1,this.metalness=0,this.aoMapIntensity*=1,this.blending=h.jFi,this.transparent=!1,this.depthWrite=!0;break;case m.pH.Normals:this._paramCopy={blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite},this.defines.MODE_NORMALS=!0,this.blending=h.jFi,this.transparent=!1,this.depthWrite=!0;break;case m.pH.XRay:this._paramCopy={side:this.side,blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite},this.defines.MODE_XRAY=!0,this.side=h.ehD,this.blending=h.WMw,this.transparent=!0,this.depthWrite=!1;break;case m.pH.Wireframe:this._paramCopy={color:this.color,emissive:this.emissive,roughness:this.roughness,metalness:this.metalness,wireframe:this.wireframe,map:this.map,aoMap:this.aoMap,emissiveMap:this.emissiveMap,normalMap:this.normalMap},this.color=this._wireColor,this.emissive=this._wireEmissiveColor,this.roughness=.8,this.metalness=.1,this.wireframe=!0,this.map=null,this.aoMap=null,this.emissiveMap=null,this.normalMap=null,this.defines.OBJECTSPACE_NORMALMAP=!1}}enableCutPlane(e){this.defines.CUT_PLANE=e,e?(this._sideCopy=this.side,this.side=h.ehD):this.side=this._sideCopy}enableObjectSpaceNormalMap(e){e!==this._objectSpaceNormalMap&&(this._objectSpaceNormalMap=e),this.normalMap&&(this.normalMapType=h.PA7,this.needsUpdate=!0)}enableZoneMap(e){this.defines.USE_ZONEMAP=e}}var y=n(58754);class b{constructor(e){this.manager=void 0!==e?e:y.t,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(i,s){n.load(e,i,t,s)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}b.DEFAULT_MATERIAL_NAME="__DEFAULT";const _={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},x={};class w extends Error{constructor(e,t){super(e),this.response=t}}class E extends b{constructor(e){super(e)}load(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const s=_.get(e);if(void 0!==s)return this.manager.itemStart(e),setTimeout((()=>{t&&t(s),this.manager.itemEnd(e)}),0),s;if(void 0!==x[e])return void x[e].push({onLoad:t,onProgress:n,onError:i});x[e]=[],x[e].push({onLoad:t,onProgress:n,onError:i});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(r).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const n=x[e],i=t.body.getReader(),s=t.headers.get("Content-Length")||t.headers.get("X-File-Size"),r=s?parseInt(s):0,o=0!==r;let a=0;const l=new ReadableStream({start(e){!function t(){i.read().then((({done:i,value:s})=>{if(i)e.close();else{a+=s.byteLength;const i=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:r});for(let e=0,t=n.length;e{switch(a){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,o)));case"json":return e.json();default:if(void 0===o)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,i=new TextDecoder(n);return e.arrayBuffer().then((e=>i.decode(e)))}}})).then((t=>{_.add(e,t);const n=x[e];delete x[e];for(let e=0,i=n.length;e{const n=x[e];if(void 0===n)throw this.manager.itemError(e),t;delete x[e];for(let e=0,i=n.length;e{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}var C=n(75809),S=n(35322);const M=new WeakMap;class I extends b{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,n,i){const s=new E(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(e=>{this.parse(e,t,i)}),n,i)}parse(e,t,n){this.decodeDracoFile(e,t,null,null,h.KI_).catch(n)}decodeDracoFile(e,t,n,i,s=h.GUF){const r={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:s};return this.decodeGeometry(e,r).then(t)}decodeGeometry(e,t){const n=JSON.stringify(t);if(M.has(e)){const t=M.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const s=this.workerNextTaskID++,r=e.byteLength,o=this._getWorker(s,r).then((n=>(i=n,new Promise(((n,r)=>{i._callbacks[s]={resolve:n,reject:r},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return o.catch((()=>!0)).then((()=>{i&&s&&this._releaseTask(i,s)})),M.set(e,{key:n,promise:o}),o}_createGeometry(e){const t=new C.u;e.index&&t.setIndex(new S.Tl(e.index.array,1));for(let n=0;n{n.load(e,t,void 0,i)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,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((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const i=T.toString(),s=["/* draco decoder */",n,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([s]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.lengtht._taskLoad?-1:1}));const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n}))}_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{const t=e.draco,o=new t.Decoder;try{const e=function(e,t,i,s){const r=s.attributeIDs,o=s.attributeTypes;let a,l;const c=t.GetEncodedGeometryType(i);if(c===e.TRIANGULAR_MESH)a=new e.Mesh,l=t.DecodeArrayToMesh(i,i.byteLength,a);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,l=t.DecodeArrayToPointCloud(i,i.byteLength,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const i in r){const l=self[o[i]];let c,d;if(s.useUniqueIDs)d=r[i],c=t.GetAttributeByUniqueId(a,d);else{if(d=t.GetAttributeId(a,e[r[i]]),-1===d)continue;c=t.GetAttribute(a,d)}const u=n(e,t,a,i,l,c);"color"===i&&(u.vertexColorSpace=s.vertexColorSpace),h.attributes.push(u)}c===e.TRIANGULAR_MESH&&(h.index=function(e,t,n){const i=3*n.num_faces(),s=4*i,r=e._malloc(s);t.GetTrianglesUInt32Array(n,s,r);const o=new Uint32Array(e.HEAPF32.buffer,r,i).slice();return e._free(r),{array:o,itemSize:1}}(e,t,a));return e.destroy(a),h}(t,o,new Int8Array(i),r),a=e.attributes.map((e=>e.array.buffer));e.index&&a.push(e.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:e},a)}catch(e){console.error(e),self.postMessage({type:"error",id:s.id,error:e.message})}finally{t.destroy(o)}}))}}}var P=function(){var e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var n,i=WebAssembly.validate(e)?"b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;t9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;h8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgohAaoclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;uzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:EPliuo97eue978Jjjjjbca9Rhidndnadcl9hmbdnaec98GglTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaiaeciGgvcdtgdVcbczad9R;8kbaiabalcdtfglad;8qbbdnavTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkalaiad;8qbbskdnaec98GgxTmbcbhvabhdinadczfglalpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgvax6mbkkaxae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabaxcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbhdabheinaeaepbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbaeczfheadclfgdav6mbkkdnaval9pmbaialciGgdcdtgeVcbc;abae9R;8kbaiabavcdtfgvae;8qbbdnadTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiae;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb":"b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:P8Yqdbk;3sezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfgocl4cifcd4hxdndndndnaoc9WGgmTmbcbhPcehsawcjdfhzalhHinaraH9Rax6midnaraHaxfgl9RcK6mbczhoinawcj;cbfaogifgoc9WfhOdndndndndnaHaic9WfgAco4fRbbaAci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOalRblalRbbgAco4gCaCciSgCE86bbaocGfalclfaCfgORbbaAcl4ciGgCaCciSgCE86bbaocVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbaoc7faOaCfgORbbaAciGgAaAciSgAE86bbaoctfaOaAfgARbbalRbegOco4gCaCciSgCE86bbaoc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc93faAaCfgARbbaOciGgOaOciSgOE86bbaoc94faAaOfgARbbalRbdgOco4gCaCciSgCE86bbaoc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbaoc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbaoc97faAaCfgARbbaOciGgOaOciSgOE86bbaoc98faAaOfgORbbalRbiglco4gAaAciSgAE86bbaoc99faOaAfgORbbalcl4ciGgAaAciSgAE86bbaoc9:faOaAfgORbbalcd4ciGgAaAciSgAE86bbaocufaOaAfgoRbbalciGglalciSglE86bbaoalfhlxdkaOalRbwalRbbgAcl4gCaCcsSgCE86bbaocGfalcwfaCfgORbbaAcsGgAaAcsSgAE86bbaocVfaOaAfgORbbalRbegAcl4gCaCcsSgCE86bbaoc7faOaCfgORbbaAcsGgAaAcsSgAE86bbaoctfaOaAfgORbbalRbdgAcl4gCaCcsSgCE86bbaoc91faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc4faOaAfgORbbalRbigAcl4gCaCcsSgCE86bbaoc93faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc94faOaAfgORbbalRblgAcl4gCaCcsSgCE86bbaoc95faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc96faOaAfgORbbalRbvgAcl4gCaCcsSgCE86bbaoc97faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc98faOaAfgORbbalRbogAcl4gCaCcsSgCE86bbaoc99faOaCfgORbbaAcsGgAaAcsSgAE86bbaoc9:faOaAfgORbbalRbrglcl4gAaAcsSgAE86bbaocufaOaAfgoRbbalcsGglalcsSglE86bbaoalfhlxekaOal8Pbb83bbaOcwfalcwf8Pbb83bbalczfhlkdnaiam9pmbaiczfhoaral9RcL0mekkaiam6mialTmidnakTmbawaPfRbbhOcbhoazhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkkazcefhzaPcefgPad6hsalhHaPad9hmexvkkcbhlasceGmdxikalaxad2fhCdnakTmbcbhHcehsawcjdfhminaral9Rax6mialTmdalaxfhlawaHfRbbhOcbhoamhiinaiawcj;cbfaofRbbgAce4cbaAceG9R7aOfgO86bbaiadfhiaocefgoak9hmbkamcefhmaHcefgHad6hsaHad9hmbkaChlxikcbhocehsinaral9Rax6mdalTmealaxfhlaocefgoad6hsadao9hmbkaChlxdkcbhlasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqalmbkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;yzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhDcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgrc;Ve0mbavc;abfalarcl4cu7fcsGcitfgPydlhsaPydbhzdnarcsGgPak9pmbavaiarcu7fcsGcdtfydbaxaPEhraPThPdndnadcd9hmbabaDcetfgHaz87ebaHcdfas87ebaHclfar87ebxekabaDcdtfgHazBdbaHclfasBdbaHcwfarBdbkaxaPfhxavc;abfalcitfgHarBdbaHasBdlavaicdtfarBdbavc;abfalcefcsGglcitfgHazBdbaHarBdlaiaPfhialcefhlxdkdndnaPcsSmbamaPfaPc987fcefhmxekaocefhrao8SbbgPcFeGhHdndnaPcu9mmbarhoxekaocvfhoaHcFbGhHcrhPdninar8SbbgOcFbGaPtaHVhHaOcu9kmearcefhraPcrfgPc8J9hmbxdkkarcefhokaHce4cbaHceG9R7amfhmkdndnadcd9hmbabaDcetfgraz87ebarcdfas87ebarclfam87ebxekabaDcdtfgrazBdbarclfasBdbarcwfamBdbkavc;abfalcitfgramBdbarasBdlavaicdtfamBdbavc;abfalcefcsGglcitfgrazBdbaramBdlaicefhialcefhlxekdnarcpe0mbaxcefgOavaiaqarcsGfRbbgPcl49RcsGcdtfydbaPcz6gHEhravaiaP9RcsGcdtfydbaOaHfgsaPcsGgOEhPaOThOdndnadcd9hmbabaDcetfgzax87ebazcdfar87ebazclfaP87ebxekabaDcdtfgzaxBdbazclfarBdbazcwfaPBdbkavaicdtfaxBdbavc;abfalcitfgzarBdbazaxBdlavaicefgicsGcdtfarBdbavc;abfalcefcsGcitfgzaPBdbazarBdlavaiaHfcsGgicdtfaPBdbavc;abfalcdfcsGglcitfgraxBdbaraPBdlalcefhlaiaOfhiasaOfhxxekaxcbaoRbbgzEgAarc;:eSgrfhsazcsGhCazcl4hXdndnazcs0mbascefhOxekashOavaiaX9RcsGcdtfydbhskdndnaCmbaOcefhxxekaOhxavaiaz9RcsGcdtfydbhOkdndnarTmbaocefhrxekaocdfhrao8SbegHcFeGhPdnaHcu9kmbaocofhAaPcFbGhPcrhodninar8SbbgHcFbGaotaPVhPaHcu9kmearcefhraocrfgoc8J9hmbkaAhrxekarcefhrkaPce4cbaPceG9R7amfgmhAkdndnaXcsSmbarhPxekarcefhPar8SbbgocFeGhHdnaocu9kmbarcvfhsaHcFbGhHcrhodninaP8SbbgrcFbGaotaHVhHarcu9kmeaPcefhPaocrfgoc8J9hmbkashPxekaPcefhPkaHce4cbaHceG9R7amfgmhskdndnaCcsSmbaPhoxekaPcefhoaP8SbbgrcFeGhHdnarcu9kmbaPcvfhOaHcFbGhHcrhrdninao8SbbgPcFbGartaHVhHaPcu9kmeaocefhoarcrfgrc8J9hmbkaOhoxekaocefhokaHce4cbaHceG9R7amfgmhOkdndnadcd9hmbabaDcetfgraA87ebarcdfas87ebarclfaO87ebxekabaDcdtfgraABdbarclfasBdbarcwfaOBdbkavc;abfalcitfgrasBdbaraABdlavaicdtfaABdbavc;abfalcefcsGcitfgraOBdbarasBdlavaicefgicsGcdtfasBdbavc;abfalcdfcsGcitfgraABdbaraOBdlavaiazcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiaDcifgDae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:llevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaicd4cbaice4ceG9R7avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2geTmbinababydbgdcwtcw91:Yadce91cjjj;8ifcjjj98G::NUdbabclfhbaecufgembkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfhiaeczfheadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",s=WebAssembly.instantiate(r(i),{}).then((function(e){(n=e.instance).exports.__wasm_call_ctors()}));function r(e){for(var n=new Uint8Array(e.length),i=0;i96?s-97:s>64?s-39:s+4}var r=0;for(i=0;i0?function(e,t,n,i,s){for(var r=c[0],o=1;o=s)break e;{const o=t[1];e=s)break t}r=n,n=0}}for(;n>>1;e0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;es.far)return;r.push({distance:l,distanceToRay:Math.sqrt(a),point:n,index:t,face:null,object:o})}}var Ne=n(29187),ke=n(67440),Oe=n(62257);class Ue extends K.T{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Fe extends ee.x{constructor(e=null,t=1,n=1,i,s,r,o,a,l=h.TyD,c=h.TyD,d,u){super(null,r,o,a,l,c,i,s,d,u),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Ve=new k.y,Qe=new k.y;class ze{constructor(e=[],t=[]){this.uuid=l.DO(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;et;)--r;if(++r,0!==s||r!==i){s>=r&&(r=Math.max(r,1),s=r-1);const e=this.getValueSize();this.times=n.slice(s,r),this.values=this.values.slice(s*e,r*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;0===s&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let r=null;for(let t=0;t!==s;t++){const i=n[t];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,i),e=!1;break}if(null!==r&&r>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,i,r),e=!1;break}r=i}if(void 0!==i&&je(i))for(let t=0,n=i.length;t!==n;++t){const n=i[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===h.pIN,s=e.length-1;let r=1;for(let o=1;o0){e[r]=e[s];for(let e=s*n,i=r*n,o=0;o!==n;++o)t[i+o]=t[e+o];++r}return r!==e.length?(this.times=e.slice(0,r),this.values=t.slice(0,r*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}Ye.prototype.TimeBufferType=Float32Array,Ye.prototype.ValueBufferType=Float32Array,Ye.prototype.DefaultInterpolation=h.NMF;class Xe extends Ye{}Xe.prototype.ValueTypeName="bool",Xe.prototype.ValueBufferType=Array,Xe.prototype.DefaultInterpolation=h.Syv,Xe.prototype.InterpolantFactoryMethodLinear=void 0,Xe.prototype.InterpolantFactoryMethodSmooth=void 0;class Je extends Ye{}Je.prototype.ValueTypeName="color";class et extends Ye{}et.prototype.ValueTypeName="number";class tt extends Y{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,r=this.sampleValues,o=this.valueSize,a=(n-t)/(i-t);let l=e*o;for(let e=l+o;l!==e;l+=4)O._.slerpFlat(s,0,r,l-o,r,l,a);return s}}class nt extends Ye{InterpolantFactoryMethodLinear(e){return new tt(this.times,this.values,this.getValueSize(),e)}}nt.prototype.ValueTypeName="quaternion",nt.prototype.DefaultInterpolation=h.NMF,nt.prototype.InterpolantFactoryMethodSmooth=void 0;class it extends Ye{}it.prototype.ValueTypeName="string",it.prototype.ValueBufferType=Array,it.prototype.DefaultInterpolation=h.Syv,it.prototype.InterpolantFactoryMethodLinear=void 0,it.prototype.InterpolantFactoryMethodSmooth=void 0;class st extends Ye{}st.prototype.ValueTypeName="vector";class rt{constructor(e,t=-1,n,i=h.IFH){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=l.DO(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let e=0,s=n.length;e!==s;++e)t.push(ot(n[e]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,i=n.length;e!==i;++e)t.push(Ye.toJSON(n[e]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,r=[];for(let e=0;e1){const e=r[1];let t=i[e];t||(i[e]=t=[]),t.push(n)}}const r=[];for(const e in i)r.push(this.CreateFromMorphTargetSequence(e,i[e],t,n));return r}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,i,s){if(0!==n.length){const r=[],o=[];We(n,r,o,i),0!==r.length&&s.push(new e(t,r,o))}},i=[],s=e.name||"default",r=e.fps||30,o=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e=2.0 are supported.")));const l=new nn(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(r),l.setPlugins(o),l.parse(n,i)}parseAsync(e,t){const n=this;return new Promise((function(i,s){n.parse(e,t,i,s)}))}}function ht(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const dt={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_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_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 ut{constructor(e){this.parser=e,this.name=dt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,r)}}class Et{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const r=s.extensions[t],o=i.images[r.source];let a=n.textureLoader;if(o.uri){const e=n.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(s){if(s)return n.loadTextureImage(e,r.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.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(1===t.height)}}))),this.isSupported}}class Ct{constructor(e){this.parser=e,this.name=dt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const r=s.extensions[t],o=i.images[r.source];let a=n.textureLoader;if(o.uri){const e=n.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(s){if(s)return n.loadTextureImage(e,r.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.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(1===t.height)}}))),this.isSupported}}class St{constructor(e){this.name=dt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],i=this.parser.getDependency("buffer",e.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.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 i.then((function(t){const n=e.byteOffset||0,i=e.byteLength||0,r=e.count,o=e.byteStride,a=new Uint8Array(t,n,i);return s.decodeGltfBufferAsync?s.decodeGltfBufferAsync(r,o,a,e.mode,e.filter).then((function(e){return e.buffer})):s.ready.then((function(){const t=new ArrayBuffer(r*o);return s.decodeGltfBuffer(new Uint8Array(t),r,o,a,e.mode,e.filter),t}))}))}return null}}class Mt{constructor(e){this.name=dt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||void 0===n.mesh)return null;const i=t.meshes[n.mesh];for(const e of i.primitives)if(e.mode!==Ut.TRIANGLES&&e.mode!==Ut.TRIANGLE_STRIP&&e.mode!==Ut.TRIANGLE_FAN&&void 0!==e.mode)return null;const s=n.extensions[this.name].attributes,r=[],o={};for(const e in s)r.push(this.parser.getDependency("accessor",s[e]).then((t=>(o[e]=t,o[e]))));return r.length<1?null:(r.push(this.parser.createNodeMesh(e)),Promise.all(r).then((e=>{const t=e.pop(),n=t.isGroup?t.children:[t],i=e[0].count,s=[];for(const e of n){const t=new k.y,n=new p.P,r=new O._,a=new p.P(1,1,1),l=new q(e.geometry,e.material,i);for(let e=0;e-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||n||i&&s<98?this.textureLoader=new te(this.options.manager):this.textureLoader=new ne(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new E(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const r={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:n,userData:{}};return qt(s,r,i),Kt(r,i),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(r)}))).then((function(){e(r)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,i=t.length;n{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[n,i]of e.children.entries())s(i,t.children[n])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n=2&&p.setY(t,h[e*r+1]),r>=3&&p.setZ(t,h[e*r+2]),r>=4&&p.setW(t,h[e*r+3]),r>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(e){const t=this.json,n=this.options,i=t.textures[e].source,s=t.images[i];let r=this.textureLoader;if(s.uri){const e=n.manager.getHandler(s.uri);null!==e&&(r=e)}return this.loadTextureImage(e,i,r)}loadTextureImage(e,t,n){const i=this,s=this.json,r=s.textures[e],o=s.images[t],a=(o.uri||o.bufferView)+":"+r.sampler;if(this.textureCache[a])return this.textureCache[a];const l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,t.name=r.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);const n=(s.samplers||{})[r.sampler]||{};return t.magFilter=Vt[n.magFilter]||h.wem,t.minFilter=Vt[n.minFilter]||h.D1R,t.wrapS=Qt[n.wrapS]||h.rpg,t.wrapT=Qt[n.wrapT]||h.rpg,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[a]=l,l}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const r=i.images[e],o=self.URL||self.webkitURL;let a=r.uri||"",l=!1;if(void 0!==r.bufferView)a=n.getDependency("bufferView",r.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:r.mimeType});return a=o.createObjectURL(t),a}));else if(void 0===r.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(e){return new Promise((function(n,i){let r=n;!0===t.isImageBitmapLoader&&(r=function(e){const t=new ee.x(e);t.needsUpdate=!0,n(t)}),t.load(B.resolveURL(e,s.path),r,void 0,i)}))})).then((function(e){var t;return!0===l&&o.revokeObjectURL(a),e.userData.mimeType=r.mimeType||((t=r.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e}));return this.sourceCache[e]=c,c}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then((function(r){if(!r)return null;if(void 0!==n.texCoord&&n.texCoord>0&&((r=r.clone()).channel=n.texCoord),s.extensions[dt.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[dt.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=s.associations.get(r);r=s.extensions[dt.KHR_TEXTURE_TRANSFORM].extendTexture(r,e),s.associations.set(r,t)}}return void 0!==i&&(r.colorSpace=i),e[t]=r,r}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=void 0===t.attributes.tangent,s=void 0!==t.attributes.color,r=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new oe,re.F.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new ae.n,re.F.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(i||s||r){let e="ClonedMaterial:"+n.uuid+":";i&&(e+="derivative-tangents:"),s&&(e+="vertex-colors:"),r&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),s&&(t.vertexColors=!0),r&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return o.W}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const l={},c=[];if((s.extensions||{})[dt.KHR_MATERIALS_UNLIT]){const e=i[dt.KHR_MATERIALS_UNLIT];o=e.getMaterialType(),c.push(e.extendParams(l,s,t))}else{const n=s.pbrMetallicRoughness||{};if(l.color=new a.I(1,1,1),l.opacity=1,Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;l.color.setRGB(e[0],e[1],e[2],h.GUF),l.opacity=e[3]}void 0!==n.baseColorTexture&&c.push(t.assignTexture(l,"map",n.baseColorTexture,h.KI_)),l.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,l.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(c.push(t.assignTexture(l,"metalnessMap",n.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",n.metallicRoughnessTexture))),o=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),c.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,l)}))))}!0===s.doubleSided&&(l.side=h.ehD);const d=s.alphaMode||$t;if(d===Zt?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,d===Wt&&(l.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&o!==N.v&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new r.F(1,1),void 0!==s.normalTexture.scale)){const e=s.normalTexture.scale;l.normalScale.set(e,e)}if(void 0!==s.occlusionTexture&&o!==N.v&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(l.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&o!==N.v){const e=s.emissiveFactor;l.emissive=(new a.I).setRGB(e[0],e[1],e[2],h.GUF)}return void 0!==s.emissiveTexture&&o!==N.v&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture,h.KI_)),Promise.all(c).then((function(){const n=new o(l);return s.name&&(n.name=s.name),Kt(n,s),t.associations.set(n,{materials:e}),s.extensions&&qt(i,n,s),n}))}createUniqueName(e){const t=fe.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(e){return n[dt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return sn(n,e,t)}))}const r=[];for(let n=0,o=e.length;n0&&Yt(u,s),u.name=t.createUniqueName(s.name||"mesh_"+e),Kt(u,s),d.extensions&&qt(i,u,d),t.assignFinalMaterial(u),l.push(u)}for(let n=0,i=l.length;n1?new Ne.Z:1===t.length?t[0]:new K.T,o!==t[0])for(let e=0,n=t.length;e{const t=new Map;for(const[e,n]of i.associations)(e instanceof re.F||e instanceof ee.x)&&t.set(e,n);return e.traverse((e=>{const n=i.associations.get(e);null!=n&&t.set(e,n)})),t})(s),s}))}_createAnimationTracks(e,t,n,i,s){const r=[],o=e.name?e.name:e.uuid,a=[];let l;switch(jt[s.path]===jt.weights?e.traverse((function(e){e.morphTargetInfluences&&a.push(e.name?e.name:e.uuid)})):a.push(o),jt[s.path]){case jt.weights:l=et;break;case jt.rotation:l=nt;break;case jt.position:case jt.scale:l=st;break;default:if(1===n.itemSize)l=et;else l=st}const c=void 0!==i.interpolation?Ht[i.interpolation]:h.NMF,d=this._getArrayFromAccessor(n);for(let e=0,n=a.length;e{const i=this._getIdleWorker();-1!==i?(this._initWorker(i),this.workerStatus|=1<e.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}class hn{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class dn{constructor(e,t,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&ie.arrayBuffer())).then((e=>WebAssembly.instantiate(e,An))).then(this._init):WebAssembly.instantiate(Buffer.from(yn,"base64"),An).then(this._init),fn)}_init(e){mn=e.instance,An.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!mn)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=mn.exports.malloc(n);gn.set(e,i),t=t||Number(mn.exports.ZSTD_findDecompressedSize(i,n));const s=mn.exports.malloc(t),r=mn.exports.ZSTD_decompress(s,t,i,n),o=gn.slice(s,s+r);return mn.exports.free(i),mn.exports.free(s),o}}const yn="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",bn=new WeakMap;let _n,xn=0;class wn extends b{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new cn,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}detectSupport(e){return!0===e.isWebGPURenderer?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:!1,etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:!1,pvrtcSupported:!1}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},e.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1)),this}init(){if(!this.transcoderPending){const e=new E(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new E(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const i=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then((([e,t])=>{const n=wn.BasisWorker.toString(),i=["/* constants */","let _EngineFormat = "+JSON.stringify(wn.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(wn.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(wn.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i])),this.transcoderBinary=t,this.workerPool.setWorkerCreator((()=>{const e=new Worker(this.workerSourceURL),t=this.transcoderBinary.slice(0);return e.postMessage({type:"init",config:this.workerConfig,transcoderBinary:t},[t]),e}))})),xn>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),xn++}return this.transcoderPending}load(e,t,n,i){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new E(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(e,(e=>{if(bn.has(e)){return bn.get(e).promise.then(t).catch(i)}this._createTexture(e).then((e=>t?t(e):null)).catch(i)}),n,i)}_createTextureFrom(e,t){const{faces:n,width:i,height:s,format:r,type:o,error:a,dfdFlags:l}=e;if("error"===o)return Promise.reject(a);let c;if(6===t.faceCount)c=new on(n,r,h.ywz);else{const e=n[0].mipmaps;c=t.layerCount>1?new an(e,i,s,t.layerCount,r,h.ywz):new rn(e,i,s,r,h.ywz)}return c.minFilter=1===n[0].mipmaps.length?h.wem:h.D1R,c.magFilter=h.wem,c.generateMipmaps=!1,c.needsUpdate=!0,c.colorSpace=Mn(t),c.premultiplyAlpha=!!(1&l),c}async _createTexture(e,t={}){const n=function(e){const t=new Uint8Array(e.buffer,e.byteOffset,un.length);if(t[0]!==un[0]||t[1]!==un[1]||t[2]!==un[2]||t[3]!==un[3]||t[4]!==un[4]||t[5]!==un[5]||t[6]!==un[6]||t[7]!==un[7]||t[8]!==un[8]||t[9]!==un[9]||t[10]!==un[10]||t[11]!==un[11])throw new Error("Missing KTX 2.0 identifier.");const n=new hn,i=17*Uint32Array.BYTES_PER_ELEMENT,s=new dn(e,un.length,i,!0);n.vkFormat=s._nextUint32(),n.typeSize=s._nextUint32(),n.pixelWidth=s._nextUint32(),n.pixelHeight=s._nextUint32(),n.pixelDepth=s._nextUint32(),n.layerCount=s._nextUint32(),n.faceCount=s._nextUint32();const r=s._nextUint32();n.supercompressionScheme=s._nextUint32();const o=s._nextUint32(),a=s._nextUint32(),l=s._nextUint32(),c=s._nextUint32(),h=s._nextUint64(),d=s._nextUint64(),u=new dn(e,un.length+i,3*r*8,!0);for(let t=0;t{const t=new vn;await t.init(),e(t)}))),n=await _n);const i=[];for(let s=0;s>s),o=Math.max(1,e.pixelHeight>>s),a=e.pixelDepth?Math.max(1,e.pixelDepth>>s):0,l=e.levels[s];let c,d;if(0===e.supercompressionScheme)c=l.levelData;else{if(2!==e.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");c=n.decode(l.levelData,l.uncompressedByteLength)}d=Sn[t]===h.VzW?new Float32Array(c.buffer,c.byteOffset,c.byteLength/Float32Array.BYTES_PER_ELEMENT):Sn[t]===h.cLu?new Uint16Array(c.buffer,c.byteOffset,c.byteLength/Uint16Array.BYTES_PER_ELEMENT):c,i.push({data:d,width:r,height:o,depth:a})}let s;if(En.has(Cn[t]))s=0===e.pixelDepth?new Fe(i[0].data,e.pixelWidth,e.pixelHeight):new ln.J(i[0].data,e.pixelWidth,e.pixelHeight,e.pixelDepth);else{if(e.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new rn(i,e.pixelWidth,e.pixelHeight)}return s.mipmaps=i,s.type=Sn[t],s.format=Cn[t],s.colorSpace=Mn(e),s.needsUpdate=!0,Promise.resolve(s)}(n);const i=t,s=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:i},[e]))).then((e=>this._createTextureFrom(e.data,n)));return bn.set(e,{promise:s}),s}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),xn--,this}}wn.BasisFormat={ETC1S:0,UASTC_4x4:1},wn.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},wn.EngineFormat={RGBAFormat:h.wk1,RGBA_ASTC_4x4_Format:h.ptH,RGBA_BPTC_Format:h.bsb,RGBA_ETC2_EAC_Format:h.ekQ,RGBA_PVRTC_4BPPV1_Format:h.eaV,RGBA_S3TC_DXT5_Format:h.ILR,RGB_ETC1_Format:h.fto,RGB_ETC2_Format:h.l0P,RGB_PVRTC_4BPPV1_Format:h._AM,RGB_S3TC_DXT1_Format:h.wuA},wn.BasisWorker=function(){let e,t,n;const i=_EngineFormat,s=_TranscoderFormat,r=_BasisFormat;self.addEventListener("message",(function(o){const d=o.data;switch(d.type){case"init":e=d.config,u=d.transcoderBinary,t=new Promise((e=>{n={wasmBinary:u,onRuntimeInitialized:e},BASIS(n)})).then((()=>{n.initializeBasis(),void 0===n.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":t.then((()=>{try{const{faces:t,buffers:o,width:u,height:p,hasAlpha:f,format:m,dfdFlags:g}=function(t){const o=new n.KTX2File(new Uint8Array(t));function d(){o.close(),o.delete()}if(!o.isValid())throw d(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const u=o.isUASTC()?r.UASTC_4x4:r.ETC1S,p=o.getWidth(),f=o.getHeight(),m=o.getLayers()||1,g=o.getLevels(),A=o.getFaces(),v=o.getHasAlpha(),y=o.getDFDFlags(),{transcoderFormat:b,engineFormat:_}=function(t,n,o,h){let d,u;const p=t===r.ETC1S?a:l;for(let i=0;i1?(s=a.origWidth,r=a.origHeight):(s=a.width,r=a.height);const l=new Uint8Array(o.getImageTranscodedSizeInBytes(n,t,0,b));if(!o.transcodeImage(l,n,t,e,b,0,-1,-1))throw d(),new Error("THREE.KTX2Loader: .transcodeImage failed.");i.push(l)}const a=h(i);t.push({data:a,width:s,height:r}),w.push(a.buffer)}x.push({mipmaps:t,width:p,height:f,format:_})}return d(),{faces:x,buffers:w,width:p,height:f,hasAlpha:v,format:_,dfdFlags:y}}(d.buffer);self.postMessage({type:"transcode",id:d.id,faces:t,width:u,height:p,hasAlpha:f,format:m,dfdFlags:g},o)}catch(e){console.error(e),self.postMessage({type:"error",id:d.id,error:e.message})}}))}var u}));const o=[{if:"astcSupported",basisFormat:[r.UASTC_4x4],transcoderFormat:[s.ASTC_4x4,s.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[s.BC7_M5,s.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[s.BC1,s.BC3],engineFormat:[i.RGB_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[s.ETC1,s.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[s.ETC1],engineFormat:[i.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[r.ETC1S,r.UASTC_4x4],transcoderFormat:[s.PVRTC1_4_RGB,s.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],a=o.sort((function(e,t){return e.priorityETC1S-t.priorityETC1S})),l=o.sort((function(e,t){return e.priorityUASTC-t.priorityUASTC}));function c(e){return e<=2||0==(e&e-1)&&0!==e}function h(e){if(1===e.length)return e[0];let t=0;for(let n=0;n{i.detectSupport(this.renderer.views[0].renderer)}),0)}set dracoPath(e){this.customDracoPath=e,null!==this.gltfLoader.dracoLoader&&this.gltfLoader.dracoLoader.setDecoderPath(this.customDracoPath)}setAssetPath(e){e=e.endsWith("/")?e.slice(0,-1):e,this.customDracoPath||(this.dracoPath=`${e}/js/draco/`),this.gltfLoader.ktx2Loader.setTranscoderPath(`${e}/js/basis/`)}dispose(){this.gltfLoader.dracoLoader.dispose(),this.gltfLoader.ktx2Loader.dispose(),this.gltfLoader.setDRACOLoader(null),this.gltfLoader.setKTX2Loader(null),this.gltfLoader=null}isValid(e){const t=e.split(".").pop().toLowerCase();return Tn.extensions.indexOf(t)>=0}isValidMimeType(e){return Tn.mimeTypes.indexOf(e)>=0}get(e){return new Promise(((t,n)=>{this.gltfLoader.load(e,(e=>{t(this.createModelGroup(e))}),null,(i=>{null===this.gltfLoader||null===this.gltfLoader.dracoLoader?t(null):(console.error(`failed to load '${e}': ${i}`),n(new Error(i)))}))}))}createModelGroup(e){const t=e.scene;return t.traverse((e=>{if("Mesh"===e.type){const t=e;t.castShadow=!0;const n=t.material;n.map&&(n.map.colorSpace=h.KI_),t.geometry.computeBoundingBox();const i="MeshPhysicalMaterial"===n.type?new v:new In.Z;n.flatShading&&(t.geometry.computeVertexNormals(),n.flatShading=!1,console.warn("Normals unavailable so they have been calculated. For best outcomes, please provide normals with geometry.")),"MeshPhysicalMaterial"!==n.type&&"MeshStandardMaterial"!==n.type||i.copy(n),n.userData.objectSpaceNormals&&i.enableObjectSpaceNormalMap(!0),t.material=i}})),t}}Tn.extensions=["gltf","glb"],Tn.mimeTypes=["model/gltf+json","model/gltf-binary"];var Pn=n(41654);const Bn=/^[og]\s*(.+)?/,Rn=/^mtllib /,Dn=/^usemtl /,Ln=/^usemap /,Nn=/\s+/,kn=new p.P,On=new p.P,Un=new p.P,Fn=new p.P,Vn=new p.P,Qn=new a.I;function zn(){const e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=e,void(this.object.fromDeclaration=!1!==t);const n=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){const n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);const i={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==n?n.smooth:this.smooth,groupStart:void 0!==n?n.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){const t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(i),i},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){const t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let e=this.materials.length-1;e>=0;e--)this.materials[e].groupCount<=0&&this.materials.splice(e,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},n&&n.name&&"function"==typeof n.clone){const e=n.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseNormalIndex:function(e,t){const n=parseInt(e,10);return 3*(n>=0?n-1:n+t/3)},parseUVIndex:function(e,t){const n=parseInt(e,10);return 2*(n>=0?n-1:n+t/2)},addVertex:function(e,t,n){const i=this.vertices,s=this.object.geometry.vertices;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[n+0],i[n+1],i[n+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){const i=this.normals,s=this.object.geometry.normals;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(e,t,n){const i=this.vertices,s=this.object.geometry.normals;kn.fromArray(i,e),On.fromArray(i,t),Un.fromArray(i,n),Vn.subVectors(Un,On),Fn.subVectors(kn,On),Vn.cross(Fn),Vn.normalize(),s.push(Vn.x,Vn.y,Vn.z),s.push(Vn.x,Vn.y,Vn.z),s.push(Vn.x,Vn.y,Vn.z)},addColor:function(e,t,n){const i=this.colors,s=this.object.geometry.colors;void 0!==i[e]&&s.push(i[e+0],i[e+1],i[e+2]),void 0!==i[t]&&s.push(i[t+0],i[t+1],i[t+2]),void 0!==i[n]&&s.push(i[n+0],i[n+1],i[n+2])},addUV:function(e,t,n){const i=this.uvs,s=this.object.geometry.uvs;s.push(i[e+0],i[e+1]),s.push(i[t+0],i[t+1]),s.push(i[n+0],i[n+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,i,s,r,o,a,l){const c=this.vertices.length;let h=this.parseVertexIndex(e,c),d=this.parseVertexIndex(t,c),u=this.parseVertexIndex(n,c);if(this.addVertex(h,d,u),this.addColor(h,d,u),void 0!==o&&""!==o){const e=this.normals.length;h=this.parseNormalIndex(o,e),d=this.parseNormalIndex(a,e),u=this.parseNormalIndex(l,e),this.addNormal(h,d,u)}else this.addFaceNormal(h,d,u);if(void 0!==i&&""!==i){const e=this.uvs.length;h=this.parseUVIndex(i,e),d=this.parseUVIndex(s,e),u=this.parseUVIndex(r,e),this.addUV(h,d,u),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,i=e.length;n=7?(Qn.setRGB(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6])).convertSRGBToLinear(),t.colors.push(Qn.r,Qn.g,Qn.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case"vt":t.uvs.push(parseFloat(e[1]),parseFloat(e[2]))}}else if("f"===r){const e=s.slice(1).trim().split(Nn),n=[];for(let t=0,i=e.length;t0){const e=i.split("/");n.push(e)}}const i=n[0];for(let e=1,s=n.length-1;e1){const e=i[1].trim().toLowerCase();t.object.smooth="0"!==e&&"off"!==e}else t.object.smooth=!0;const e=t.object.currentMaterial();e&&(e.smooth=t.object.smooth)}else{if("\0"===s)continue;console.warn('THREE.OBJLoader: Unexpected line: "'+s+'"')}}t.finalize();const s=new Ne.Z;s.materialLibraries=[].concat(t.materialLibraries);if(!0===!(1===t.objects.length&&0===t.objects[0].geometry.vertices.length))for(let e=0,n=t.objects.length;e0&&c.setAttribute("normal",new S.a$(i.normals,3)),i.colors.length>0&&(l=!0,c.setAttribute("color",new S.a$(i.colors,3))),!0===i.hasUVIndices&&c.setAttribute("uv",new S.a$(i.uvs,2));const h=[];for(let e=0,n=r.length;e1){for(let e=0,t=r.length;e0){const e=new oe({size:1,sizeAttenuation:!1}),n=new C.u;n.setAttribute("position",new S.a$(t.vertices,3)),t.colors.length>0&&void 0!==t.colors[0]&&(n.setAttribute("color",new S.a$(t.colors,3)),e.vertexColors=!0);const i=new De(n,e);s.add(i)}return s}}const jn=new a.I;class Hn extends b{constructor(e){super(e),this.propertyNameMapping={},this.customPropertyMapping={}}load(e,t,n,i){const s=this,r=new E(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,(function(n){try{t(s.parse(n))}catch(t){i?i(t):console.error(t),s.manager.itemError(e)}}),n,i)}setPropertyNameMapping(e){this.propertyNameMapping=e}setCustomPropertyNameMapping(e){this.customPropertyMapping=e}parse(e){function t(e,t=0){let n="";const i=/^ply([\s\S]*)end_header(\r\n|\r|\n)/.exec(e);null!==i&&(n=i[1]);const s={comments:[],elements:[],headerLength:t,objInfo:""},r=n.split(/\r\n|\r|\n/);let o;function a(e,t){const n={type:e[0]};return"list"===n.type?(n.name=e[3],n.countType=e[1],n.itemType=e[2]):n.name=e[1],n.name in t&&(n.name=t[n.name]),n}for(let e=0;ee.name));function n(e){for(let n=0,i=e.length;n0&&t.setIndex(e.indices),t.setAttribute("position",new S.a$(e.vertices,3)),e.normals.length>0&&t.setAttribute("normal",new S.a$(e.normals,3)),e.uvs.length>0&&t.setAttribute("uv",new S.a$(e.uvs,2)),e.colors.length>0&&t.setAttribute("color",new S.a$(e.colors,3)),(e.faceVertexUvs.length>0||e.faceVertexColors.length>0)&&(t=t.toNonIndexed(),e.faceVertexUvs.length>0&&t.setAttribute("uv",new S.a$(e.faceVertexUvs,2)),e.faceVertexColors.length>0&&t.setAttribute("color",new S.a$(e.faceVertexColors,3)));for(const n of Object.keys(u.customPropertyMapping))e[n].length>0&&t.setAttribute(n,new S.a$(e[n],u.customPropertyMapping[n].length));return t.computeBoundingSphere(),t}function l(e,t,n,i){if("vertex"===t){e.vertices.push(n[i.attrX],n[i.attrY],n[i.attrZ]),null!==i.attrNX&&null!==i.attrNY&&null!==i.attrNZ&&e.normals.push(n[i.attrNX],n[i.attrNY],n[i.attrNZ]),null!==i.attrS&&null!==i.attrT&&e.uvs.push(n[i.attrS],n[i.attrT]),null!==i.attrR&&null!==i.attrG&&null!==i.attrB&&(jn.setRGB(n[i.attrR]/255,n[i.attrG]/255,n[i.attrB]/255).convertSRGBToLinear(),e.colors.push(jn.r,jn.g,jn.b));for(const t of Object.keys(u.customPropertyMapping))for(const i of u.customPropertyMapping[t])e[t].push(n[i])}else if("face"===t){const t=n.vertex_indices||n.vertex_index,s=n.texcoord;3===t.length?(e.indices.push(t[0],t[1],t[2]),s&&6===s.length&&(e.faceVertexUvs.push(s[0],s[1]),e.faceVertexUvs.push(s[2],s[3]),e.faceVertexUvs.push(s[4],s[5]))):4===t.length&&(e.indices.push(t[0],t[1],t[3]),e.indices.push(t[1],t[2],t[3])),null!==i.attrR&&null!==i.attrG&&null!==i.attrB&&(jn.setRGB(n[i.attrR]/255,n[i.attrG]/255,n[i.attrB]/255).convertSRGBToLinear(),e.faceVertexColors.push(jn.r,jn.g,jn.b),e.faceVertexColors.push(jn.r,jn.g,jn.b),e.faceVertexColors.push(jn.r,jn.g,jn.b))}}function c(e,t){const n={};let i=0;for(let s=0;se.getInt8(t),size:1};case"uint8":case"uchar":return{read:t=>e.getUint8(t),size:1};case"int16":case"short":return{read:t=>e.getInt16(t,n),size:2};case"uint16":case"ushort":return{read:t=>e.getUint16(t,n),size:2};case"int32":case"int":return{read:t=>e.getInt32(t,n),size:4};case"uint32":case"uint":return{read:t=>e.getUint32(t,n),size:4};case"float32":case"float":return{read:t=>e.getFloat32(t,n),size:4};case"float64":case"double":return{read:t=>e.getFloat64(t,n),size:8}}}for(let s=0,r=e.length;s=this.arr.length}next(){return this.arr[this.i++]}}class Wn{constructor(e){this.objLoader=new Gn(e),this.plyLoader=new Hn(e)}isValid(e){const t=e.split(".").pop().toLowerCase();return Wn.extensions.indexOf(t)>=0}get(e){const t=e.split(".").pop().toLowerCase();return new Promise(((n,i)=>{if("obj"===t)this.objLoader.load(e,(t=>{const s=t.children[0].geometry;return s&&"Geometry"===s.type||"BufferGeometry"===s.type?n(s):i(new Error(`Can't parse geometry from '${e}'`))}));else{if("ply"!==t)throw new Error(`Can't load geometry, unknown extension: '${t}' in '${e}'`);this.plyLoader.load(e,(t=>t&&"Geometry"===t.type||"BufferGeometry"===t.type?n(t):i(new Error(`Can't parse geometry from '${e}'`))))}}))}}Wn.extensions=["obj","ply"];class Zn{constructor(e){this.textureLoader=new te(e)}isValid(e){const t=e.split(".").pop().toLowerCase();return Zn.extensions.indexOf(t)>=0}isValidMimeType(e){return Zn.mimeTypes.indexOf(e)>=0}get(e){return new Promise(((t,n)=>{this.textureLoader.load(e,(e=>{t(e)}),null,(e=>{console.error(e),n(new Error(e.message))}))}))}getImmediate(e){return this.textureLoader.load(e,null,null,(e=>{console.error(e)}))}}Zn.extensions=["jpg","png"],Zn.mimeTypes=["image/jpeg","image/png"];class qn{constructor(e){this._customFontPath=null,this._loadingManager=e,this._textureLoader=new te(e),this._cache={}}set fontPath(e){this._customFontPath=e}get fontPath(){return this._customFontPath}get(e){return this._cache[e]}async load(e){if(this._cache[e])return Promise.resolve(this._cache[e]);this._loadingManager.itemStart(e);const t=this.fontPath,n=t?t+e+".json":Xn+e+".json",i=t?t+e+".png":Xn+e+".png",s=fetch(n,{headers:{Accept:"application/json"}}).then((t=>{if(!t.ok)throw this._loadingManager.itemError(e),new Error(`failed to load bitmap font descriptor: '${n}', status: ${t.status} ${t.statusText}`);return t.json()})),r=new Promise(((e,t)=>{this._textureLoader.load(i,(n=>n?e(n):t(new Error(`failed to load font texture from '${i}'`))))}));return Promise.all([s,r]).then((t=>{const n={descriptor:t[0],texture:t[1]};return this._cache[e]=n,this._loadingManager.itemEnd(e),n}))}}var Kn=n(63872),Yn=n(15271);const Xn="https://cdn.jsdelivr.net/gh/smithsonian/dpo-voyager@latest/assets/";class Jn extends i.ZP{constructor(e,t){super(e,t),this.systemAssetPath=null;const n=this.assetManager.loadingManager;this.fileLoader=new s(n),this.modelLoader=new Tn(n,this.renderer),this.geometryLoader=new Wn(n),this.textureLoader=new Zn(n),this.fontReader=new qn(n)}dispose(){this.modelLoader.dispose(),super.dispose()}get assetManager(){return this.getMainComponent(Kn.Z)}get renderer(){return this.getMainComponent(Yn.Z)}setDracoPath(e){this.modelLoader.dracoPath=e}setSystemAssetPath(e){this.fontReader.fontPath=e,this.systemAssetPath=e,this.modelLoader.setAssetPath(e)}getSystemAssetUrl(e){return(this.systemAssetPath||Xn)+e}async getJSON(e){const t=this.assetManager.getAssetUrl(e);return this.fileLoader.getJSON(t)}async getText(e){const t=this.assetManager.getAssetUrl(e);return this.fileLoader.getText(t)}async getModel(e){const t=this.assetManager.getAssetUrl(e);return this.modelLoader.get(t)}async getGeometry(e){const t=this.assetManager.getAssetUrl(e);return this.geometryLoader.get(t)}async getTexture(e){const t=this.assetManager.getAssetUrl(e);return this.textureLoader.get(t)}async getFont(e){const t=this.assetManager.getAssetUrl(e);return this.fontReader.load(t)}async getSystemTexture(e){const t=this.getSystemAssetUrl(e);return this.textureLoader.get(t)}async getSystemJSON(e){const t=this.getSystemAssetUrl(e);return this.fileLoader.getJSON(t)}}Jn.typeName="CVAssetReader",Jn.text="AssetReader",Jn.icon="",Jn.isSystemSingleton=!0},17467:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i=n(80038),s=n(84678),r=n(63872),o=n(93072),a=n(1594),l=n(10564),c=n(51120),h=n(11359),d=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class u extends i.ZP{constructor(){super(...arguments),this._narrationId=null,this._activeId=null,this._audioMap={},this.audioClips={},this.audioPlayer=null,this.audioView=null,this.audioViews={},this.isPlaying=!1,this.ins=this.addInputs(u.ins),this.outs=this.addOutputs(u.outs),this.onEnd=()=>{const{outs:e}=this;this.isPlaying=!1,e.isPlaying.setValue(!1),this.audioView.requestUpdate()},this.onCueChange=e=>{const t=e.target.track.activeCues,n=t.length>0?t[0].text:"";this.ins.activeCaption.setValue(n)},this.onLoadTrack=e=>{const t=this.audioPlayer.children[0].track.cues;0===t[0].startTime&&(t[0].startTime=.01)},this.onTimeChange=e=>{this.audioView.elapsed=this.getTimeElapsed(),this.audioView.requestUpdate()}}get assetManager(){return this.getMainComponent(r.Z)}get language(){return this.getGraphComponent(o.Z,!0)}get analytics(){return this.system.getMainComponent(h.Z)}get narrationId(){return this._narrationId||""}set narrationId(e){this._narrationId=e,this.outs.narrationEnabled.setValue(e.length>0)}get activeId(){return this._activeId||""}set activeId(e){this._activeId=e}create(){super.create(),this.graph.components.on(s.Z,this.onMetaComponent,this),this.language.outs.language.on("value",this.onLanguageChange,this)}dispose(){Object.keys(this._audioMap).forEach((e=>URL.revokeObjectURL(this._audioMap[e]))),this.language.outs.language.off("value",this.onLanguageChange,this),this.graph.components.off(s.Z,this.onMetaComponent,this),super.dispose()}update(){const{ins:e,outs:t}=this;return e.playNarration.changed&&this.audioPlayer&&this._narrationId&&(t.narrationPlaying.value&&this.activeId==this._narrationId?this.stop():t.narrationPlaying.value||this.play(this._narrationId),t.narrationPlaying.setValue(!t.narrationPlaying.value)),!0}getPlayerById(e){if(!this.audioViews.hasOwnProperty(e)){const t=this.audioViews[e]=new p;t.audio=this,t.audioId=e,t.requestUpdate()}return this.audioViews[e]}getAudioList(){return Object.keys(this.audioClips).map((e=>this.audioClips[e]))}getAudioClip(e){return this.audioClips[e]}getAudioClipUri(e){const t=this.audioClips[e];return t?t.uris[a.PD[this.language.outs.language.value]]:null}getClipCaptionUri(e){const t=this.audioClips[e];return t?t.captionUris[a.PD[this.language.outs.language.value]]:null}getDuration(e){const t=this.audioClips[e],n=a.PD[this.language.outs.language.getValidatedValue()],i=t.durations[n];if(i)return i;{const t=this.audioClips[e];return Object.keys(t.uris).forEach((n=>{const i=t.uris[n];if(i){const s=this.assetManager.getAssetUrl(i);t.durations[n]="pending";const r=new(window.AudioContext||window.webkitAudioContext),o=new XMLHttpRequest;o.open("GET",s,!0),o.responseType="arraybuffer",o.onload=()=>{const s=new Blob([o.response],{type:"audio/mpeg"}),a=window.URL.createObjectURL(s);this._audioMap[i]=a,r.decodeAudioData(o.response,(i=>{let s=i.duration;t.durations[n]=s.toString(),this.getPlayerById(e).requestUpdate()}))},o.send()}})),"pending"}}getTimeElapsed(){return this.audioPlayer?Math.floor(this.audioPlayer.currentTime):0}setTimeElapsed(e){this.audioPlayer&&(0===this.audioPlayer.seekable.length?this.audioPlayer.addEventListener("canplay",(()=>this.setTimeElapsed(e)),{once:!0}):(this.audioPlayer.currentTime=e,this.audioView.elapsed=e,this.audioView.requestUpdate()))}addAudioClip(e){this.audioClips[e.id]=e,this.outs.updated.set()}removeAudioClip(e){this.isPlaying&&e==this.activeId&&this.stop(),e==this._narrationId&&(this.narrationId=""),delete this.audioClips[e]}updateAudioClip(e){this.getDuration(e),this.outs.updated.set()}onMetaComponent(e){const t=e.object;"NVScene"===t.node.typeName&&e.add&&(this.audioClips=t.audio.dictionary,t.once("load",(()=>{this.audioClips=t.audio.dictionary,this.outs.updated.set(),Object.keys(this.audioClips).forEach((e=>{this.updateAudioClip(this.audioClips[e].id)}))})))}fromData(e){const{outs:t}=this;e=e||{},this._narrationId=e.narrationId||null,t.narrationEnabled.setValue(null!=this._narrationId),this.audioClips[this._narrationId]||(t.narrationEnabled.setValue(!1),console.warn("Invalid narration audio ID"))}toData(){let e=null;return null!==this._narrationId&&(e={narrationId:this._narrationId}),e}play(e){const{outs:t}=this;t.isPlaying.value&&this.audioPlayer.pause(),this.activeId!==e&&this.setTimeElapsed(0),t.isPlaying.setValue(!0),this.audioView=this.audioViews[e],this.initializeClip(e),this.audioPlayer.play().then((()=>{this.activeId=e,this.isPlaying=!0,Object.keys(this.audioViews).forEach((e=>this.audioViews[e].requestUpdate())),this.analytics.sendProperty("Audio_Play",this.getAudioClipUri(e))})).catch((e=>l.ZP.show(`Failed to play audio at '${this.audioPlayer.getAttribute("src")}':${e}`,"warning")))}pause(){this.audioPlayer&&(this.outs.isPlaying.setValue(!1),this.audioPlayer.pause(),this.audioView.requestUpdate())}stop(){this.audioPlayer&&(this.pause(),this.setTimeElapsed(0),this.onEnd())}initializeClip(e){null===this.audioPlayer&&this.setupAudio();const t=this.audioClips[e];if(t){const e=t.uris[a.PD[this.language.outs.language.getValidatedValue()]];this.audioPlayer.src!=this._audioMap[e]&&(this.audioPlayer.setAttribute("src",this._audioMap[e]),this.audioPlayer.load());const n=this.audioPlayer.children[0];n.setAttribute("src","");const i=t.captionUris[a.PD[this.language.outs.language.getValidatedValue()]];i&&n.setAttribute("src",this.assetManager.getAssetUrl(i))}}setupAudio(){if(null===this.audioPlayer){const e=this.audioPlayer=document.createElement("audio");e.onended=this.onEnd,e.setAttribute("controls",""),e.setAttribute("preload","auto"),e.addEventListener("timeupdate",this.onTimeChange),e.crossOrigin="anonymous",e.onerror=()=>{console.error(`Error ${e.error.code}; details: ${e.error.message}`)};const t=document.createElement("track");t.setAttribute("default",""),this.audioPlayer.append(t),t.addEventListener("cuechange",this.onCueChange),t.addEventListener("load",this.onLoadTrack)}}onLanguageChange(){this.stop()}}u.typeName="CVAudioManager",u.text="Audio",u.icon="",u.isSystemSingleton=!0,u.ins={playNarration:i.V5.Event("Audio.PlayNarration"),activeCaption:i.V5.String("Audio.ActiveCaption"),captionsEnabled:i.V5.Boolean("Audio.CaptionsEnabled",!0)},u.outs={narrationEnabled:i.V5.Boolean("Audio.NarrationEnabled",!1),narrationPlaying:i.V5.Boolean("Audio.NarrationPlaying",!1),isPlaying:i.V5.Boolean("Audio.IsPlaying",!1),updated:i.V5.Event("Audio.Updated")};let p=class extends c.ZP{constructor(){super(),this.audio=null,this.audioId="",this.elapsed=0,this.onDrag=this.onDrag.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.addEventListener("keydown",this.onKeyDown)}firstConnected(){this.classList.add("sv-audio-view")}update(e){if(e.has("elapsed")){const e=this.querySelector("#time-slider");e&&(e.value=this.elapsed.toString())}super.update(e)}render(){const e=this.audio.outs.isPlaying.value&&this.audioId==this.audio.activeId,t=this.audio.getDuration(this.audioId),n=this.formatSeconds(this.elapsed),i="pending"==t?t:this.formatSeconds(parseInt(t));return c.dy`this.playAudio(e,this.audioId)}>`}playAudio(e,t){const n=this.audio;this.audio.outs.isPlaying.value&&this.audioId==this.audio.activeId?n.pause():n.play(t)}onDrag(e){e.stopPropagation()}onKeyDown(e){"Space"===e.code||"Enter"===e.code?"play-btn"==e.target.id&&this.playAudio(null,this.audioId):"ArrowUp"!==e.code&&"ArrowDown"!==e.code&&"ArrowLeft"!==e.code&&"ArrowRight"!==e.code||"time-slider"==e.target.id&&e.stopPropagation()}onTimeChange(){this.audioId==this.audio.activeId&&(this.audio.initializeClip(this.audioId),this.audio.setTimeElapsed(0|parseFloat(this.querySelector("#time-slider").value)))}formatSeconds(e){var t=new Date(0);return t.setSeconds(e),t.toISOString().substring(15,19)}};d([(0,c.Cb)({attribute:!1})],p.prototype,"audio",void 0),d([(0,c.Cb)({attribute:!1})],p.prototype,"audioId",void 0),d([(0,c.Cb)({attribute:!1})],p.prototype,"elapsed",void 0),p=d([(0,c.Mo)("sv-audio-view")],p)},71507:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(76969);class s extends i.Z{constructor(e,t){super(e,t),this.background.layers.set(1)}get settingProperties(){return[this.ins.style,this.ins.color0,this.ins.color1]}get snapshotProperties(){return[this.ins.color0,this.ins.color1]}hide(){this.background.visible=!1}show(){this.background.visible=!0}fromData(e){this.ins.copyValues({style:i.u[e.style]||i.u.Solid,color0:e.color0||[.2,.25,.3],color1:e.color1||[.01,.03,.05]})}toData(){const e=this.ins;return{style:i.u[e.style.value],color0:e.color0.cloneValue(),color1:e.color1.cloneValue()}}}s.typeName="CVBackground"},27884:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var i=n(19588),s=n(82954),r=n(78943),o=n(80038),a=n(26775),l=n(2837),c=n(28581);const h=new i.P,d=new i.P,u=new s.U,p=new r._;class f extends l.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(f.camIns),this.object3D=new a.ZP}get camera(){return this.object3D}update(){const{autoActivate:e,activate:t}=this.ins;if(t.changed||e.changed&&e.value){const e=this.scene;e&&(e.activeCameraComponent=this)}const n=this.camera,{position:i,rotation:s,projection:r,fov:o,size:a,zoom:l,near:c,far:h}=this.ins;if(i.changed||s.changed){n.position.fromArray(i.value);const e=[s.value[0],s.value[1],s.value[2]];n.rotation.fromArray(e),n.updateMatrix()}return r.changed&&n.setProjection(r.getValidatedValue()),n.fov=o.value,n.size=a.value,n.zoom=l.value,n.near=c.value,n.far=h.value,n.updateProjectionMatrix(),!0}dispose(){const e=this.scene;e&&e.activeCameraComponent===this&&(e.activeCameraComponent=null),super.dispose()}setPropertiesFromMatrix(e){const t=!e;e=e||this.object3D.matrix;const{position:n,rotation:i,order:s}=this.ins;e.decompose(h,p,d),h.toArray(n.value);const r=s.getOptionText();u.setFromQuaternion(p,r),h.setFromEuler(u),h.multiplyScalar(c.Z.RAD2DEG).toArray(i.value),n.set(t),i.set(t)}}f.typeName="CCamera",f.camIns={autoActivate:o.V5.Boolean("Camera.AutoActivate",!0),activate:o.V5.Event("Camera.Activate"),position:o.V5.Vector3("Transform.Position"),rotation:o.V5.Vector3("Transform.Rotation"),order:o.V5.Enum("Transform.Order",l.VZ,l.VZ.ZYX),projection:o.V5.Enum("Projection.Type",a.mP,a.mP.Perspective),fov:o.V5.Number("Projection.FovY",52),size:o.V5.Number("Projection.Size",20),zoom:o.V5.Number("Projection.Zoom",1),near:o.V5.Number("Frustum.ZNear",.01),far:o.V5.Number("Frustum.ZFar",1e4)};class m extends f{constructor(e,t){super(e,t),this.addIns=this.addInputs(m.cameraAddIns),this.object3D.layers.enable(1)}get settingProperties(){return[this.ins.projection,this.ins.fov,this.ins.size,this.ins.near,this.ins.far,this.addIns.autoNearFar]}fromDocument(e,t){if(!isFinite(t.camera))throw new Error("camera property missing in node");const n=e.cameras[t.camera];return null!=n.autoNearFar&&this.addIns.autoNearFar.setValue(n.autoNearFar),"perspective"===n.type?this.ins.copyValues({projection:a.mP.Perspective,fov:n.perspective.yfov,near:n.perspective.znear,far:n.perspective.zfar}):this.ins.copyValues({projection:a.mP.Orthographic,size:n.orthographic.ymag,near:n.orthographic.znear,far:n.orthographic.zfar}),t.camera}toDocument(e,t){const n=this.ins,i={};n.projection.getValidatedValue()===a.mP.Perspective?(i.type="perspective",i.perspective={yfov:n.fov.value,znear:n.near.value,zfar:n.far.value}):(i.type="orthographic",i.orthographic={ymag:n.size.value,znear:n.near.value,zfar:n.far.value}),i.autoNearFar=this.addIns.autoNearFar.value,e.cameras=e.cameras||[];const s=e.cameras.length;return e.cameras.push(i),s}}m.typeName="CVCamera",m.text="Camera",m.icon="video",m.cameraAddIns={autoNearFar:l.V5.Boolean("Frustum.AutoNearFar",!0)}},48377:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var i=n(31271),s=n(80038),r=n(25499),o=n(18894),a=n(92642),l=n(36283);class c extends o.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(c.rgIns),this._object3D=null,this._isAttached=!1,this._object3D=new r.T,this._object3D.matrixAutoUpdate=!1}get transform(){return this.node.components.get(a.ZP,!0)}get scene(){const e=this.transform;return e?e.getParentComponent(l.Z,!0):void 0}get object3D(){return this._object3D}create(){super.create(),this.innerRoots.filter((e=>e.is(a.ZP))).forEach((e=>this._object3D.add(e.object3D))),this.trackComponent(a.ZP,(e=>this.ins.visible.value&&this.attachObject3D(e)),(e=>this.detachObject3D(e)))}dispose(){this.detachObject3D(this.transform),this.innerRoots.filter((e=>e.is(a.ZP))).forEach((e=>this._object3D.remove(e.object3D))),super.dispose()}update(e){super.update(e);const t=this.ins;if(t.visible.changed){const e=this.transform;t.visible.value?this.attachObject3D(e):this.detachObject3D(e)}return!0}onAddInnerRoot(e){e.is(a.ZP)&&this._object3D.add(e.object3D)}onRemoveInnerRoot(e){e.is(a.ZP)&&this._object3D.remove(e.object3D)}attachObject3D(e){this._isAttached||e&&(e.object3D.add(this._object3D),this._isAttached=!0)}detachObject3D(e){this._isAttached&&e&&(e.object3D.remove(this._object3D),this._isAttached=!1)}}c.typeName="CRenderGraph",c.rgIns={visible:o.V5.Boolean("Graph.Visible",!0)};var h=n(75310),d=n.n(h);const u=JSON.parse('{"$id":"https://schemas.3d.si.edu/voyager/document.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Smithsonian 3D Document","description":"Describes a 3D document containing a scene with 3D models.","definitions":{"scene":{"$id":"#scene","type":"object","properties":{"nodes":{"type":"array","description":"The indices of the scene\'s root nodes.","items":{"type":"integer","minimum":0},"uniqueItems":true,"minItems":1},"setup":{"description":"The index of the scene\'s setup.","type":"integer","minimum":0}}},"node":{"$id":"#node","type":"object","properties":{"name":{"type":"string"},"children":{"type":"array","description":"The indices of this node\'s children.","items":{"type":"integer","minimum":0},"uniqueItems":true,"minItems":1},"matrix":{"description":"A floating-point 4x4 transformation matrix stored in column-major order.","type":"array","items":{"type":"number"},"minItems":16,"maxItems":16,"default":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},"translation":{"description":"The node\'s translation along the x, y, and z axes.","type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"default":[0,0,0]},"rotation":{"description":"The node\'s unit quaternion rotation in the order (x, y, z, w), where w is the scalar.","type":"array","items":{"type":"number","minimum":-1,"maximum":1},"minItems":4,"maxItems":4,"default":[0,0,0,1]},"scale":{"description":"The node\'s non-uniform scale, given as the scaling factors along the x, y, and z axes.","type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"default":[1,1,1]},"camera":{"description":"The index of the camera component of this node.","type":"integer","minimum":0},"light":{"description":"The index of the light component of this node.","type":"integer","minimum":0},"meta":{"description":"The index of the meta data component of this node.","type":"integer","minimum":0},"model":{"description":"The index of the model component of this node.","type":"integer","minimum":0}},"not":{"anyOf":[{"required":["matrix","translation"]},{"required":["matrix","rotation"]},{"required":["matrix","scale"]}]}},"camera":{"$id":"#camera","type":"object","properties":{"type":{"description":"Specifies if the camera uses a perspective or orthographic projection.","type":"string","enum":["perspective","orthographic"]},"perspective":{"description":"A perspective camera containing properties to create a perspective projection matrix.","type":"object","properties":{"yfov":{"type":"number","description":"The floating-point vertical field of view in radians.","exclusiveMinimum":0},"aspectRatio":{"type":"number","description":"The floating-point aspect ratio of the field of view.","exclusiveMinimum":0},"znear":{"type":"number","description":"The floating-point distance to the near clipping plane.","exclusiveMinimum":0},"zfar":{"type":"number","description":"The floating-point distance to the far clipping plane.","exclusiveMinimum":0}},"required":["yfov","znear"]},"orthographic":{"description":"An orthographic camera containing properties to create an orthographic projection matrix.","type":"object","properties":{"xmag":{"type":"number","description":"The floating-point horizontal magnification of the view. Must not be zero."},"ymag":{"type":"number","description":"The floating-point vertical magnification of the view. Must not be zero."},"znear":{"type":"number","description":"The floating-point distance to the near clipping plane.","exclusiveMinimum":0},"zfar":{"type":"number","description":"The floating-point distance to the far clipping plane. `zfar` must be greater than `znear`.","exclusiveMinimum":0}},"required":["ymag","znear","zfar"]},"autoNearFar":{"type":"boolean","default":true}},"required":["type"],"not":{"required":["perspective","orthographic","autoNearFar"]}},"light":{"$id":"#light","type":"object","properties":{"type":{"description":"Specifies the type of the light source.","type":"string","enum":["ambient","directional","point","spot","hemisphere","rect"]},"color":{"$ref":"#/definitions/colorRGB"},"intensity":{"type":"number","minimum":0,"default":1},"castShadow":{"type":"boolean","default":false},"point":{"type":"object","properties":{"distance":{"type":"number","minimum":0},"decay":{"type":"number","minimum":0}}},"spot":{"type":"object","properties":{"distance":{"type":"number","minimum":0},"decay":{"type":"number","minimum":0},"angle":{"type":"number","minimum":0},"penumbra":{"type":"number","minimum":0}}},"hemisphere":{"type":"object","properties":{"groundColor":{"$ref":"#/definitions/colorRGB"}}}},"required":["type"],"not":{"required":["point","spot","hemisphere"]}},"colorRGB":{"$id":"#colorRGB","type":"array","items":{"type":"number","minimum":0,"maximum":1},"minItems":3,"maxItems":3,"default":[1,1,1]}},"type":"object","properties":{"asset":{"type":"object","properties":{"type":{"type":"string","const":"application/si-dpo-3d.document+json"},"version":{"description":"Version of this presentation description.","type":"string","minLength":1},"copyright":{"description":"A copyright message to credit the content creator.","type":"string","minLength":1},"generator":{"description":"Tool that generated this presentation description.","type":"string","minLength":1}},"required":["type","version"]},"scene":{"description":"Index of the root scene of the document.","type":"integer","minimum":0},"scenes":{"description":"An array of scenes.","type":"array","items":{"$ref":"#/definitions/scene"}},"nodes":{"description":"An array of nodes.","type":"array","items":{"$ref":"#/definitions/node"},"minItems":1},"metas":{"description":"An array of meta data components.","type":"array","items":{"$ref":"./meta.schema.json"}},"setups":{"description":"An array of setup components.","type":"array","items":{"$ref":"./setup.schema.json"},"minItems":1},"cameras":{"description":"An array of camera components.","type":"array","items":{"$ref":"#/definitions/camera"},"minItems":1},"lights":{"description":"An array of light components.","type":"array","items":{"$ref":"#/definitions/light"},"minItems":1},"models":{"description":"An array of model components.","type":"array","items":{"$ref":"./model.schema.json"},"minItems":1}},"required":["asset","scene","scenes"],"additionalProperties":false}'),p=JSON.parse('{"$id":"https://schemas.3d.si.edu/voyager/common.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Math","description":"Definitions for mathematical compound objects such as vectors and matrices.","definitions":{"units":{"$id":"#units","type":"string","enum":["inherit","mm","cm","m","km","in","ft","yd","mi"]},"vector2":{"description":"2-component vector.","$id":"#vector2","type":"array","items":{"type":"number"},"minItems":2,"maxItems":2,"default":[0,0]},"vector3":{"description":"3-component vector.","$id":"#vector3","type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"default":[0,0,0]},"vector4":{"description":"4-component vector.","$id":"#vector4","type":"array","items":{"type":"number"},"minItems":4,"maxItems":4,"default":[0,0,0,0]},"matrix3":{"description":"3 by 3, matrix, storage: column-major.","$id":"#matrix3","type":"array","items":{"type":"number"},"minItems":9,"maxItems":9,"default":[1,0,0,0,1,0,0,0,1]},"matrix4":{"description":"4 by 4 matrix, storage: column-major.","$id":"#matrix4","type":"array","items":{"type":"number"},"minItems":16,"maxItems":16,"default":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},"boundingBox":{"description":"Axis-aligned 3D bounding box.","$id":"#boundingBox","type":"object","properties":{"min":{"$ref":"#/definitions/vector3"},"max":{"$ref":"#/definitions/vector3"}},"required":["min","max"]}}}'),f=JSON.parse('{"$id":"https://schemas.3d.si.edu/voyager/meta.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Meta","description":"Meta data for a scene or model item.","definitions":{"image":{"$id":"image","description":"Reference to a preview image","type":"object","properties":{"uri":{"description":"Location of the image resource, absolute URL or path relative to this document","type":"string","minLength":1},"quality":{"type":"string","enum":["Thumb","Low","Medium","High"]},"byteSize":{"type":"integer","minimum":1},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1},"usage":{"type":"string","enum":["Render","ARCode"]}},"required":["uri","quality"]},"article":{"$id":"#article","description":"Reference to an external document (HTML)","type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"description":"Short title.","type":"string"},"titles":{"description":"Short title with language key.","type":"object"},"lead":{"description":"Short lead text.","type":"string"},"leads":{"description":"Short lead text with language key.","type":"object"},"tags":{"description":"Array of tags, categorizing the article.","type":"array","items":{"type":"string"}},"taglist":{"description":"Array of tags, categorizing the annotation with language key.","type":"object"},"intros":{"description":"Introductory splash screen text with language key.","type":"object"},"uri":{"description":"Location of the article resource, absolute URL or path relative to this document","type":"string","minLength":1},"uris":{"description":"Location of the article resource, absolute URL or path relative to this document with language key","type":"object"},"mimeType":{"description":"MIME type of the resource.","type":"string"},"thumbnailUri":{"description":"Location of a thumbnail/preview image of the resource.","type":"string"}},"required":["id"],"additionalProperties":false},"audioclip":{"$id":"audioclip","description":"Reference to an audio file","type":"object","properties":{"id":{"type":"string","minLength":1},"name":{"description":"Short name.","type":"string"},"uris":{"description":"Location of the audio resource, absolute URL or path relative to this document with language key","type":"object"},"captionUris":{"description":"Location of the caption resource, absolute URL or path relative to this document with language key","type":"object"},"durations":{"description":"Length of the audio resource with language key","type":"object"}},"required":["id","uris"]}},"type":"object","properties":{"collection":{"description":"Information retrieved from the collection record for the item.","type":"object"},"process":{"description":"Information about how the item was processed.","type":"object"},"images":{"type":"array","items":{"$ref":"#/definitions/image"},"minItems":1},"articles":{"type":"array","items":{"$ref":"#/definitions/article"},"minItems":1},"leadArticle":{"description":"Index of the main article. This is the default article displayed with the item.","type":"integer","minimum":0},"audio":{"type":"array","items":{"$ref":"#/definitions/audioclip"},"minItems":0}},"additionalProperties":false}'),m=JSON.parse('{"$id":"https://schemas.3d.si.edu/voyager/model.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Model","description":"Describes the visual representations (models, derivatives) of a 3D item.","definitions":{"annotation":{"description":"Spatial annotation (hot spot, hot zone) on a model. Annotations can reference articles.","type":"object","properties":{"id":{"type":"string","minLength":1},"title":{"type":"string"},"titles":{"description":"Short title with language key.","type":"object"},"lead":{"type":"string"},"leads":{"description":"Short lead text with language key.","type":"object"},"marker":{"type":"string"},"tags":{"description":"Array of tags, categorizing the annotation.","type":"array","items":{"type":"string"}},"taglist":{"description":"Array of tags, categorizing the annotation with language key.","type":"object"},"articleId":{"description":"Id of an article related to this annotation.","type":"string","minLength":1},"imageUri":{"description":"URI of an image resource for this annotation.","type":"string","minLength":1},"imageCredit":{"description":"Credit line image in this annotation with language key.","type":"object"},"imageAltText":{"description":"Alt text for image in this annotation with language key","type":"object"},"audioId":{"description":"Id of an audio resource for this annotation.","type":"string","minLength":1},"viewId":{"description":"Id of a snapshot resource with camera view information for this annotation.","type":"string","minLength":1},"style":{"type":"string"},"visible":{"description":"Flag indicating whether the annotation is visible.","type":"boolean","default":true},"expanded":{"description":"Flag indicating whether the annotation is displayed in expanded state.","type":"boolean","default":false},"scale":{"description":"Scales the annotation relative to its default size.","type":"number","default":1},"offset":{"description":"Offsets the annotation along its direction.","type":"number","default":0},"tilt":{"description":"Tilt angle of the annotation relative to the direction vector in degrees.","type":"number","default":0},"azimuth":{"description":"Azimuth angle of a tilted annotation.","type":"number","default":0},"color":{"description":"Color of the annotation","type":"array","minItems":3,"maxItems":3,"items":{"type":"number"}},"position":{"description":"Position where the annotation is anchored, in local item coordinates.","$ref":"./common.schema.json#/definitions/vector3"},"direction":{"description":"Direction of the stem of this annotation, usually corresponds to the surface normal.","$ref":"./common.schema.json#/definitions/vector3"},"zoneIndex":{"description":"Index of the zone on the zone texture.","type":"integer","minimum":0}},"required":["id"],"additionalProperties":false},"derivative":{"description":"Visual representation derived from the master model.","type":"object","properties":{"usage":{"description":"usage categories for a derivative.","type":"string","enum":["Image2D","Web3D","App3D","iOSApp3D","Print3D","Editorial3D"]},"quality":{"type":"string","enum":["Thumb","Low","Medium","High","Highest","AR"]},"assets":{"description":"List of individual resources this derivative is composed of.","type":"array","items":{"$ref":"#/definitions/asset"}}}},"asset":{"description":"an individual resource for a 3D model.","type":"object","properties":{"uri":{"type":"string","minLength":1},"type":{"type":"string","enum":["Model","Geometry","Image","Texture","Points","Volume"]},"part":{"type":"string","minLength":1},"mimeType":{"type":"string","minLength":1},"byteSize":{"type":"integer","minimum":1},"numFaces":{"type":"integer","minimum":1},"imageSize":{"type":"integer","minimum":1},"mapType":{"type":"string","enum":["Color","Normal","Occlusion","Emissive","MetallicRoughness","Zone"]}},"required":["uri","type"]},"material":{"description":"Surface properties for this model, shared by all derivatives.","type":"object","properties":{}}},"type":"object","properties":{"units":{"$ref":"./common.schema.json#/definitions/units"},"tags":{"type":"string"},"visible":{"type":"boolean"},"renderOrder":{"type":"number"},"overlayMap":{"type":"number"},"shadowSide":{"type":"string","enum":["Front","Back","Double"]},"derivatives":{"type":"array","items":{"$ref":"#/definitions/derivative"}},"translation":{"description":"Translation vector. Must be applied to bring model into its \'neutral\' pose.","$ref":"./common.schema.json#/definitions/vector3"},"rotation":{"description":"Rotation quaternion. Must be applied to bring model into its \'neutral\' pose.","$ref":"./common.schema.json#/definitions/vector4"},"boundingBox":{"description":"Bounding box for this model, shared by all derivatives.","$ref":"./common.schema.json#/definitions/boundingBox"},"material":{"$ref":"#/definitions/material"},"annotations":{"description":"List of annotations to be displayed with the model","type":"array","items":{"$ref":"#/definitions/annotation"}}},"required":["units","derivatives"],"additionalProperties":false}'),g=JSON.parse('{"$id":"https://schemas.3d.si.edu/voyager/setup.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Setup","description":"Tours and settings for explorer documents (background, interface, etc.)","definitions":{"viewer":{"type":"object","properties":{"shader":{"type":"string"},"exposure":{"type":"number"},"toneMapping":{"type":"boolean"},"gamma":{"type":"number"},"annotationsVisible":{"type":"boolean"},"isWallMountAR":{"type":"boolean"},"arScale":{"type":"number"},"activeTags":{"type":"string"},"sortedTags":{"type":"string"},"radioTags":{"type":"boolean"}},"required":["shader","exposure","gamma"]},"reader":{"type":"object","properties":{"enabled":{"type":"boolean"},"position":{"type":"string"},"articleId":{"description":"Id of the article currently displayed in the reader.","type":"string","minLength":1}}},"interface":{"type":"object","properties":{"visible":{"type":"boolean"},"logo":{"type":"boolean"},"menu":{"type":"boolean"},"tools":{"type":"boolean"}}},"navigation":{"type":"object","properties":{"type":{"type":"string","enum":["Orbit","Walk"]},"enabled":{"type":"boolean"},"autoZoom":{"type":"boolean"},"autoRotation":{"type":"boolean"},"lightsFollowCamera":{"type":"boolean"},"orbit":{"$comment":"TODO: Implement","type":"object","properties":{}},"walk":{"$comment":"TODO: Implement","type":"object","properties":{}}}},"background":{"type":"object","properties":{"style":{"type":"string","enum":["Solid","LinearGradient","RadialGradient"]},"color0":{"$ref":"./common.schema.json#/definitions/vector3"},"color1":{"$ref":"./common.schema.json#/definitions/vector3"}}},"floor":{"type":"object","properties":{"visible":{"type":"boolean"},"position":{"$ref":"./common.schema.json#/definitions/vector3"},"size":{"type":"number"},"color":{"$ref":"./common.schema.json#/definitions/vector3"},"opacity":{"type":"number"},"receiveShadow":{"type":"boolean"},"autoSize":{"type":"boolean"}}},"grid":{"type":"object","properties":{"visible":{"type":"boolean"},"color":{"$ref":"./common.schema.json#/definitions/vector3"}}},"tape":{"type":"object","properties":{"enabled":{"type":"boolean"},"startPosition":{"$ref":"./common.schema.json#/definitions/vector3"},"startDirection":{"$ref":"./common.schema.json#/definitions/vector3"},"endPosition":{"$ref":"./common.schema.json#/definitions/vector3"},"endDirection":{"$ref":"./common.schema.json#/definitions/vector3"}}},"slicer":{"type":"object","properties":{"enabled":{"type":"boolean"},"axis":{"type":"string","enum":["X","Y","Z"]},"inverted":{"type":"boolean"},"position":{"type":"number"},"color":{"$ref":"./common.schema.json#/definitions/vector3"}}},"audio":{"type":"object","properties":{"narrationId":{"type":"string"}}},"language":{"type":"object","properties":{"language":{"type":"string","enum":["EN","ES","DE","NL","JA","FR","HAW"]}}},"tours":{"description":"Animated tours.","type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"titles":{"description":"Short title with language key.","type":"object"},"lead":{"type":"string"},"leads":{"description":"Short lead text with language key.","type":"object"},"tags":{"description":"Array of tags, categorizing the tour.","type":"array","items":{"type":"string"}},"taglist":{"description":"Array of tags, categorizing the annotation with language key.","type":"object"},"steps":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"titles":{"description":"Short title with language key.","type":"object"},"id":{"type":"string"}}}}}}},"snapshots":{"description":"Snapshots are animatable scene states.","type":"object","properties":{"features":{"type":"array","items":{"type":"string"}},"targets":{"type":"array","items":{"type":"string"}},"states":{"type":"array","items":{"type":"object"}}}}},"type":"object","properties":{"units":{"$ref":"./common.schema.json#/definitions/units"},"interface":{"$ref":"#/definitions/interface"},"viewer":{"$ref":"#/definitions/viewer"},"reader":{"$ref":"#/definitions/reader"},"navigation":{"$ref":"#/definitions/navigation"},"background":{"$ref":"#/definitions/background"},"floor":{"$ref":"#/definitions/floor"},"grid":{"$ref":"#/definitions/grid"},"tape":{"$ref":"#/definitions/tape"},"slicer":{"$ref":"#/definitions/slicer"},"tours":{"$ref":"#/definitions/tours"},"language":{"$ref":"#/definitions/language"},"audio":{"$ref":"#/definitions/audio"}}}');var A=n(75222),v=n(82567),y=n(84678),b=n(79815),_=n(63872),x=n(11359),w=n(1594);class E extends c{constructor(e,t){super(e,t),this.titles={},this.intros={},this.meta=null,this.ins=this.addInputs(E.ins),this.outs=this.addOutputs(E.outs),this.innerGraph.createCustomNode(v.Z),this.ins.active.setValue(!1),this.ins.visible.setValue(!1)}get root(){return this.innerNodes.get(v.Z)}get setup(){return this.innerComponents.get(b.Z)}get assetPath(){return this.outs.assetPath.value}get assetBaseName(){let e=this.assetPath;const t=e.indexOf(".svx.json");return t>=0&&(e=e.substr(0,t)),e}get analytics(){return this.getMainComponent(x.Z)}create(){super.create(),this.innerGraph.components.on(y.Z,this.onMetaComponent,this),this.setup.language.outs.language.on("value",this.onLanguageUpdate,this)}dispose(){this.setup.language.outs.language.off("value",this.onLanguageUpdate,this),this.innerGraph.components.off(y.Z,this.onMetaComponent,this),super.dispose()}update(e){super.update(e);const{ins:t,outs:n}=this;if(t.dumpJson.changed){const e=this.deflateDocument();console.log("-------------------- VOYAGER DOCUMENT --------------------"),console.log(JSON.stringify(e,((e,t)=>"number"==typeof t?parseFloat(t.toFixed(5)):t),2))}if(t.dumpTree.changed&&(console.log("-------------------- VOYAGER DOCUMENT --------------------"),this.dump()),t.download.changed){const e=n.assetPath.value.split("/").pop()||"voyager-document.json";i.Z.json(this.deflateDocument(),e)}if(t.title.changed&&this.titles){const e=this.setup.language;t.title.setValue(t.title.value,!0),n.title.setValue(t.title.value),t.title.value&&(this.titles[w.PD[e.outs.language.value]]=t.title.value,this.updateMeta())}if(t.intro.changed&&this.intros){const e=this.setup.language;n.intro.setValue(t.intro.value),this.intros[w.PD[e.outs.language.value]]=t.intro.value,this.updateMeta()}return!0}clearNodeTree(){this.root.transform.children.slice().forEach((e=>e.node.dispose()))}openDocument(e,t,n){var i;if(!E.validator.validate(e))throw new Error("document schema validation failed");n||(this.clearNodeTree(),this.ins.title.setValue(null)),this.ins.copyright.setValue(null!==(i=e.asset.copyright)&&void 0!==i?i:this.ins.copyright.schema.preset),this.onMetaComponent({type:"CVMeta",object:this.root.meta,add:!0,remove:!1});let s="object"==typeof n?n:this.root;if(s.graph!==this.innerGraph)throw new Error("invalid parent node");const r=new Map;if(s instanceof v.Z)s.fromDocument(e,e.scene,r);else{e.scenes[e.scene].nodes.forEach((t=>{const n=this.innerGraph.createCustomNode(A.Z);s.transform.addChild(n.transform),n.fromDocument(e,t,r)}))}t&&(this.outs.assetPath.setValue(t),this.name=this.getMainComponent(_.Z).getAssetName(t))}appendModel(e,t,n){if(n&&n.graph!==this.innerGraph)throw new Error("invalid parent node");if(this.isEmpty())throw new Error("empty document, can't append model");n=n||this.root;const i=this.innerGraph.createCustomNode(A.Z);n.transform.addChild(i.transform),i.createModel();const s=i.model;return s.derivatives.createModelAsset(e,t),s}appendGeometry(e,t,n,i,s,r){if(r&&r.graph!==this.innerGraph)throw new Error("invalid parent node");if(this.isEmpty())throw new Error("empty document, can't append geometry");r=r||this.root;const o=this.innerGraph.createCustomNode(A.Z);r.transform.addChild(o.transform),o.createModel();o.model.derivatives.createMeshAsset(e,t,n,i,s)}deflateDocument(e){if(this.isEmpty())throw new Error("empty document, can't serialize");const t={asset:{type:E.mimeType,version:E.version,generator:"Voyager",copyright:this.ins.copyright.value},scene:0,scenes:[]},n=new Map;return t.scene=this.root.toDocument(t,n,e),t}onMetaComponent(e){const t=e.object,n=this.ins.title,i=this.ins.intro,s=this.setup.language;null===this.meta&&(this.meta=t),e.add&&!n.value&&t.once("load",(()=>{this.titles=t.collection.get("titles")||{},this.intros=t.collection.get("intros")||{},0===Object.keys(this.titles).length&&(this.titles[w.PD[s.outs.language.value]]=t.collection.get("title")||"",t.collection.dictionary.titles=this.titles);const e=this.titles[w.PD[s.outs.language.value]];n.setValue(e);const r=this.intros[w.PD[s.outs.language.value]]||"";i.setValue(r),this.analytics.setTitle(e),this.meta=t}))}onLanguageUpdate(){const e=this.setup.language,t=this.titles[w.PD[e.outs.language.value]];this.ins.title.setValue(t);const n=this.intros[w.PD[e.outs.language.value]]||"";this.ins.intro.setValue(n)}updateMeta(){const e=this.meta;e&&(e.collection.dictionary.titles=this.titles,e.collection.dictionary.intros=this.intros)}}E.typeName="CVDocument",E.mimeType="application/si-dpo-3d.document+json",E.version="1.0",E.validator=new class{constructor(){this._schemaValidator=new(d())({schemas:[u,p,f,m,g],allErrors:!0}),this._validateDocument=this._schemaValidator.getSchema("https://schemas.3d.si.edu/voyager/document.schema.json")}validate(e){return!!this._validateDocument(e)||(console.warn(this._schemaValidator.errorsText(this._validateDocument.errors,{separator:", ",dataVar:"document"})),!1)}},E.ins={dumpJson:s.V5.Event("Document.DumpJSON"),dumpTree:s.V5.Event("Document.DumpTree"),download:s.V5.Event("Document.Download"),title:s.V5.String("Document.Title"),intro:s.V5.String("Document.Intro",""),copyright:s.V5.String("Document.Copyright","(c) Smithsonian Institution. All rights reserved.")},E.outs={assetPath:s.V5.AssetPath("Asset.Path",{preset:"scene.svx.json"}),title:s.V5.String("Document.Title"),intro:s.V5.String("Document.Intro","")}},25864:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(80038),s=n(63833),r=n(48377);class o extends s.Z{constructor(e,t){super(e,t),this.outs=this.addOutputs(o.outs),this.scope=s.$.Node}createDocument(e,t){const n=this.node.createComponent(r.Z);return this.activeComponent=n,e&&n.openDocument(e,t),n}amendDocument(e,t,n){const i=this.activeComponent;if(!i)throw new Error("no active document, can't amend");return i.openDocument(e,t,n),i}refreshDocument(){this.emit({type:"active-component",previous:null,next:this.activeComponent})}appendModel(e,t){const n=this.activeComponent;if(!n)throw new Error("no active document, can't append model");return n.appendModel(e,t),n}appendGeometry(e,t,n,i,s){const r=this.activeComponent;if(!r)throw new Error("no active document, can't append geometry");return r.appendGeometry(e,t,n,i,s),r}removeActiveDocument(){const e=this.activeComponent;e&&e.dispose()}activateComponent(e){e.ins.visible.setValue(!0),e.ins.active.setValue(!0)}deactivateComponent(e){e.ins.visible.setValue(!1),e.ins.active.setValue(!1)}onActiveComponent(e,t){this.outs.activeDocument.setValue(t)}onScopedComponents(){this.outs.changedDocuments.set()}}o.typeName="CVDocumentProvider",o.componentType=r.Z,o.outs={activeDocument:i.V5.Object("Documents.Active",r.Z),changedDocuments:i.V5.Event("Documents.Changed")}},24856:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(75544),s=n(80038),r=n(96180),o=n(26629),a=n(36283);const l=["Footprint_Court_1k_TMap.jpg","spruit_sunrise_1k_LDR.jpg","campbell_env.jpg"];class c extends s.ZP{constructor(){super(...arguments),this.ins=this.addInputs(c.envIns),this._texture=null,this._currentIdx=0,this.shouldUseEnvMap=!1}get assetReader(){return this.getMainComponent(r.Z)}get sceneNode(){return this.getSystemComponent(a.Z)}update(){const e=this.ins,t=this.getGraphComponent(o.Z);return e.dirty.changed&&(this.shouldUseEnvMap=!1,t.models.forEach((t=>{t.object3D.traverse((t=>{const n=t.material;n&&n.isUberPBRMaterial&&(n.roughnessMap||n.metalnessMap)&&(this.shouldUseEnvMap=!0,null!==this._texture&&(this._texture.dispose(),this._texture=null),e.imageIndex.set())}))}))),e.imageIndex.changed&&this.shouldUseEnvMap&&(e.imageIndex.value==this._currentIdx&&null!==this._texture||(null!==this._texture&&this._texture.dispose(),this.assetReader.getSystemTexture("images/"+l[e.imageIndex.value]).then((e=>{this._texture=e,this._texture.mapping=i.dSO,this.sceneNode.scene.environment=this._texture})),this._currentIdx=e.imageIndex.value)),!0}fromData(e){this.ins.copyValues({imageIndex:e.index})}toData(){return{index:this.ins.imageIndex.cloneValue()}}}c.typeName="CVEnvironment",c.text="Environment",c.envIns={imageIndex:s.V5.Integer("Environment.Index",{preset:0,options:l.map((function(e,t){return t.toString()}))}),dirty:s.V5.Event("Environment.Dirty")}},97322:(e,t,n)=>{"use strict";n.d(t,{Z:()=>v});var i=n(2837),s=n(8035),r=n(83866),o=n(71050),a=n(41654),l=n(8173),c=n(17393);const h=n(93523).Z,d=n(62001).Z;class u extends s.K{constructor(){super(new r._(2,2,1,1),new p),this.geometry.rotateX(-90*o.M8.DEG2RAD),this.receiveShadow=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}class p extends a.x{constructor(e){super(e),this.defines={},this.type="FloorMaterial",this.isMeshPhongMaterial=!0,this.isFloorMaterial=!0,this.defines={},this.uniforms=l.rD.merge([c.V.phong.uniforms]),this.vertexShader=d,this.fragmentShader=h,this.transparent=!0,this.shininess=0}}class f extends i.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(f.floorIns),this.object3D=new u}get floor(){return this.object3D}update(e){super.update(e);const t=this.ins,n=this.floor;return(t.position.changed||t.radius.changed)&&(n.position.fromArray(t.position.value),n.scale.setScalar(t.radius.value),n.updateMatrix()),t.color.changed&&n.material.color.fromArray(t.color.value),t.opacity.changed&&(n.material.opacity=t.opacity.value),!0}dispose(){this.floor.dispose(),super.dispose()}}f.typeName="CFloor",f.floorIns={position:i.V5.Vector3("Floor.Position",[0,-25,0]),radius:i.V5.Number("Floor.Radius",50),color:i.V5.ColorRGB("Floor.Color",[.6,.75,.8]),opacity:i.V5.Percent("Floor.Opacity",.5),castShadow:i.V5.Boolean("Shadow.Cast"),receiveShadow:i.V5.Boolean("Shadow.Receive")};var m=n(80038),g=n(26629);const A=new(n(19588).P);class v extends f{constructor(e,t){super(e,t),this.addIns=this.addInputs(v.floorAddIns),this.ins.visible.setValue(!1),this.ins.receiveShadow.setValue(!0),this.floor.renderOrder=-1}get settingProperties(){return[this.ins.visible,this.ins.position,this.ins.radius,this.ins.color,this.ins.opacity,this.ins.receiveShadow,this.addIns.autoSize]}get snapshotProperties(){return[this.ins.opacity]}get sceneNode(){return this.getSystemComponent(g.Z)}create(){super.create(),this.sceneNode.outs.boundingBox.on("value",this.recalculateSize,this)}dispose(){this.sceneNode.outs.boundingBox.off("value",this.recalculateSize,this),super.dispose()}update(e){const t=this.addIns;return t.autoSize.changed&&t.autoSize.value&&this.recalculateSize(),super.update(e),!0}recalculateSize(){const{addIns:e}=this;if(e.autoSize.value){const e=this.sceneNode.outs.boundingBox.value;e.getSize(A);const t=Math.max(A.x,A.y,A.z),{min:n,max:i}=e;this.ins.radius.setValue(t),this.ins.position.setValue([(n.x+i.x)/2,n.y,(n.z+i.z)/2])}}fromData(e){e=e||{},this.ins.copyValues({visible:!!e.visible,position:e.position||[0,-25,0],radius:void 0!==e.size?e.size:50,color:e.color||[.6,.75,.8],opacity:void 0!==e.opacity?e.opacity:.5,receiveShadow:!!e.receiveShadow,autoSize:void 0===e.autoSize||e.autoSize})}toData(){const e=this.ins;return{visible:e.visible.value,position:e.position.cloneValue(),size:e.radius.value,color:e.color.cloneValue(),opacity:e.opacity.value,receiveShadow:e.receiveShadow.value,autoSize:this.addIns.autoSize.value}}}v.typeName="CVFloor",v.text="Floor",v.icon="",v.floorAddIns={autoSize:m.V5.Boolean("Floor.AutoSize",!0)}},6461:(e,t,n)=>{"use strict";n.d(t,{Z:()=>_});var i=n(19588),s=n(82587),r=n(93113),o=n(37840),a=n(28092),l=n(64026),c=n(75809),h=n(35322);class d extends a.e{constructor(e){super(d.generate(e),new l.n({color:4294967295,vertexColors:!0}))}set opacity(e){this.material.opacity=e,this.material.transparent=e<1}update(e){this.geometry&&this.geometry.dispose(),this.geometry=d.generate(e)}static generate(e){const t=new r.I(e.mainColor),n=new r.I(e.subColor),i=e.mainDivisions*e.subDivisions,s=e.size/i,o=.5*e.size,a=[],l=[];for(let r=0,c=0,h=-o;r<=i;++r,h+=s){a.push(-o,0,h,o,0,h),a.push(h,0,-o,h,0,o);const i=r%e.subDivisions==0?t:n;i.toArray(l,c),c+=3,i.toArray(l,c),c+=3,i.toArray(l,c),c+=3,i.toArray(l,c),c+=3}const d=new c.u;return d.setAttribute("position",new h.a$(a,3)),d.setAttribute("color",new h.a$(l,3)),d}}var u=n(80038),p=n(2837),f=n(1594),m=n(26629),g=n(29767);const A=new i.P,v=new i.P,y=(new s.y).makeRotationX(.5*Math.PI),b=new s.y;class _ extends p.ZP{constructor(){super(...arguments),this.tape=null,this.ins=this.addInputs(_.gridIns),this.outs=this.addOutputs(_.gridOuts),this._lastViewport=null,this._gridProps={size:20,mainDivisions:2,subDivisions:10,mainColor:new r.I(.5,.7,.8),subColor:new r.I(.25,.35,.4)}}get settingProperties(){return[this.ins.visible,this.ins.color,this.ins.opacity]}get snapshotProperties(){return[this.ins.opacity]}get grid(){return this.object3D}create(){this.ins.pickable.setValue(!1),this.ins.visible.setValue(!1),this.tape=this.node.createComponent(g.Z),this.tape.ins.startPosition.setValue([0,0,0]),this.tape.ins.endPosition.setValue([0,0,0]),this.tape.ins.visible.setValue(!1),this.tape.addTag("no_settings"),super.create()}activate(){this.getGraphComponent(m.Z).outs.boundingBox.linkTo(this.ins.boundingBox)}update(){const e=this.ins;if(e.color.changed||e.boundingBox.changed){const t=this._gridProps;if(e.color.changed){const n=t.mainColor,i=t.subColor;n.fromArray(e.color.value),i.r=.5*n.r,i.g=.5*n.g,i.b=.5*n.b}if(e.boundingBox.changed){const e=this.getGraphComponent(m.Z),n=e.outs.boundingBox.value,i=e.ins.units.value;n.getSize(A);let s=Math.max(A.x,A.y,A.z),r=1;for(;s/r>5;)r*=10;s=Math.ceil(s/r)*r*2,t.size=s,this.outs.size.setValue(s),this.outs.units.setValue(i),t.mainDivisions=s/r,t.subDivisions=10,v.set(0,n.min.y,0),this.tape.ins.startPosition.setValue([-s/2,n.min.y+s/100,-s/2-s/100]),this.tape.ins.endPosition.setValue([-s/2+s/t.mainDivisions,n.min.y+s/100,-s/2-s/100])}this.object3D?this.grid.update(t):this.object3D=new d(t),e.boundingBox.changed&&(this.grid.position.copy(v),this.grid.updateMatrix())}return e.visible.changed&&(this.grid.visible=e.visible.value,this.tape.ins.visible.setValue(this.grid.visible&&e.labelEnabled.value)),e.opacity.changed&&(this.grid.opacity=e.opacity.value),e.labelEnabled.changed&&this.tape.ins.visible.setValue(this.grid.visible&&e.labelEnabled.value),!0}preRender(e){const t=e.viewport,n=this.object3D;if(t!==this._lastViewport){this._lastViewport=t;const i=e.viewport.camera;i?n.matrix.extractRotation(i.matrixWorld).multiply(y):n.matrix.extractRotation(b),n.updateMatrixWorld(!0)}}postRender(e){this.object3D.updateMatrix()}fromData(e){e=e||{},this.ins.copyValues({visible:!!e.visible,color:e.color||[.5,.7,.8]})}toData(){const e=this.ins;return{visible:e.visible.cloneValue(),color:e.color.cloneValue()}}}_.typeName="CVGrid",_.text="Grid",_.icon="",_.gridIns={color:u.V5.ColorRGB("Grid.Color",[.5,.7,.8]),opacity:u.V5.Percent("Grid.Opacity",1),boundingBox:u.V5.Object("Scene.BoundingBox",o.Z),labelEnabled:u.V5.Boolean("Grid.LabelEnabled",!0)},_.gridOuts={size:u.V5.Number("Size"),units:u.V5.Enum("Units",f.f_)}},40490:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r,p:()=>i});var i,s=n(80038);!function(e){e[e.none=0]="none",e[e.menu=1]="menu",e[e.title=2]="title",e[e.logo=4]="logo",e[e.language=8]="language",e[e.tour_exit=16]="tour_exit",e[e.help=32]="help"}(i||(i={}));class r extends s.ZP{constructor(){super(...arguments),this.ins=this.addInputs(r.ins),this.outs=this.addOutputs(r.outs)}update(e){return!0}fromData(e){e=e||{},this.ins.setValues({visible:void 0===e.visible||e.visible,logo:void 0===e.logo||e.logo,menu:void 0===e.menu||e.menu,tools:void 0===e.tools||e.tools})}toData(){const e=this.ins;return{visible:e.visible.value,logo:e.logo.value,menu:e.menu.value,tools:e.tools.value}}isShowing(e){return(e&this.ins.visibleElements.value)===e}}r.typeName="CVInterface",r.ins={visible:s.V5.Boolean("Interface.Visible",!0),logo:s.V5.Boolean("Interface.Logo",!0),menu:s.V5.Boolean("Interface.Menu",!0),tools:s.V5.Boolean("Interface.Tools",!0),visibleElements:s.V5.Number("Interface.VisibleElements",63)},r.outs={documentTitle:s.V5.String("Document.Title")}},93072:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(80038),s=n(1594),r=n(96180),o=n(82507);class a extends i.ZP{constructor(){super(...arguments),this._activeLanguages={},this._translations={},this.ins=this.addInputs(a.ins),this.outs=this.addOutputs(a.outs),this.updateLanguage=e=>{const{ins:t,outs:n}=this;t.language.value===e&&(n.language.setValue(e),this.emit({type:"tag-update"}))}}get assetReader(){return this.getMainComponent(r.Z)}get activeLanguages(){return Object.values(this._activeLanguages)}nameString(){return s.oS[s.PD[this.ins.language.value]]}codeString(){return s.PD[this.ins.language.value]}create(){super.create()}update(){const{ins:e,outs:t}=this;if(0==this.activeLanguages.length&&e.language.value==t.language.value&&this.addLanguage(t.language.value),e.language.changed&&e.language.value!=t.language.value){const t=e.language.value;this.addLanguage(t),this.assetReader.getSystemJSON("language/string.resources."+s.PD[this.ins.language.value].toLowerCase()+".json").then((e=>{this._translations=e,this.updateLanguage(t)}))}return!0}fromData(e){var t;const{ins:n,outs:i}=this;e=e||{};const r=null!==(t=s.PD[e.language||"EN"])&&void 0!==t?t:s.PD[s.k$];n.language.value<0&&n.language.setValue(r)}toData(){const e=this.ins;return{language:s.PD[e.language.getValidatedValue()]}}addLanguage(e){var t,n,i;null!==(t=(n=this._activeLanguages)[i=s.PD[e]])&&void 0!==t||(n[i]={id:e,name:s.oS[s.PD[e]]})}getLocalizedString(e){const t=this._translations;return void 0===t?e:t[e]||e}}a.typeName="CVLanguageManager",a.text="Language",a.icon="",a.isSystemSingleton=!0,a.ins={enabled:i.V5.Boolean("Language.Enabled",!1),language:i.V5.Enum("Interface.Language",s.PD,{preset:s.PD[s.k$],enum:s.PD,options:(0,o.q)(s.oS).map((e=>s.oS[e]))})},a.outs={language:i.V5.Enum("Interface.Language",s.PD,s.PD.EN)}},84678:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var i=n(82942);class s extends i.Z{constructor(e){super(),this.addEvent("update"),this._list=e||[],this._dict={},e&&e.forEach((e=>{e.id&&(this._dict[e.id]=e)}))}get length(){return this._list.length}get ids(){return Object.keys(this._dict)}get items(){return this._list}set items(e){this._list=e,this._dict={},e.forEach((e=>{e.id&&(this._dict[e.id]=e)})),this.emit({type:"update",item:null,what:"update"})}append(e){this._list.push(e),e.id&&(this._dict[e.id]=e),this.emit({type:"update",item:e,what:"add"})}insertBefore(e,t){const n=this._list.indexOf(t);n>=0&&this.insertAt(e,n)}insertAt(e,t){this._list.splice(t,0,e),e.id&&(this._dict[e.id]=e),this.emit({type:"update",item:e,what:"add"})}replaceItem(e,t){const n=this._list.indexOf(t);n>=0&&this.replaceAt(e,n)}replaceAt(e,t){const n=this._list[t];n.id&&delete this._dict[n.id],this._list[t]=e,e.id&&(this._dict[e.id]=e),this.emit({type:"update",item:e,what:"replace"})}moveItem(e,t){const n=this._list.indexOf(e);this.moveAt(n,t)}moveAt(e,t){const n=this._list;if(e+t<0||e+t>=n.length)return;const i=n[e];if(t>0){for(let i=0;it;--i)n[e+i]=n[e+i-1];n[e+t]=i}this.emit({type:"update",item:i,what:"move"})}removeById(e){const t=this._dict[e];return t&&this.removeItem(t),t}removeItem(e){const t=this._list.indexOf(e);return this.removeAt(t),t}removeAt(e){const t=this._list;if(e<0||e>=t.length)return;const n=t[e];return t.splice(e,1),n.id&&delete this._dict[n.id],this.emit({type:"update",item:n,what:"remove"}),n}getAt(e){return this._list[e]}getById(e){return this._dict[e]}getIndexOf(e){return this._list.indexOf(e)}copy(e){this.items=e.slice()}clone(){return this._list.slice()}}s.prototype[Symbol.iterator]=function(){return{index:0,list:this._list,next:function(){return this.index{e.id&&(this._dict[e.id]=e)}))}get length(){return this.ids.length}get items(){return this.ids.map((e=>this._dict[e]))}set items(e){e.forEach((e=>{e.id&&(this._dict[e.id]=e)})),this.emit({type:"update",item:null,what:"update"})}get ids(){return Object.keys(this._dict)}get dictionary(){return this._dict}set dictionary(e){this._dict=e,this.emit({type:"update",item:null,what:"update"})}insert(e,t){if(!(t=t||e.id))throw new Error("can't insert, missing id");this._dict[t]=e,this.emit({type:"update",item:e,what:"insert"})}remove(e){const t="string"==typeof e?e:e.id,n=this._dict[t];void 0!==n&&(delete this._dict[t],this.emit({type:"update",item:n,what:"remove"}))}get(e){return this._dict[e]}getOrCreate(e,t){let n=this._dict[e];return n||(n=this._dict[e]=t,this.emit({type:"update",item:n,what:"insert"})),n}copy(e){this.dictionary=Object.assign({},e)}clone(){return Object.assign({},this._dict)}}var o=n(80038),a=n(38112),l=n(1594),c=n(93072);class h extends o.ZP{constructor(){super(...arguments),this.collection=new r,this.process=new r,this.images=new r,this.articles=new s,this.leadArticle=null,this.notes=[],this.audio=new r}get language(){return this.getGraphComponent(c.Z,!0)}fromDocument(e,t){if(!isFinite(t.meta))throw new Error("info property missing in node");const n=e.metas[t.meta];if(n.collection&&(this.collection.dictionary=n.collection,this.collection.get("titles")&&Object.keys(this.collection.get("titles")).forEach((e=>{this.language.addLanguage(l.PD[e])}))),n.process&&(this.process.dictionary=n.process),n.images){const e={};n.images.forEach((t=>e[t.quality]=t)),this.images.dictionary=e}if(n.articles&&(this.articles.items=n.articles.map((e=>a.Z.fromJSON(e))),void 0!==n.leadArticle&&(this.leadArticle=this.articles.getAt(n.leadArticle)),this.articles.items.forEach((e=>{Object.keys(e.data.titles).forEach((e=>{this.language.addLanguage(l.PD[e])}))}))),n.audio){const e={};n.audio.forEach((t=>{t.captionUris=t.captionUris||{},t.durations={},e[t.id]=t})),this.audio.dictionary=e}return this.emit("load"),t.meta}toDocument(e,t){let n=null;if(this.collection.length>0&&(n={collection:this.collection.dictionary}),this.process.length>0&&(n=n||{},n.process=this.process.dictionary),this.images.length>0&&(n=n||{},n.images=this.images.items),this.articles.length>0){n=n||{};const e=this.articles.items;n.articles=e.map((e=>e.toJSON())),this.leadArticle&&(n.leadArticle=e.indexOf(this.leadArticle))}if(this.audio.length>0&&(n=n||{},n.audio=this.audio.items,n.audio.forEach((e=>{e.durations={}}))),n){e.metas=e.metas||[];const t=e.metas.length;return e.metas.push(n),t}}}h.typeName="CVMeta",h.text="Meta",h.icon="document"},3388:(e,t,n)=>{"use strict";n.d(t,{Z:()=>U});var i=n(19588),s=n(78943),r=n(37840),o=n(82587),a=n(29187),l=n(75544),c=n(28092),h=n(64026),d=n(35322),u=n(75809);class p extends c.e{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new u.u;i.setIndex(new d.Tl(n,1)),i.setAttribute("position",new d.a$([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new h.n({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}var f=n(10564),m=n(80038),g=n(2837),A=n(79961),v=n(43875),y=n(15577),b=n(10290),_=n(37117),x=n(38642);const w=[],E=[_.$l.Thumb,_.$l.AR,_.$l.Low,_.$l.Medium,_.$l.High,_.$l.Highest];class C{constructor(){this.derivatives={}}select(e,t){const n=_._U[e],i=_.$l[t],s=E.indexOf(t);if(s<0)return console.warn(`derivative quality not supported: '${i}'`),null;const r=this.get(e,t);if(r)return r;for(let t=s+1;t=0;--t){const n=this.get(e,E[t]);if(n)return console.warn(`derivative quality '${i}' not available, using lower quality`),n}return console.warn(`no suitable derivative found for quality '${i}' and usage '${n}'`),null}getByUsage(e){const t=_._U[e];return(this.derivatives[t]||w).sort(((e,t)=>e.data.qualityt.data.quality?1:0))}getByQuality(e){return this.getArray().filter((t=>t.data.quality===e))}getArray(){return Object.keys(this.derivatives).reduce(((e,t)=>e.concat(this.derivatives[t])),[])}get(e,t){const n=_._U[e],i=this.derivatives[n];if(i)for(let e=0,n=i.length;e-1&&t.splice(i,1)}}createModelAsset(e,t){t="string"==typeof t?_.$l[t]:t,t=isFinite(t)?t:_.$l.Medium;const n=this.getOrCreate(_._U.Web3D,t),i=new x.ZP;return i.setModel(e),n.addAsset(i),n}createMeshAsset(e,t,n,i,s){s="string"==typeof s?_.$l[s]:s,s=isFinite(s)?s:_.$l.Medium;const r=this.getOrCreate(_._U.Web3D,s),o=new x.ZP;if(o.setGeometry(e),r.addAsset(o),t){const e=new x.ZP;e.setTexture(t,x.xd.Color),r.addAsset(e)}if(n){const e=new x.ZP;e.setTexture(n,x.xd.Occlusion),r.addAsset(e)}if(i){const e=new x.ZP;e.setTexture(i,x.xd.Normal),r.addAsset(e)}return r}clear(){for(let e in this.derivatives)this.derivatives[e].forEach((e=>e.dispose()));this.derivatives={}}toJSON(){const e=[];for(let t in this.derivatives)this.derivatives[t].forEach((t=>e.push(t.toJSON())));return e}fromJSON(e){this.clear(),e.forEach((e=>{this.getOrCreateBin(_._U[e.usage]).push(new _.ZP(e))}))}toString(e=!1){const t=this.derivatives,n=Object.keys(t);return e?`Derivatives (${n.length}) \n `+n.map((e=>t[e].map((e=>e.toString(!0))).join("\n "))).join("\n "):`Derivatives (${n.length}) `+n.map((e=>`${e} (${t[e].length})`)).join(", ")}getOrCreateBin(e){const t=_._U[e];return this.derivatives[t]||(this.derivatives[t]=[])}}var S=n(51462),M=n(63872),I=n(96180),T=n(15271),P=n(24856),B=n(79815);const R=new i.P,D=new i.P,L=new s._,N=new s._,k=new r.Z,O=new o.y;class U extends g.ZP{constructor(e,t){super(e,t),this.ins=this.addInputs(U.ins),this.outs=this.addOutputs(U.outs),this._derivatives=new C,this._activeDerivative=null,this._visible=!0,this._boxFrame=null,this._localBoundingBox=new r.Z,this._prevPosition=new i.P(0,0,0),this._prevRotation=new i.P(0,0,0),this._materialCache={},this.object3D=new a.Z}get settingProperties(){return[this.ins.name,this.ins.visible,this.ins.quality,this.ins.localUnits,this.ins.tags,this.ins.renderOrder,this.ins.shadowSide,this.ins.shader,this.ins.overlayMap,this.ins.slicerEnabled,this.ins.override,this.ins.color,this.ins.opacity,this.ins.hiddenOpacity,this.ins.roughness,this.ins.metalness,this.ins.occlusion,this.ins.doubleSided]}get snapshotProperties(){return[this.ins.visible,this.ins.quality,this.ins.overlayMap,this.ins.override,this.ins.opacity,this.ins.roughness,this.ins.metalness,this.ins.color,this.ins.slicerEnabled]}get derivatives(){return this._derivatives}get activeDerivative(){return this._activeDerivative}get localBoundingBox(){return this._localBoundingBox}get assetManager(){return this.getMainComponent(M.Z)}get assetReader(){return this.getMainComponent(I.Z)}get renderer(){return this.getMainComponent(T.Z)}create(){super.create();this.node.createComponent(S.Z).ins.unitScale.linkFrom(this.outs.unitScale);const e=this.renderer.outs.maxTextureSize.value;e<2048?this.ins.quality.setValue(v.$l.Low):e<4096?this.ins.quality.setValue(v.$l.Medium):this.ins.quality.setValue(v.$l.High)}update(){const e=this.ins;if(e.name.changed&&(this.node.name=e.name.value),e.tags.changed||e.activeTags.changed||e.visible.changed){let t=e.visible.value;if(t){const n=e.tags.value.split(",").map((e=>e.trim())).filter((e=>e)),i=e.activeTags.value.split(",").map((e=>e.trim())).filter((e=>e));t=!n.length,i.forEach((e=>{n.indexOf(e)>=0&&(t=!0)}))}const n=this.ins.override.value;this._visible=t,t?(this.object3D.visible=!0,n&&this.updateMaterial()):e.visible.value&&n&&this.ins.hiddenOpacity.value>0?(this.object3D.visible=!0,this.updateMaterial()):this.object3D.visible=!1,this.outs.updated.set()}if(e.tags.changed&&this.emit({type:"tag-update"}),!this.activeDerivative&&e.autoLoad.changed&&e.autoLoad.value)this.autoLoad(e.quality.value);else if(e.quality.changed){const t=this.derivatives.select(v._U.Web3D,e.quality.value);t&&t!==this.activeDerivative&&this.loadDerivative(t).catch((e=>{console.warn("Model.update - failed to load derivative"),console.warn(e)}))}return e.renderOrder.changed&&this.updateRenderOrder(this.object3D,e.renderOrder.value),(e.localUnits.changed||e.globalUnits.changed)&&this.updateUnitScale(),e.shader.changed&&this.updateShader(),e.overlayMap.changed&&this.updateOverlayMap(),e.shadowSide.changed&&this.updateShadowSide(),e.override.value&&e.shader.value===b.p.Default&&(e.override.changed||e.color.changed||e.opacity.changed||e.doubleSided.changed||e.roughness.changed||e.metalness.changed||e.occlusion.changed)?this.updateMaterial():e.override.changed&&!e.override.value&&e.shader.value===b.p.Default&&this.object3D.traverse((e=>{const t=e.material;if(t&&t.isUberPBRMaterial){const e=this._materialCache[t.uuid];t.aoMapMix.setScalar(e.occlusion),t.color.fromArray(e.color),t.opacity=e.opacity,t.transparent=e.transparent,t.roughness=e.roughness,t.metalness=e.metalness,t.side=e.doubleSided?l.ehD:l.Wl3,t.needsUpdate=!0}})),e.center.changed&&this.center(),(e.position.changed||e.rotation.changed)&&this.updateMatrixFromProps(),e.dumpDerivatives.changed&&console.log(this.derivatives.toString(!0)),!0}dispose(){this.derivatives.clear(),this._activeDerivative=null,super.dispose()}center(){const e=this.object3D,t=this.ins.position;e.matrix.decompose(R,L,D),e.matrix.makeRotationFromQuaternion(L),k.makeEmpty(),A.sN(e,k,e.parent),k.getCenter(R),R.multiplyScalar(-1).toArray(t.value),t.set()}setFromMatrix(e){const t=this.ins;e.decompose(R,L,D),R.multiplyScalar(1/this.outs.unitScale.value).toArray(t.position.value),t.position.set(),A.MO(L,U.rotationOrder,t.rotation.value),t.rotation.set()}fromDocument(e,t){const{ins:n,outs:i}=this;if(!isFinite(t.model))throw new Error("model property missing in node");const s=e.models[t.model];n.name.setValue(t.name);const r=v.f_[s.units||"cm"];n.localUnits.setValue(isFinite(r)?r:v.f_.cm),n.visible.setValue(void 0===s.visible||s.visible),n.tags.setValue(s.tags||""),n.renderOrder.setValue(void 0!==s.renderOrder?s.renderOrder:0);const o=v.id[s.shadowSide||"Back"];if(n.shadowSide.setValue(isFinite(o)?o:v.id.Back),n.position.reset(),n.rotation.reset(),s.translation&&(n.position.copyValue(s.translation),this._prevPosition.fromArray(s.translation)),s.rotation&&(L.fromArray(s.rotation),A.MO(L,U.rotationOrder,n.rotation.value),this._prevRotation.fromArray(n.rotation.value),n.rotation.set()),s.boundingBox){const e=this._localBoundingBox;e.min.fromArray(s.boundingBox.min),e.max.fromArray(s.boundingBox.max),this._boxFrame=new p(e,"#009cde"),this.addObject3D(this._boxFrame),this._boxFrame.updateMatrixWorld(!0);const t=this.getGraphComponent(B.Z,!0);t&&t.navigation.ins.autoZoom.value&&t.navigation.ins.zoomExtents.set(),i.updated.set(),this.updateUnitScale()}if(s.derivatives&&this.derivatives.fromJSON(s.derivatives),s.material){const e=s.material;n.copyValues({override:!0,color:e.color||n.color.schema.preset,opacity:void 0!==e.opacity?e.opacity:n.opacity.schema.preset,hiddenOpacity:void 0!==e.hiddenOpacity?e.hiddenOpacity:n.hiddenOpacity.schema.preset,roughness:void 0!==e.roughness?e.roughness:n.roughness.schema.preset,metalness:void 0!==e.metalness?e.metalness:n.metalness.schema.preset,occlusion:void 0!==e.occlusion?e.occlusion:n.occlusion.schema.preset,doubleSided:void 0!==e.doubleSided?e.doubleSided:n.doubleSided.schema.preset})}return s.overlayMap&&n.overlayMap.setValue(s.overlayMap),s.annotations&&this.getComponent(S.Z).fromData(s.annotations),this.emit({type:"tag-update"}),this.ins.autoLoad.set(),t.model}toDocument(e,t){const n={units:v.f_[this.ins.localUnits.getValidatedValue()]},i=this.ins;i.visible.value||(n.visible=!1),i.tags.value&&(n.tags=i.tags.value),0!==i.renderOrder.value&&(n.renderOrder=i.renderOrder.value),i.shadowSide.value!=v.id.Back&&(n.shadowSide=v.id[this.ins.shadowSide.getValidatedValue()]);const s=i.position.value;0===s[0]&&0===s[1]&&0===s[2]||(n.translation=i.position.value);const r=i.rotation.value;0===r[0]&&0===r[1]&&0===r[2]||(A.jU(r,U.rotationOrder,L),n.rotation=L.toArray()),i.override.value&&(n.material={color:i.color.value,opacity:i.opacity.value,hiddenOpacity:i.hiddenOpacity.value,roughness:i.roughness.value,metalness:i.metalness.value,occlusion:i.occlusion.value,doubleSided:i.doubleSided.value}),0!==i.overlayMap.value&&(n.overlayMap=i.overlayMap.value),n.boundingBox={min:this._localBoundingBox.min.toArray(),max:this._localBoundingBox.max.toArray()},n.derivatives=this.derivatives.toJSON();const o=this.getComponent(S.Z).toData();o&&o.length>0&&(n.annotations=o),e.models=e.models||[];const a=e.models.length;return e.models.push(n),a}updateShader(){const e=this.ins.shader.getValidatedValue();this.object3D.traverse((t=>{const n=t.material;n&&n.isUberPBRMaterial&&n.setShaderMode(e)}))}updateShadowSide(){this.object3D.traverse((e=>{const t=e.material;t&&t.isUberPBRMaterial&&(this.ins.shadowSide.value==v.id.Front?t.shadowSide=l.Wl3:t.shadowSide=l._Li,t.needsUpdate=!0)}))}updateOverlayMap(){const e=this.getGraphComponent(B.Z,!0);if(e&&e.snapshots.outs.tweening.value)return void e.snapshots.outs.end.once("value",(()=>{this.ins.overlayMap.set(),this.update()}));const t=this.ins.overlayMap.getOptionText();"None"!==t?this.assetReader.getTexture(t).then((e=>{this.object3D.traverse((t=>{const n=t.material;n&&n.isUberPBRMaterial&&(e.flipY=!1,n.zoneMap=e,n.enableZoneMap(!0))}))})):this.object3D.traverse((e=>{const t=e.material;t&&t.isUberPBRMaterial&&(t.enableZoneMap(!1),t.zoneMap=null)}))}updateMaterial(){const e=this.ins;this.object3D.traverse((t=>{const n=t.material;n&&n.isUberPBRMaterial&&(n.aoMapMix.setScalar(e.occlusion.value),n.color.fromArray(e.color.value),n.opacity=this._visible?e.opacity.value:e.hiddenOpacity.value,n.transparent=n.opacity<1||this._materialCache[n.uuid].transparent,n.roughness=e.roughness.value,n.metalness=e.metalness.value,n.side=e.doubleSided.value?l.ehD:l.Wl3,n.needsUpdate=!0)}))}updateUnitScale(){const e=this.ins.localUnits.getValidatedValue(),t=this.ins.globalUnits.getValidatedValue();this.outs.unitScale.setValue((0,y.Z)(e,t)),this.updateMatrixFromProps()}updateMatrixFromProps(){const e=this.ins,t=this.outs.unitScale.value,n=this.object3D;R.fromArray(e.position.value).multiplyScalar(t),A.jU(e.rotation.value,U.rotationOrder,L),D.setScalar(t),n.matrix.compose(R,L,D),n.matrixWorldNeedsUpdate=!0,A.jU([this._prevRotation.x,this._prevRotation.y,this._prevRotation.z],U.rotationOrder,N),N.invert(),D.setScalar(1),O.compose(R.fromArray(e.position.value),L,D);const i=this.getComponent(S.Z);i.getAnnotations().forEach((e=>{R.fromArray(e.data.position),R.sub(this._prevPosition),R.applyQuaternion(N),R.applyMatrix4(O),e.data.position=R.toArray(),R.fromArray(e.data.direction),R.applyQuaternion(N),R.applyQuaternion(L),e.data.direction=R.toArray(),e.update(),i.updateAnnotation(e,!0)})),this._prevPosition.copy(R.fromArray(e.position.value)),this._prevRotation.copy(R.fromArray(e.rotation.value)),this.outs.updated.set()}updateRenderOrder(e,t){e.renderOrder=t,e.children.forEach((e=>this.updateRenderOrder(e,t)))}autoLoad(e){const t=[],n=this.derivatives.select(v._U.Web3D,v.$l.Thumb);n&&t.push(n);const i=this.derivatives.select(v._U.Web3D,e);return i&&i!==n&&t.push(i),0===t.length?(f.ZP.show(`No 3D derivatives available for '${this.displayName}'.`),Promise.resolve()):t.reduce(((e,t)=>e.then((()=>{this.loadDerivative(t)}))),Promise.resolve())}loadDerivative(e){if(this.node&&this.assetReader)return e.load(this.assetReader).then((()=>{if(!e.model||!this.node||this._activeDerivative&&e.data.quality!=this.ins.quality.value)return void e.unload();this.assetManager.initialLoad||this._activeDerivative||(this.assetManager.initialLoad=!0),this._activeDerivative&&(this.removeObject3D(this._activeDerivative.model),this._activeDerivative.unload()),this._activeDerivative=e,this.addObject3D(e.model),this.renderer.activeSceneComponent.scene.updateMatrixWorld(!0),this._boxFrame&&(this.removeObject3D(this._boxFrame),this._boxFrame.geometry.dispose(),this._boxFrame=null),this._localBoundingBox.makeEmpty(),A.sN(e.model,this._localBoundingBox),this.outs.updated.set(),this.outs.quality.setValue(e.data.quality),this.object3D.traverse((e=>{const t=e.material;t&&t.isUberPBRMaterial&&(this._materialCache[t.uuid]={color:t.color.toArray(),opacity:t.opacity,hiddenOpacity:this.ins.hiddenOpacity.schema.preset,roughness:t.roughness,metalness:t.metalness,occlusion:t.aoMapMix.x,doubleSided:t.side==l.ehD,transparent:t.transparent})})),this.ins.override.value&&this.updateMaterial(),this.ins.shadowSide.value!=v.id.Back&&this.updateShadowSide(),this.getGraphComponent(P.Z).ins.dirty.set(),0!==this.ins.renderOrder.value&&this.updateRenderOrder(this.object3D,this.ins.renderOrder.value);const t=this.ins.overlayMap.schema.options||["None"];t.push(...e.findAssets(v.hH.Image).filter((e=>e.data.mapType===v.xd.Zone)).map((e=>e.data.uri))),this.ins.overlayMap.setOptions(t),0!==this.ins.overlayMap.value&&this.ins.overlayMap.set(),this.emit({type:"model-load",quality:e.data.quality})})).catch((e=>f.ZP.show(`Failed to load model derivative: ${e.message}`)));console.warn("Model load interrupted.")}addObject3D(e){this.object3D.add(e),this.object3D.traverse((e=>{"Mesh"===e.type&&this.registerPickableObject3D(e,!0)}))}}U.typeName="CVModel2",U.text="Model",U.icon="cube",U.rotationOrder="ZYX",U.ins={name:m.V5.String("Model.Name"),globalUnits:m.V5.Enum("Model.GlobalUnits",v.f_,v.f_.cm),localUnits:m.V5.Enum("Model.LocalUnits",v.f_,v.f_.cm),quality:m.V5.Enum("Model.Quality",v.$l,v.$l.High),tags:m.V5.String("Model.Tags"),renderOrder:m.V5.Number("Model.RenderOrder",0),shadowSide:m.V5.Enum("Model.ShadowSide",v.id,v.id.Back),activeTags:m.V5.String("Model.ActiveTags"),autoLoad:m.V5.Boolean("Model.AutoLoad",!0),position:m.V5.Vector3("Model.Position"),rotation:m.V5.Vector3("Model.Rotation"),center:m.V5.Event("Model.Center"),shader:m.V5.Enum("Material.Shader",b.p,b.p.Default),overlayMap:m.V5.Option("Material.OverlayMap",["None"],0),slicerEnabled:m.V5.Boolean("Material.SlicerEnabled",!0),override:m.V5.Boolean("Material.Override",!1),color:m.V5.ColorRGB("Material.BaseColor"),opacity:m.V5.Percent("Material.Opacity",1),hiddenOpacity:m.V5.Percent("Material.HiddenOpacity",0),roughness:m.V5.Percent("Material.Roughness",.8),metalness:m.V5.Percent("Material.Metalness",.1),occlusion:m.V5.Percent("Material.Occlusion",.25),doubleSided:m.V5.Boolean("Material.DoubleSided",!1),dumpDerivatives:m.V5.Event("Derivatives.Dump")},U.outs={unitScale:m.V5.Number("UnitScale",{preset:1,precision:5}),quality:m.V5.Enum("LoadedQuality",v.$l),updated:m.V5.Event("Updated")}},13227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var i=n(19588),s=n(82587),r=n(78943),o=n(82954),a=n(71050),l=n(92642);const c=new i.P,h=new i.P,d=new s.y,u=new r._,p=new o.U;class f extends l.ZP{get settingProperties(){return[this.ins.position,this.ins.rotation,this.ins.scale]}get snapshotProperties(){return[this.ins.position,this.ins.rotation,this.ins.scale]}fromData(e){const{position:t,rotation:n,order:i,scale:s}=this.ins,r=l.VZ[i.getValidatedValue()];e.matrix?(d.fromArray(e.matrix),d.decompose(c,u,h),c.toArray(t.value),p.setFromQuaternion(u,r),c.setFromEuler(p).multiplyScalar(a.M8.RAD2DEG).toArray(n.value),h.toArray(s.value),t.set(),n.set(),s.set()):(e.translation&&t.setValue(e.translation.slice()),e.rotation&&(u.fromArray(e.rotation),p.setFromQuaternion(u,r),c.setFromEuler(p).multiplyScalar(a.M8.RAD2DEG).toArray(n.value),n.set()),e.scale&&s.setValue(e.scale.slice()),this.transform.changed=!0)}toData(){this.object3D.matrix.decompose(c,u,h);const e={};return 0===c.x&&0===c.y&&0===c.z||(e.translation=c.toArray()),0===u.x&&0===u.y&&0===u.z&&1===u.w||(e.rotation=u.toArray()),1===h.x&&1===h.y&&1===h.z||(e.scale=h.toArray()),e}}f.typeName="CVNode",f.text="Transform",f.icon=""},27924:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(31491),s=n(80038),r=n(25864);class o extends s.ZP{constructor(){super(...arguments),this.activeDocument=null}get documentProvider(){return this.getGraphComponent(r.Z)}startObserving(){const e=this.documentProvider;e.on("active-component",this.onActiveDocumentEvent,this),e.activeComponent&&(this.activeDocument=e.activeComponent,this.onActiveDocument(null,e.activeComponent))}stopObserving(){const e=this.documentProvider;e.off("active-component",this.onActiveDocumentEvent,this),e.activeComponent&&(this.activeDocument=null,this.onActiveDocument(e.activeComponent,null))}onActiveDocument(e,t){}onActiveDocumentEvent(e){this.activeDocument=e.next,this.onActiveDocument(e.previous,e.next)}}o.typeName="CVDocumentObserver";class a extends o{constructor(){super(...arguments),this.activeNode=null}get nodeProvider(){return this.getGraphComponent(i.Z)}startObserving(){super.startObserving();const e=this.nodeProvider;e.on("active-node",this.onActiveNodeEvent,this),e.activeNode&&(this.activeNode=e.activeNode,this.onActiveNode(null,e.activeNode))}stopObserving(){const e=this.nodeProvider;e.off("active-node",this.onActiveNodeEvent,this),e.activeNode&&(this.activeNode=null,this.onActiveNode(e.activeNode,null)),super.stopObserving()}onActiveNode(e,t){}onActiveNodeEvent(e){this.activeNode=e.next,this.onActiveNode(e.previous,e.next)}}a.typeName="CVNodeObserver"},31491:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(80038),s=n(92989),r=n(75222),o=n(25864);class a extends s.Z{constructor(e,t){super(e,t),this.outs=this.addOutputs(a.outs),this.scope=s.F.Graph}get documentProvider(){return this.getComponent(o.Z)}create(){super.create(),this.documentProvider.on("active-component",this.onActiveDocument,this)}dispose(){this.documentProvider.off("active-component",this.onActiveDocument,this),super.dispose()}onActiveDocument(e){this.scopedGraph=e.next}onActiveNode(e,t){this.outs.activeNode.setValue(t);const n=this.selection;t?n.nodeContainsSelectedComponent(t)||n.selectNode(t):e&&n.clearSelection()}onScopedNodes(){this.outs.changedNodes.set()}}a.typeName="CVNodeProvider",a.nodeType=r.Z,a.followComponentSelection=!0,a.outs={activeNode:i.V5.Object("Nodes.Active",r.Z),changedNodes:i.V5.Event("Nodes.Changed")}},44661:(e,t,n)=>{"use strict";n.d(t,{LY:()=>i,ZP:()=>f,dT:()=>s});var i,s,r=n(2837),o=n(28097),a=n(92642),l=n(26775),c=n(26629),h=n(63872),d=n(30242);!function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Top=2]="Top",e[e.Bottom=3]="Bottom",e[e.Front=4]="Front",e[e.Back=5]="Back",e[e.None=6]="None"}(i||(i={})),function(e){e[e.Orbit=0]="Orbit",e[e.Zoom=1]="Zoom",e[e.Pan=2]="Pan"}(s||(s={}));const u=[];u[i.Left]=[0,-90,0],u[i.Right]=[0,90,0],u[i.Front]=[0,0,0],u[i.Back]=[0,180,0],u[i.Top]=[-90,0,0],u[i.Bottom]=[90,0,0];const p=function(e,t){for(let n=0,i=e.length;ne.outs.updated.changed))&&e.update(null),this._modelBoundingBox=e.outs.boundingBox.value,(!this._isAutoZooming||this.ins.autoZoom.value&&!this._modelBoundingBox.isEmpty())&&(t.camera&&(n.camera.aspect=t.camera.aspect),t.camera=n.camera,t.zoomExtents(this._modelBoundingBox),n.ins.zoom.set(),this._hasZoomed=!0),this._isAutoZooming=!1}return e.autoRotation.changed&&(this._autoRotationStartTime=e.autoRotation.value?performance.now():null),e.promptActive.changed&&!this._autoRotationStartTime&&(this._initYOrbit=t.orbit.y,this._autoRotationStartTime=e.promptActive.value?performance.now():null),!0}tick(){const e=this.ins,t=this._scene.activeCameraComponent;if(!e.enabled.value||!t)return;const n=this._controller;n.camera=t.camera;const s=t.transform,r=this.changed||e.autoRotation.value||e.promptActive.value;if((e.autoRotation.value||e.promptActive.value)&&this._autoRotationStartTime){const t=performance.now(),i=.001*(t-this._autoRotationStartTime);if(e.autoRotation.value)n.orbit.y=(n.orbit.y+e.autoRotationSpeed.value*i)%360,this._autoRotationStartTime=t;else{const e=this.arManager.shadowRoot.getElementById("prompt");if(e){const t=2,s=1.5,r=2*s,o=.2*s;let a=i%(r+t);a>r&&a{"use strict";n.d(t,{ZP:()=>d});var i=n(80038),s=n(60206),r=n(38112),o=n(84678),a=n(63872),l=n(96180),c=n(11359),h=n(93072);class d extends i.ZP{constructor(){super(...arguments),this.ins=this.addInputs(d.ins),this.outs=this.addOutputs(d.outs)}get settingProperties(){return[this.ins.enabled,this.ins.position]}get snapshotProperties(){return[this.ins.enabled,this.ins.position,this.ins.articleId]}get articles(){return Object.keys(this._articles).map((e=>this._articles[e]))}get activeArticle(){return this.outs.article.value}get assetManager(){return this.getMainComponent(a.Z)}get assetReader(){return this.getMainComponent(l.Z)}get analytics(){return this.getMainComponent(c.Z)}get language(){return this.getGraphComponent(h.Z)}create(){super.create(),this.getGraphComponents(o.Z).forEach((e=>e.on("update",this.updateArticles,this))),this.graph.components.on(o.Z,this.onMetaComponent,this),this.graph.components.on(h.Z,this.onLanguageComponent,this),this.updateArticles()}dispose(){this.graph.components.off(h.Z,this.onLanguageComponent,this),this.graph.components.off(o.Z,this.onMetaComponent,this),this.getGraphComponents(o.Z).forEach((e=>e.off("update",this.updateArticles,this))),super.dispose()}update(e){const t=this.ins,n=this.outs;if(t.enabled.changed,t.articleId.changed){const e=this._articles[t.articleId.value]||null,i=e&&e.article;n.article.setValue(i),n.content.setValue(""),i&&(this.readArticle(i),this.analytics.sendProperty("Reader_ArticleId",i.defaultTitle))}return t.refresh.changed&&this.refreshArticle(),!0}readArticle(e){const t=this.outs,n=e.uri;if(n)return this.assetReader.getText(n).then((e=>this.parseArticle(e,n))).then((e=>t.content.setValue(e))).catch((e=>t.content.setValue(`

Article not found at ${n}

`)));t.content.setValue("

Can't display article: no URI.

")}parseArticle(e,t){e=e.replace(/[\n\r]/g,"");const n=this.assetManager.getAssetBasePath(t);return e=e.replace(/(src=\")(.*?)(\")/g,((e,t,i,s)=>(i.startsWith("/")||i.startsWith("http")||(i=this.assetManager.getAssetUrl(n+i)),t+i+s))),Promise.resolve(e)}onMetaComponent(e){e.add&&e.object.articles.on("update",this.updateArticles,this),e.remove&&e.object.articles.off("update",this.updateArticles,this),this.updateArticles()}onLanguageComponent(e){e.add&&e.object.outs.language.on("value",this.updateLanguage,this),e.remove&&e.object.outs.language.off("value",this.updateLanguage,this)}refreshArticle(){const e=this._articles[this.ins.articleId.value]||null,t=e&&e.article;t&&this.readArticle(t)}updateArticles(){const e=this.getGraphComponents(o.Z),t=this._articles={};e.forEach((e=>{const n=e.articles,i=e.node;n.items.forEach((e=>{t[e.id]={article:e,node:i}}))}))}updateLanguage(){this.ins;this.articles.forEach((e=>{e.article.language=this.language.outs.language.value})),this.ins.refresh.set()}fromData(e){e=e||{},this.ins.setValues({enabled:!!e.enabled,position:s.we[e.position]||s.we.Overlay})}toData(){const e=this.ins;return{enabled:e.enabled.value,position:s.we[e.position.value]||"Overlay"}}}d.typeName="CVReader",d.text="Reader",d.icon="",d.ins={enabled:i.V5.Boolean("Reader.Enabled"),visible:i.V5.Boolean("Reader.Visible",!0),closed:i.V5.Event("Reader.Closed"),refresh:i.V5.Event("Reader.Refresh"),position:i.V5.Enum("Reader.Position",s.we),articleId:i.V5.String("Article.ID"),focus:i.V5.Boolean("Reader.Focus")},d.outs={article:i.V5.Object("Article.Active",r.Z),content:i.V5.String("Article.Content"),count:i.V5.Integer("Article.Count")}},26629:(e,t,n)=>{"use strict";n.d(t,{Z:()=>v});var i=n(19588),s=n(37840),r=n(80038),o=n(1594),a=n(13227),l=n(3388),c=n(15577),h=n(92642),d=n(27884),u=n(79815),p=n(15271),f=n(41282),m=n(76288);const g=new i.P,A=new i.P;class v extends a.Z{constructor(){super(...arguments),this.ins=this.addInputs(v.ins),this.outs=this.addOutputs(v.outs),this.updateCameraHelper=()=>{const e=this.setup.navigation.ins.offset.value,t=g.set(e[0],e[1],e[2]).length();if(!this.system.getComponent("CVStoryApplication",!0)){const e=2.5*Math.max(t,this.outs.boundingRadius.value),n=this.setup.navigation.ins.maxOffset.value;this.setup.navigation.ins.maxOffset.setValue([n[0],n[1],e])}this.cameras.forEach((e=>{if(e.addIns.autoNearFar.value){const n=4*Math.max(t,this.outs.boundingRadius.value),i=Math.min(n/1e3,this.outs.boundingRadius.value/100);(n{e.ins.globalUnits.linkFrom(this.ins.units),this.ins.modelUpdated.linkFrom(e.outs.updated)}))}update(e){const t=this.ins,n=this.outs;return t.units.changed&&(this.updateTransformHierarchy(),this.updateModelBoundingBox(),this.updateLights(),this.updateCameras(),n.units.setValue(t.units.value)),t.modelUpdated.changed&&(this.updateModelBoundingBox(),this.updateLights(),this.updateCameras()),t.sceneTransformed.changed&&this.updateModelBoundingBox(),!0}dispose(){this.graph.components.off(l.Z,this.onModelComponent,this),super.dispose()}fromDocument(e,t){this.ins.units.setValue(o.f_[t.units]||0),this.outs.units.setValue(o.f_[t.units]||0)}toDocument(e,t){t.units=o.f_[this.ins.units.getValidatedValue()]}onModelComponent(e){const t=e.object;e.add&&(t.ins.globalUnits.linkFrom(this.ins.units),this.ins.modelUpdated.linkFrom(t.outs.updated))}updateModelBoundingBox(){const e=this.outs.boundingBox.value;e.makeEmpty(),this.models.forEach((t=>{t.object3D.visible&&e.expandByObject(t.object3D)})),e.getSize(g),g.length()>0?(this.outs.boundingBox.set(),this.outs.boundingRadius.setValue(.5*g.length())):this.outs.boundingRadius.setValue(10)}updateTransformHierarchy(){if(0===this.models.length)return;const{ins:e,outs:t}=this,n=(0,c.Z)(t.units.value,e.units.value),i=this.models[0].object3D.parent.parent;i.position.multiplyScalar(n),i.updateMatrix(),i.updateMatrixWorld(!0),this.models.forEach((e=>{const t=e.object3D.parent;t.position.multiplyScalar(n),t.updateMatrix(),t.updateMatrixWorld(!0)}))}updateLights(){const{ins:e,outs:t}=this,n=this.graph.findNodeByName("Lights");if(n){const i=n.getComponent(h.ZP,!0),s=(0,c.Z)(t.units.value,e.units.value);i.ins.scale.setValue([1,1,1]),i.children.forEach((e=>{const t=e.getComponents(f.f);for(let e of t){if(e instanceof m.Z){g.copy(e.light.position),A.copy(e.light.target.position);const t=A.sub(g).normalize();t.applyEuler(e.transform.object3D.rotation),g.copy(t.negate().multiplyScalar(1.2*this.outs.boundingRadius.value)),g.multiplyScalar(s),e.transform.ins.position.setValue(g.toArray()),g.setScalar(this.outs.boundingRadius.value*s*.2),e.transform.ins.scale.setValue(g.toArray()),e.light.updateMatrix()}e.ins.shadowEnabled.value&&("shadowSize"in e.ins&&e.ins.shadowSize.setValue(2*this.outs.boundingRadius.value),e.light.shadow.camera.far=4*this.outs.boundingRadius.value)}}))}}updateCameras(){this.renderer.views[0]&&this.renderer.views[0].renderer.xr.isPresenting||this.updateCameraHelper()}}v.typeName="CVScene",v.text="Scene",v.icon="hierarchy",v.ins={units:r.V5.Enum("Scene.Units",o.f_,o.f_.cm),modelUpdated:r.V5.Event("Scene.ModelUpdated"),sceneTransformed:r.V5.Event("Scene.Transformed")},v.outs={units:r.V5.Enum("Scene.Units",o.f_,o.f_.cm),boundingBox:r.V5.Object("Models.BoundingBox",s.Z),boundingRadius:r.V5.Number("Models.BoundingRadius")}},79815:(e,t,n)=>{"use strict";n.d(t,{Z:()=>y});var i=n(80038),s=n(92642),r=n(40490),o=n(27643),a=n(5249),l=n(44661),c=n(71507),h=n(97322),d=n(6461),u=n(29767),p=n(63531),f=n(7134),m=n(74572),g=n(24856),A=n(93072),v=n(17467);class y extends i.ZP{constructor(){super(...arguments),this._savedSetupData={},this.ins=this.addInputs(y.ins)}get featureMap(){return this.constructor.featureMap}get transform(){return this.getComponent(s.ZP)}create(){super.create();const e=this.node,t=y.featureMap;for(const n in t)this[n]=e.createComponent(t[n]);this.snapshots=e.createComponent(m.Z)}update(){const e=this.ins;return e.saveState.changed&&this.cacheSetupState(),e.restoreState.changed&&this.restoreSetupState(),!0}fromDocument(e,t,n){const i=e.scenes[t];if(!isFinite(i.setup))throw new Error("setup property missing in node");const s=this._savedSetupData=e.setups[i.setup],r=y.featureMap;for(const e in r){n.set(`scenes/${t}/setup/${e}`,this[e]);const i=s[e];i&&this[e].fromData(i)}}toDocument(e,t,n){const i=this._savedSetupData,s=y.featureMap;for(const e in s)n.set(this[e],`scenes/${t}/setup/${e}`);const r=this.tours.toData();r?i.tours=r:i.tours&&delete i.tours;const o=this.snapshots.toData(n);if(o&&(i.snapshots=o),i){e.setups=e.setups||[];const n=e.setups.length;e.setups.push(i),e.scenes[t].setup=n}}cacheSetupState(){const e=y.featureMap;for(const t in e){const e=this[t].toData();e&&(this._savedSetupData[t]=e)}}restoreSetupState(){const e=this._savedSetupData,t=y.featureMap;for(const n in t){const t=e[n];t&&"tours"!==n&&this[n].fromData(t)}}}y.typeName="CVSetup",y.ins={saveState:i.V5.Event("Setup.SaveState"),restoreState:i.V5.Event("Setup.RestoreState")},y.featureMap={interface:r.Z,reader:a.ZP,viewer:o.Z,navigation:l.ZP,background:c.Z,environment:g.Z,language:A.Z,floor:h.Z,grid:d.Z,tape:u.Z,slicer:p.Z,tours:f.Z,audio:v.Z}},63531:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(37840),s=n(80038),r=n(60206),o=n(26629),a=n(3388);const l=[[-1,0,0,0],[0,-1,0,0],[0,0,-1,0],[1,0,0,0],[0,1,0,0],[0,0,1,0]];class c extends s.ZP{constructor(){super(...arguments),this.ins=this.addInputs(c.ins),this.plane=null,this.axisIndex=-1}get settingProperties(){return[this.ins.enabled,this.ins.color]}get snapshotProperties(){return[this.ins.enabled,this.ins.axis,this.ins.position,this.ins.inverted]}create(){super.create();const e=this.getGraphComponent(o.Z);this.ins.boundingBox.linkFrom(e.outs.boundingBox)}update(e){const t=this.ins;if(t.axis.changed){const e=t.axis.getValidatedValue();e===this.axisIndex?t.inverted.setValue(!t.inverted.value):(t.inverted.setValue(!1),this.axisIndex=e)}if(!t.enabled.value&&!t.enabled.changed)return!1;const n=t.axis.getValidatedValue(),i=t.inverted.value,s=n+(i?3:0),r=this.ins.boundingBox.value;if(!r)return!0;this.plane=l[s];const o=r.min.getComponent(n),c=r.max.getComponent(n),h=1-t.position.value;this.plane[3]=i?h*(c-o)-c:c-h*(c-o);return this.getGraphComponents(a.Z).forEach((e=>{if(e.ins.slicerEnabled.value){e.object3D.traverse((e=>{if(e.isMesh){const t=e.material;t.isUberPBRMaterial&&this.updateMaterial(t)}}))}})),!0}fromData(e){e=e||{},this.ins.setValues({enabled:e.enabled||!1,axis:r.fi[e.axis]||r.fi.X,position:e.position||0,inverted:e.inverted||!1,color:e.color||[0,.61,.87]})}toData(){const e=this.ins;return{enabled:e.enabled.value,axis:r.fi[e.axis.getValidatedValue()],position:e.position.value,inverted:e.inverted.value,color:e.color.value}}updateMaterial(e){const t=this.ins;t.enabled.changed&&(e.enableCutPlane(t.enabled.value),e.needsUpdate=!0),e.cutPlaneDirection.fromArray(this.plane),e.cutPlaneColor.fromArray(t.color.value)}}c.typeName="CVSlicer",c.text="Slicer",c.icon="",c.ins={enabled:s.V5.Boolean("Slice.Enabled"),axis:s.V5.Enum("Slice.Axis",r.fi),position:s.V5.Number("Slice.Position",{min:0,max:1,preset:.5}),inverted:s.V5.Boolean("Slice.Inverted"),color:s.V5.ColorRGB("Slice.Color",[0,.61,.87]),boundingBox:s.V5.Object("Scene.BoundingBox",i.Z)}},74572:(e,t,n)=>{"use strict";n.d(t,{P:()=>i.P,Z:()=>l});var i=n(403),s=n(16967),r=n(79815),o=n(3388),a=n(7134);class l extends i.Z{constructor(){super(...arguments),this.targetFeatures={}}create(){super.create();const e=this.getGraphComponent(r.Z);Object.keys(e.featureMap).forEach((e=>{this.targetFeatures[e]=!1})),this.targetFeatures.models=!1,this.targetFeatures.lights=!1,this.initializeTargetFeatures()}initializeTargetFeatures(){const e=this.targetFeatures;Object.keys(e).forEach((t=>e[t]=!1)),e.navigation=!0,e.reader=!0,e.viewer=!0,this.updateTargets()}updateTargets(){const e=this.targetFeatures,t=this.getGraphComponent(r.Z);Object.keys(e).forEach((n=>{const i=t[n],s=e[n];i&&this.updateComponentTarget(i,s)}));this.getGraphComponents(o.Z).forEach((t=>{this.updateComponentTarget(t.transform,!!e.models),this.updateComponentTarget(t,!!e.models)}));this.getGraphComponents(s.Z).forEach((t=>{this.updateComponentTarget(t.transform,!!e.lights),this.updateComponentTarget(t,!!e.lights)}))}updateComponentTarget(e,t){const n=e.snapshotProperties;n&&n.forEach((e=>{if(!e.schema.event&&"object"!==e.type){const n=this.hasTargetProperty(e);t&&!n?this.addTargetProperty(e):!t&&n&&this.removeTargetProperty(e)}}))}fromData(e,t){this.clear();const n=this.targetFeatures,s=Object.keys(n);e.features?s.forEach((t=>n[t]=e.features.indexOf(t)>=0)):this.initializeTargetFeatures();const r=new Set;e.targets.forEach(((e,n)=>{const i=e.lastIndexOf("/"),s=e.substr(0,i),o=e.substr(i+1),a=t.get(s),l=a?a.ins[o]:null;l?this.addTargetProperty(l):(console.warn(`missing snapshot target property for '${e}'`),r.add(n))})),e.states.forEach((e=>{e.id!==a.Z.sceneSnapshotId&&this.setState({id:e.id,curve:void 0!==e.curve?i.P[e.curve]:i.P.EaseQuad,duration:void 0!==e.duration?e.duration:2,threshold:void 0!==e.threshold?e.threshold:.5,values:e.values.filter(((e,t)=>!r.has(t)))})}))}toData(e){const t=this.targetFeatures,n={features:Object.keys(t).filter((e=>t[e])),targets:this.targets.map((t=>{const n=t.property.group.linkable,i=t.property.key,s=e.get(n);if(!s)throw new Error(`snapshot path not registered for component '${n.displayName}'`);return s+"/"+i})),states:Object.keys(this.states).map((e=>{const t=this.states[e],n={id:t.id,values:t.values};return t.curve!==i.P.EaseQuad&&(n.curve=i.P[t.curve]),2!==t.duration&&(n.duration=t.duration),.5!==t.threshold&&(n.threshold=t.threshold),n}))};return n.targets.length>0&&n.states.length>0?n:null}}l.typeName="CVSnapshots"},31105:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(28110),s=n(2837),r=(n(44466),n(41029));n(91013),n(13301),n(10160);class o extends s.ZP{constructor(e,t){super(e,t),this._annotations={},this._viewports=new Set,this._sprites={},this.object3D=new i.Z,this.object3D.setVisible(!1)}update(e){super.update(e);const t=this.ins,n=this.object3D;return t.visible.changed&&n.setVisible(t.visible.value),!0}tock(){if(this.updated)return!0}postRender(e){const t=e.viewport;this._viewports.has(t)||(t.on("dispose",this.onViewportDispose,this),this._viewports.add(t));this.object3D.render(t.overlay,e.camera)}dispose(){this.object3D.dispose(),this._viewports.forEach((e=>e.off("dispose",this.onViewportDispose,this))),this._viewports.clear(),super.dispose()}addAnnotation(e){this._annotations[e.id]=e,this.createSprite(e),this.changed=!0}removeAnnotation(e){Object.keys(this._annotations);delete this._annotations[e.id],this.removeSprite(e),this.changed=!0}updateAnnotation(e,t){t&&this.updateSprite(e),this.changed=!0}onViewportDispose(e){this.object3D.disposeHTMLElements(e.viewport.overlay)}createSprite(e){this.removeSprite(e);const t=r.Z.createInstance(e);this._sprites[e.id]=t,this.object3D.add(t)}removeSprite(e){const t=this._sprites[e.id];t&&(t.dispose(),this._sprites[e.id]=void 0,this.object3D.remove(t))}updateSprite(e){const t=this._sprites[e.id];t&&t.update()}}o.typeName="CVStaticAnnotationView"},29767:(e,t,n)=>{"use strict";n.d(t,{T:()=>T,Z:()=>P});var i=n(23130),s=n(19588),r=n(29187),o=n(75809),a=n(64026),l=n(93122),c=n(37840),h=n(2837),d=n(6965),u=n(8035),p=n(40693),f=n(35322),m=n(71050);class g extends o.u{constructor(e=[new p.F(0,-.5),new p.F(.5,0),new p.F(0,.5)],t=12,n=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=m.uZ(i,0,2*Math.PI);const r=[],o=[],a=[],l=[],c=[],h=1/t,d=new s.P,u=new p.F,g=new s.P,A=new s.P,v=new s.P;let y=0,b=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:y=e[t+1].x-e[t].x,b=e[t+1].y-e[t].y,g.x=1*b,g.y=-y,g.z=0*b,v.copy(g),g.normalize(),l.push(g.x,g.y,g.z);break;case e.length-1:l.push(v.x,v.y,v.z);break;default:y=e[t+1].x-e[t].x,b=e[t+1].y-e[t].y,g.x=1*b,g.y=-y,g.z=0*b,A.copy(g),g.x+=v.x,g.y+=v.y,g.z+=v.z,g.normalize(),l.push(g.x,g.y,g.z),v.copy(A)}for(let s=0;s<=t;s++){const r=n+s*h*i,p=Math.sin(r),f=Math.cos(r);for(let n=0;n<=e.length-1;n++){d.x=e[n].x*p,d.y=e[n].y,d.z=e[n].x*f,o.push(d.x,d.y,d.z),u.x=s/t,u.y=n/(e.length-1),a.push(u.x,u.y);const i=l[3*n+0]*p,r=l[3*n+1],h=l[3*n+0]*f;c.push(i,r,h)}}for(let n=0;n0)):(this.system.off("pointer-up",this.onPointerUp,this),this.annotationView.ins.visible.setValue(!1))),r.visible.changed)if(r.visible.value){const e=r.startPosition.value,t=r.endPosition.value;e[0]==t[0]&&e[1]==t[1]&&e[2]==t[2]||(n.visible=!0,i.visible=!0,s.visible=!0,this.annotationView.ins.visible.setValue(!0))}else this.annotationView.ins.visible.setValue(!1);if(r.globalUnits.changed&&this.updateUnitScale(),r.startPosition.changed||r.startDirection.changed){n.position.fromArray(r.startPosition.value),S.fromArray(r.startDirection.value),n.quaternion.setFromUnitVectors(I,S),n.updateMatrix();const e=t.attributes.position.array;e[0]=n.position.x,e[1]=n.position.y,e[2]=n.position.z,t.attributes.position.needsUpdate=!0,this.annotationView.ins.visible.setValue(!1)}if(r.endPosition.changed||r.endDirection.changed){i.position.fromArray(r.endPosition.value),S.fromArray(r.endDirection.value),i.quaternion.setFromUnitVectors(I,S),i.updateMatrix();const e=t.attributes.position.array;e[3]=i.position.x,e[4]=i.position.y,e[5]=i.position.z,t.attributes.position.needsUpdate=!0,S.fromArray(r.startPosition.value),M.fromArray(r.endPosition.value);const n=S.distanceTo(M);this.outs.distance.setValue(n);this.label.data.position=[(e[0]+e[3])/2,(e[1]+e[4])/2,(e[2]+e[5])/2];const s=this.ins.globalUnits.getOptionText();this.label.title=n.toFixed(2)+" "+s,this.annotationView.updateAnnotation(this.label,!0),n>0&&this.ins.visible.value&&this.annotationView.ins.visible.setValue(!0)}return!0}fromData(e){this.ins.copyValues({visible:e.enabled})}toData(){return{enabled:this.ins.visible.cloneValue()}}onPointerUp(e){if(e.isDragging||!e.component||!e.component.is(v.Z))return;const t=e.component,n=(0,x.k)(t.object3D,e.object3D),i=t.localBoundingBox.clone().applyMatrix4(n),s=e.object3D.matrixWorld;C.getNormalMatrix(s);const r=e.view.pickPosition(e,i).applyMatrix4(s),o=e.view.pickNormal(e).applyMatrix3(C).normalize(),{startPin:a,endPin:l,line:c,ins:h,outs:d}=this;d.state.value===T.SetStart?(r.toArray(h.startPosition.value),o.toArray(h.startDirection.value),h.startPosition.set(),h.startDirection.set(),a.visible=!0,l.visible=!1,c.visible=!1,d.state.setValue(T.SetEnd)):(r.toArray(h.endPosition.value),o.toArray(h.endDirection.value),h.endPosition.set(),h.endDirection.set(),a.visible=!0,l.visible=!0,c.visible=!0,d.state.setValue(T.SetStart))}updateUnitScale(){const e=this.ins,t=e.localUnits.getValidatedValue(),n=e.globalUnits.getValidatedValue();this.outs.unitScale.setValue((0,_.Z)(t,n)),S.fromArray(e.startPosition.value),e.startPosition.setValue(S.multiplyScalar(this.outs.unitScale.value).toArray()),S.fromArray(e.endPosition.value),e.endPosition.setValue(S.multiplyScalar(this.outs.unitScale.value).toArray()),e.localUnits.setValue(n)}}P.typeName="CVTape",P.text="Tape",P.icon="",P.tapeIns={startPosition:h.V5.Vector3("Start.Position"),startDirection:h.V5.Vector3("Start.Direction"),endPosition:h.V5.Vector3("End.Position"),endDirection:h.V5.Vector3("End.Direction"),boundingBox:h.V5.Object("Scene.BoundingBox",c.Z),globalUnits:h.V5.Enum("Model.GlobalUnits",b.f_,b.f_.cm),localUnits:h.V5.Enum("Model.LocalUnits",b.f_,b.f_.cm),enabled:h.V5.Boolean("Tape.Enabled",!1)},P.tapeOuts={state:h.V5.Enum("Tape.State",T),distance:h.V5.Number("Tape.Distance"),unitScale:h.V5.Number("UnitScale",{preset:1,precision:5})}},97008:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>o.Mo,V5:()=>i.V5,ZP:()=>l,dy:()=>o.dy,v5:()=>c});var i=n(80038),s=n(27924),r=n(11359),o=n(11598),a=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};class l extends s.Z{constructor(){super(...arguments),this.ins=this.addInputs(l.toolIns),this.outs=this.addOutputs(l.toolOuts),this._isActiveTool=!1}get isActiveTool(){return this._isActiveTool}dispose(){this._isActiveTool&&this.deactivateTool(),super.dispose()}createView(){throw new Error("must override")}activateTool(){this._isActiveTool=!0,this.startObserving()}deactivateTool(){this.stopObserving(),this._isActiveTool=!1}}l.typeName="CVTool",l.toolIns={},l.toolOuts={};class c extends o.ZP{constructor(e){super(e.system),this.tool=null,this.needsFocus=!1,this.tool=e}get analytics(){return this.system.getMainComponent(r.Z)}firstConnected(){this.classList.add("sv-group","sv-tool-view"),this.needsFocus=!0}connected(){super.connected(),this.tool.on("update",this.onUpdate,this)}disconnected(){this.tool.off("update",this.onUpdate,this),super.disconnected()}updated(e){super.updated(e),this.needsFocus&&(this.setFocus(),this.needsFocus=!1)}setFocus(){}}a([(0,o.Cb)({attribute:!1})],c.prototype,"tool",void 0)},22040:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(80038),s=n(63833),r=n(97008),o=n(11359);class a extends s.Z{constructor(e,t){super(e,t),this.ins=this.addInputs(a.ins),this.scope=s.$.Node}get analytics(){return this.getMainComponent(o.Z)}update(e){return this.ins.visible.changed,!0}activateComponent(e){e.activateTool(),this.analytics.sendProperty("Tools_ActiveTool",e.text)}deactivateComponent(e){e.deactivateTool()}onActiveComponent(e,t){}}a.typeName="CVToolProvider",a.isSystemSingleton=!0,a.componentType=r.ZP,a.ins={visible:i.V5.Boolean("Tools.Visible"),closed:i.V5.Event("Tools.Closed")}},7134:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(80038),s=n(1594),r=n(74572),o=n(11359),a=n(93072),l=n(79815);class c extends i.ZP{constructor(){super(...arguments),this.ins=this.addInputs(c.ins),this.outs=this.addOutputs(c.outs),this._tours=[]}get analytics(){return this.getMainComponent(o.Z)}get language(){return this.getGraphComponent(a.Z)}get setup(){return this.getGraphComponent(l.Z)}get snapshots(){return this.getComponent(r.Z)}get tours(){return this._tours}get activeSteps(){const e=this.activeTour;return e?e.steps:null}get activeTour(){return this._tours[this.outs.tourIndex.value]}get activeStep(){const e=this.activeTour;return e?e.steps[this.outs.stepIndex.value]:null}get title(){const e=this.activeTour;return 0===Object.keys(e.titles).length&&(e.titles[s.k$]=e.title),e.titles[s.PD[this.language.outs.language.value]]||"undefined"}set title(e){this.activeTour.titles[s.PD[this.language.outs.language.value]]=e}get lead(){const e=this.activeTour;return 0===Object.keys(e.leads).length&&(e.leads[s.k$]=e.lead),e.leads[s.PD[this.language.outs.language.value]]||""}set lead(e){this.activeTour.leads[s.PD[this.language.outs.language.value]]=e}get taglist(){const e=this.activeTour;return 0===Object.keys(e.taglist).length&&e.tags.length>0&&(e.taglist[s.k$]=e.tags),e.taglist[s.PD[this.language.outs.language.value]]||[]}set taglist(e){this.activeTour.taglist[s.PD[this.language.outs.language.value]]=e}get stepTitle(){const e=this.activeStep;return e?(0===Object.keys(e.titles).length&&(e.titles[s.k$]=e.title),e.titles[s.PD[this.language.outs.language.value]]||"undefined"):null}set stepTitle(e){const t=this.activeStep;t&&(t.titles[s.PD[this.language.outs.language.value]]=e)}create(){super.create(),this.language.outs.language.on("value",this.update,this)}dispose(){this.language.outs.language.off("value",this.update,this),super.dispose()}update(e){const{ins:t,outs:n}=this,i=this._tours,s=this.snapshots,o=this.setup.navigation;if(t.enabled.changed){if(!t.enabled.value)return n.tourIndex.set(),this.normalizeViewOrbit(c.sceneSnapshotId),s.tweenTo(c.sceneSnapshotId,e.secondsElapsed),s.deleteState(c.sceneSnapshotId),!0;{const e={id:c.sceneSnapshotId,curve:r.P.EaseOutQuad,duration:1,threshold:0,values:s.getCurrentValues()};s.setState(e)}}const a=Math.min(i.length-1,Math.max(-1,t.tourIndex.value)),l=i[a],h=l?l.steps.length:0;n.stepCount.setValue(h);let d=-1;if((t.tourIndex.changed||t.enabled.changed)&&(a!==n.tourIndex.value&&(d=0),n.tourIndex.setValue(a),n.tourTitle.setValue(l?this.title:""),n.tourLead.setValue(l?this.lead:"")),0===h)return n.stepIndex.setValue(-1),n.stepTitle.setValue(""),!0;let u=!0;if(t.enabled.changed&&(d=n.stepIndex.value),t.stepIndex.changed&&(d=Math.min(l.steps.length-1,Math.max(0,t.stepIndex.value)),u=!1),t.first.changed&&(d=0),t.next.changed&&(d=n.stepIndex.value+1,d>=h&&(n.ending.setValue(!0),n.tourIndex.setValue(-1),n.tourTitle.setValue(""),n.tourLead.setValue(""),n.stepIndex.set(),d=-1)),t.previous.changed&&(d=(n.stepIndex.value+h-1)%h),0===d&&this.normalizeViewOrbit(l.steps[0].id),d>=0){o.setChanged(!0);const e=l.steps[d];n.stepIndex.setValue(d),n.stepTitle.setValue(this.stepTitle||"undefined"),s.ins.id.setValue(e.id),u?s.ins.tween.set():s.ins.recall.set()}return!0}fromData(e){this._tours=e.map((e=>({title:e.title,titles:e.titles||{},steps:e.steps.map((e=>({title:e.title,titles:e.titles||{},id:e.id}))),lead:e.lead||"",leads:e.leads||{},tags:e.tags||[],taglist:e.taglist||{}}))),this._tours.forEach((e=>{Object.keys(e.titles).forEach((e=>{this.language.addLanguage(s.PD[e])})),e.steps.forEach((e=>{0==Object.keys(e.titles).length&&(e.titles[s.k$]=e.title||null)}))})),this.ins.tourIndex.setValue(-1),this.outs.count.setValue(this._tours.length)}toData(){return 0===this._tours.length?null:this._tours.map((e=>{const t={steps:e.steps.map((e=>{const t={};return t.id=e.id,Object.keys(e.titles).length>0?t.titles=e.titles:e.title&&(t.title=e.title),t}))};return Object.keys(e.titles).length>0?t.titles=e.titles:e.title&&(t.title=e.title),Object.keys(e.leads).length>0?t.leads=e.leads:e.lead&&(t.lead=e.lead),Object.keys(e.taglist).length>0?t.taglist=e.taglist:e.tags.length>0&&(t.tags=e.tags),t}))}normalizeViewOrbit(e){const t=this.snapshots.getTargetProperties().findIndex((e=>"Orbit"==e.name)),n=this.snapshots.getState(e),i=this.snapshots.getCurrentValues()[t];n&&i.forEach(((e,i)=>{const s=Math.round((n.values[t][i]-e)/360);this.snapshots.getTargetProperties()[t].value[i]+=360*s}))}}c.typeName="CVTours",c.sceneSnapshotId="scene-default",c.ins={enabled:i.V5.Boolean("Tours.Enabled"),tourIndex:i.V5.Integer("Tours.Index",-1),closed:i.V5.Event("Tours.Closed"),stepIndex:i.V5.Integer("Step.Index"),next:i.V5.Event("Step.Next"),previous:i.V5.Event("Step.Previous"),first:i.V5.Event("Step.First")},c.outs={count:i.V5.Integer("Tours.Count"),tourIndex:i.V5.Integer("Tour.Index",-1),tourTitle:i.V5.String("Tour.Title"),tourLead:i.V5.String("Tour.Lead"),stepCount:i.V5.Integer("Tour.Steps"),ending:i.V5.Boolean("Tour.Ending"),stepIndex:i.V5.Integer("Step.Index"),stepTitle:i.V5.String("Step.Title")}},27643:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var i=n(75544),s=n(80038),r=n(15271),o=n(60206),a=n(43875),l=n(3388),c=n(51462),h=n(11359),d=n(93072),u=n(30242),p=n(53310),f=n(79815);class m extends s.ZP{constructor(){super(...arguments),this._rootElement=null,this._needsAnnoFocus=!1,this.ins=this.addInputs(m.ins),this.outs=this.addOutputs(m.outs)}get settingProperties(){return[this.ins.annotationsVisible,this.ins.activeTags,this.ins.sortedTags,this.ins.radioTags,this.ins.shader,this.ins.toneMapping,this.ins.exposure,this.ins.gamma,this.ins.isWallMountAR,this.ins.arScale]}get snapshotProperties(){return[this.ins.annotationsVisible,this.ins.activeAnnotation,this.ins.activeTags,this.ins.shader,this.ins.exposure]}get analytics(){return this.getMainComponent(h.Z)}get renderer(){return this.getMainComponent(r.Z)}get ar(){return this.getMainComponent(u.Z)}get rootElement(){return this._rootElement}set rootElement(e){this._rootElement=e}create(){super.create(),this.graph.components.on(l.Z,this.onModelComponent,this),this.graph.components.on(c.Z,this.onAnnotationsComponent,this),this.graph.components.on(d.Z,this.onLanguageComponent,this),this.ar.ins.wallMount.linkFrom(this.ins.isWallMountAR),this.ar.ins.arScale.linkFrom(this.ins.arScale)}dispose(){this.graph.components.off(l.Z,this.onModelComponent,this),this.graph.components.off(c.Z,this.onAnnotationsComponent,this),this.graph.components.off(d.Z,this.onLanguageComponent,this),super.dispose()}update(e){const t=this.ins;if(t.shader.changed){const e=t.shader.getValidatedValue();this.getGraphComponents(l.Z).forEach((t=>t.ins.shader.setValue(e)))}if(t.exposure.changed&&this.renderer.ins.exposure.setValue(t.exposure.value),t.toneMapping.changed){this.renderer.views.forEach((e=>e.renderer.toneMapping=t.toneMapping.value?i.LY2:i.uL9));const e=this.renderer.activeScene;e&&e.traverse((e=>{const t=e;t.isMesh&&(Array.isArray(t.material)?t.material.forEach((e=>e.needsUpdate=!0)):t.material.needsUpdate=!0)}))}if(t.gamma.changed,t.quality.changed){const e=t.quality.getValidatedValue();this.getGraphComponents(l.Z).forEach((t=>t.ins.quality.setValue(e)))}if(t.activeAnnotation.changed){const e=t.activeAnnotation.value;this.getGraphComponents(c.Z).forEach((t=>t.setActiveAnnotationById(e)))}if(t.annotationExit.changed&&t.annotationsVisible.setValue(!1),t.annotationsVisible.changed){const e=t.annotationsVisible.value;this.getGraphComponents(c.Z).forEach((t=>t.ins.visible.setValue(e)));const n=this.getGraphComponent(f.Z);if(n){const e=n.tours.ins;this._needsAnnoFocus=t.annotationsVisible.value&&!e.enabled.value}}if(t.activeTags.changed){const e=t.activeTags.value;this.getGraphComponents(c.Z).forEach((t=>t.ins.activeTags.setValue(e))),this.getGraphComponents(l.Z).forEach((t=>t.ins.activeTags.setValue(e)))}return t.sortedTags.changed&&this.refreshTagCloud(),!0}tock(){if(this._needsAnnoFocus){let e=null;if(this.ins.sortedTags.value.length>0){e=this.rootElement.shadowRoot.querySelector(".sv-tag-buttons").getElementsByClassName("ff-button")[0]}else{e=this.rootElement.shadowRoot.querySelector("ff-viewport-overlay").querySelector('[tabindex="0"]')}e&&e.focus(),this._needsAnnoFocus=!1}return!1}fromData(e){const t=this.ins;t.copyValues({shader:o.pH[e.shader]||o.pH.Default,exposure:void 0!==e.exposure?e.exposure:t.exposure.schema.preset,toneMapping:e.toneMapping||!1,gamma:void 0!==e.gamma?e.gamma:t.gamma.schema.preset,isWallMountAR:e.isWallMountAR||!1,arScale:e.arScale||1,annotationsVisible:!!e.annotationsVisible,activeTags:e.activeTags||"",sortedTags:e.sortedTags||"",radioTags:void 0!==e.radioTags?!!e.radioTags:t.radioTags.schema.preset})}toData(){const e=this.ins,t={shader:o.pH[e.shader.value],exposure:e.exposure.value,toneMapping:e.toneMapping.value,gamma:e.gamma.value,isWallMountAR:e.isWallMountAR.value,arScale:e.arScale.value};return e.annotationsVisible.value&&(t.annotationsVisible=!0),e.activeTags.value&&(t.activeTags=e.activeTags.value),e.sortedTags.value&&(t.sortedTags=e.sortedTags.value),e.radioTags.value&&(t.radioTags=e.radioTags.value),t}refreshTagCloud(){const e=new Set;this.getGraphComponents(l.Z).forEach((t=>{t.ins.tags.value.split(",").map((e=>e.trim())).filter((e=>e)).forEach((t=>e.add(t)))}));this.getGraphComponents(c.Z).forEach((t=>{t.getAnnotations().forEach((t=>{t.tags.forEach((t=>{e.add(t)}))}))}));const t=Array.from(e),n=this.ins.sortedTags.value.split(",").map((e=>e.trim())).filter((e=>e));t.sort(((e,t)=>{const i=n.indexOf(e),s=n.indexOf(t);return is?1:0})),this.outs.tagCloud.setValue(t.join(", ")),this.ins.activeTags.set(),this.ins.annotationsVisible.set()}onAnnotationClick(e){const t=e.annotation?e.annotation.id:"";this.ins.activeAnnotation.setValue(t),this.rootElement.dispatchEvent(new CustomEvent("annotation-active",{detail:t}))}onModelComponent(e){const t=e.object;e.add?(t.on("tag-update",this.refreshTagCloud,this),t.on("model-load",this.onModelLoad,this)):e.remove&&(t.off("tag-update",this.refreshTagCloud,this),t.off("model-load",this.onModelLoad,this))}onAnnotationsComponent(e){const t=e.object;e.add?(t.on("tag-update",this.refreshTagCloud,this),t.on("active-tag-update",this.focusTags,this),t.on("click",this.onAnnotationClick,this),t.ins.visible.setValue(this.ins.annotationsVisible.value)):e.remove&&(t.off("tag-update",this.refreshTagCloud,this),t.off("active-tag-update",this.focusTags,this),t.off("click",this.onAnnotationClick,this))}onLanguageComponent(e){const t=e.object;e.add?t.on("tag-update",this.refreshTagCloud,this):e.remove&&t.off("tag-update",this.refreshTagCloud,this)}onModelLoad(e){this.rootElement.dispatchEvent(new CustomEvent("model-load",{detail:a.$l[e.quality]})),this.refreshTagCloud()}focusTags(){const e=this.getGraphComponent(f.Z);if(e&&e.tours.ins.enabled.value)return;const t=this.rootElement.shadowRoot.querySelector("ff-viewport-overlay"),n=(0,p.G)(t);n.length>0&&n[0].focus()}}m.typeName="CVViewer",m.text="Viewer",m.icon="",m.ins={annotationsVisible:s.V5.Boolean("Annotations.Visible"),annotationExit:s.V5.Event("Annotations.Exit"),activeAnnotation:s.V5.String("Annotations.ActiveId"),activeTags:s.V5.String("Tags.Active"),sortedTags:s.V5.String("Tags.Sorted"),radioTags:s.V5.Boolean("Tags.Radio"),shader:s.V5.Enum("Renderer.Shader",o.pH),toneMapping:s.V5.Boolean("Renderer.ToneMapping",!1),exposure:s.V5.Number("Renderer.Exposure",1),gamma:s.V5.Number("Renderer.Gamma",2),quality:s.V5.Enum("Models.Quality",a.$l,a.$l.High),isWallMountAR:s.V5.Boolean("AR.IsWallMount",!1),arScale:s.V5.Number("AR.Scale",1)},m.outs={tagCloud:s.V5.String("Tags.Cloud")}},53414:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(76288),s=n(16967);class r extends i.Z{get settingProperties(){return[this.ins.color,this.ins.intensity,this.ins.shadowEnabled,this.ins.shadowSize,this.ins.shadowResolution,this.ins.shadowBlur]}get snapshotProperties(){return[this.ins.color,this.ins.intensity]}dispose(){this.ins.shadowEnabled.value&&this.light.shadow.map&&this.light.shadow.map.dispose(),super.dispose()}fromDocument(e,t){if(!isFinite(t.light))throw new Error("light property missing in node");const n=e.lights[t.light],i=this.ins;if("directional"!==n.type)throw new Error("light type mismatch: not a directional light");return i.copyValues({color:void 0!==n.color?n.color:i.color.schema.preset,intensity:void 0!==n.intensity?n.intensity:i.intensity.schema.preset,position:i.position.schema.preset,target:i.target.schema.preset,shadowEnabled:n.shadowEnabled||!1,shadowSize:void 0!==n.shadowSize?n.shadowSize:i.shadowSize.schema.preset,shadowResolution:void 0!==n.shadowResolution?s.B[n.shadowResolution]||0:i.shadowResolution.schema.preset,shadowBlur:void 0!==n.shadowBlur?n.shadowBlur:i.shadowBlur.schema.preset}),t.light}toDocument(e,t){const n=this.ins,i={color:n.color.cloneValue(),intensity:n.intensity.value};i.type=r.type,n.shadowEnabled.value&&(i.shadowEnabled=!0,n.shadowSize.isDefault()||(i.shadowSize=n.shadowSize.value),n.shadowBlur.isDefault()||(i.shadowBlur=n.shadowBlur.value),n.shadowResolution.isDefault()||(i.shadowResolution=s.B[n.shadowResolution.value])),e.lights=e.lights||[];const o=e.lights.length;return e.lights.push(i),o}}r.typeName="CVDirectionalLight",r.type="directional",r.text="Directional Light",r.icon="sun"},41282:(e,t,n)=>{"use strict";n.d(t,{f:()=>s.Z});var i,s=n(16967);!function(e){e[e.directional=0]="directional",e[e.point=1]="point",e[e.spot=2]="spot",e[e.ambient=3]="ambient",e[e.hemisphere=4]="hemisphere",e[e.rect=5]="rect"}(i||(i={}))},44466:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(2627),s=n(41029),r=n(1594);class o extends i.Z{constructor(){super(...arguments),this._language=r.PD.EN,this._leadChanged=!1}get title(){return 0===Object.keys(this.data.titles).length&&(this.data.titles[r.k$]=this.data.title),this.data.titles[r.PD[this.language]]||"undefined"}set title(e){this.data.titles[r.PD[this.language]]=e,this.update()}get lead(){return 0===Object.keys(this.data.leads).length&&(this.data.leads[r.k$]=this.data.lead),this.data.leads[r.PD[this.language]]||""}set lead(e){this.data.leads[r.PD[this.language]]=e,this.update()}get tags(){return 0===Object.keys(this.data.taglist).length&&this.data.tags.length>0&&(this.data.taglist[r.k$]=this.data.tags),this.data.taglist[r.PD[this.language]]||[]}set tags(e){this.data.taglist[r.PD[this.language]]=e,this.update()}get language(){return this._language}set language(e){this._language=e}get imageCredit(){return this.data.imageCredit[r.PD[this.language]]||""}set imageCredit(e){this.data.imageCredit[r.PD[this.language]]=e,this.update()}get imageAltText(){return this.data.imageAltText[r.PD[this.language]]||""}set imageAltText(e){this.data.imageAltText[r.PD[this.language]]=e,this.update()}get leadChanged(){return this._leadChanged}set leadChanged(e){this._leadChanged=e}static fromJSON(e){return new o(e)}init(){return{id:i.Z.generateId(),title:"New Annotation",titles:{},lead:"",leads:{},marker:"",tags:[],taglist:{},articleId:"",imageUri:"",imageCredit:{},imageAltText:{},audioId:"",viewId:"",style:s.Z.defaultTypeName,visible:!0,expanded:!1,position:null,direction:null,scale:1,offset:0,tilt:0,azimuth:0,color:[0,.61,.87],zoneIndex:-1}}deflate(e,t){t.id=e.id,Object.keys(this.data.titles).length>0?(t.titles={},Object.keys(this.data.titles).forEach((n=>{t.titles[n]=e.titles[n]}))):e.title&&(t.title=e.title),Object.keys(this.data.leads).length>0?(t.leads={},Object.keys(this.data.leads).forEach((n=>{t.leads[n]=e.leads[n]}))):e.lead&&(t.lead=e.lead),e.marker&&(t.marker=e.marker),Object.keys(this.data.taglist).length>0?(t.taglist={},Object.keys(this.data.taglist).forEach((n=>{t.taglist[n]=e.taglist[n].slice()}))):e.tags.length>0&&(t.tags=e.tags),e.articleId&&(t.articleId=e.articleId),e.imageUri&&(t.imageUri=e.imageUri),e.imageUri&&(t.imageUri=e.imageUri),Object.keys(this.data.imageCredit).length>0&&(t.imageCredit={},Object.keys(this.data.imageCredit).forEach((n=>{t.imageCredit[n]=e.imageCredit[n]}))),Object.keys(this.data.imageAltText).length>0&&(t.imageAltText={},Object.keys(this.data.imageAltText).forEach((n=>{t.imageAltText[n]=e.imageAltText[n]}))),e.audioId&&(t.audioId=e.audioId),e.viewId&&(t.viewId=e.viewId),e.style!==s.Z.defaultTypeName&&(t.style=e.style),!1===e.visible&&(t.visible=e.visible),e.position&&(t.position=e.position.slice()),e.direction&&(t.direction=e.direction.slice()),1!==e.scale&&(t.scale=e.scale),0!==e.offset&&(t.offset=e.offset),0!==e.tilt&&(t.tilt=e.tilt),0!==e.azimuth&&(t.azimuth=e.azimuth);const n=e.color;return!n||0===n[0]&&.61===n[1]&&.87===n[2]||(t.color=n.slice()),e.zoneIndex>-1&&(t.zoneIndex=e.zoneIndex),e}inflate(e,t){t.id=e.id,t.title=e.title||"",t.titles=e.titles||{},t.lead=e.lead||"",t.leads=e.leads||{},t.marker=e.marker||"",t.tags=e.tags||[],t.taglist=e.taglist||{},t.articleId=e.articleId||"",t.imageUri=e.imageUri||"",t.imageCredit=e.imageCredit||{},t.imageAltText=e.imageAltText||{},t.audioId=e.audioId||"",t.viewId=e.viewId||"",t.style=e.style||s.Z.defaultTypeName,t.visible=void 0===e.visible||e.visible,t.expanded=!1,t.position=e.position.slice(),t.direction=e.direction.slice(),t.scale=void 0!==e.scale?e.scale:1,t.offset=e.offset||0,t.tilt=e.tilt||0,t.azimuth=e.azimuth||0,t.color=e.color||o.defaultColor.slice(),t.zoneIndex=void 0!==e.zoneIndex?e.zoneIndex:-1}}o.defaultColor=[0,.61,.87]},38112:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(2627),s=n(1594);class r extends i.Z{constructor(){super(...arguments),this._language=s.PD.EN}static fromJSON(e){return new r(e)}toString(){return this.title}get title(){return 0===Object.keys(this.data.titles).length&&(this.data.titles[s.k$]=this.data.title),this.data.titles[s.PD[this.language]]||"undefined"}set title(e){this.data.titles[s.PD[this.language]]=e,this.update()}get defaultTitle(){return 0===Object.keys(this.data.titles).length&&(this.data.titles[s.k$]=this.data.title),this.data.titles[s.k$]||"undefined"}get uri(){return 0===Object.keys(this.data.uris).length&&(this.data.uris[s.k$]=this.data.uri),this.data.uris[s.PD[this.language]]}set uri(e){this.data.uris[s.PD[this.language]]=e,this.update()}get lead(){return 0===Object.keys(this.data.leads).length&&(this.data.leads[s.k$]=this.data.lead),this.data.leads[s.PD[this.language]]||""}set lead(e){this.data.leads[s.PD[this.language]]=e,this.update()}get tags(){return 0===Object.keys(this.data.taglist).length&&this.data.tags.length>0&&(this.data.taglist[s.k$]=this.data.tags),this.data.taglist[s.PD[this.language]]||[]}set tags(e){this.data.taglist[s.PD[this.language]]=e,this.update()}get language(){return this._language}set language(e){this._language=e}init(){return{id:i.Z.generateId(),title:"New Article",titles:{},lead:"",leads:{},tags:[],taglist:{},uri:"",uris:{},mimeType:"",thumbnailUri:""}}deflate(e,t){t.id=e.id,Object.keys(this.data.uris).length>0?(t.uris={},Object.keys(this.data.uris).forEach((n=>{t.uris[n]=e.uris[n]}))):e.uri&&(t.uri=e.uri),Object.keys(this.data.titles).length>0?(t.titles={},Object.keys(this.data.titles).forEach((n=>{t.titles[n]=e.titles[n]}))):e.title&&(t.title=e.title),Object.keys(this.data.leads).length>0?(t.leads={},Object.keys(this.data.leads).forEach((n=>{t.leads[n]=e.leads[n]}))):e.lead&&(t.lead=e.lead),Object.keys(this.data.taglist).length>0?(t.taglist={},Object.keys(this.data.taglist).forEach((n=>{t.taglist[n]=e.taglist[n].slice()}))):e.tags.length>0&&(t.tags=e.tags.slice()),e.mimeType&&(t.mimeType=e.mimeType),e.thumbnailUri&&(t.thumbnailUri=e.thumbnailUri)}inflate(e,t){t.id=e.id,t.uri=e.uri||"",t.uris=e.uris||{},t.title=e.title||"",t.titles=e.titles||{},t.lead=e.lead||"",t.leads=e.leads||{},t.tags=e.tags||[],t.taglist=e.taglist||{},t.mimeType=e.mimeType||"",t.thumbnailUri=e.thumbnailUri||""}}},38642:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>r,hH:()=>s.hH,xd:()=>s.xd});var i=n(2627),s=n(43875);class r extends i.Z{setModel(e){this.data.uri=e,this.data.type=s.hH.Model,this.data.mimeType=this.guessAssetMimeType()}setGeometry(e){this.data.uri=e,this.data.type=s.hH.Geometry,this.data.mimeType=this.guessAssetMimeType()}setTexture(e,t){this.data.uri=e,this.data.type=s.hH.Image,this.data.mimeType=this.guessAssetMimeType(),this.data.mapType=t}isValid(){return!!this.data.uri&&void 0!==this.data.type}toString(){const e=this.data;return`Asset - type: '${s.hH[e.type]}', uri: '${e.uri}', mime type: '${e.mimeType||"(not set)"}'`}init(){return{uri:"",mimeType:"",type:void 0,mapType:void 0,byteSize:0,numFaces:0,numVertices:0,imageSize:0}}deflate(e,t){t.uri=e.uri,t.type=s.hH[e.type],e.mimeType&&(t.mimeType=e.mimeType),void 0!==e.mapType&&(t.mapType=s.xd[e.mapType]),e.byteSize>0&&(t.byteSize=e.byteSize),e.type!==s.hH.Model&&e.type!==s.hH.Geometry||e.numFaces>0&&(t.numFaces=e.numFaces),e.type!==s.hH.Model&&e.type!==s.hH.Image&&e.type!==s.hH.Texture||e.imageSize>0&&(t.imageSize=e.imageSize)}inflate(e,t){t.uri=e.uri,t.mimeType=e.mimeType||"",t.type=s.hH[e.type],t.mapType=s.xd[e.mapType],t.byteSize=e.byteSize||0,t.numFaces=e.numFaces||0,t.imageSize=e.imageSize||0,void 0===t.type&&(t.type=this.guessAssetType(),void 0===t.type&&console.warn(`failed to determine asset type from asset: ${t.uri}`))}guessAssetType(){const e=this.data;if(void 0!==e.type&&s.hH[e.type])return e.type;if(e.mimeType){if(e.mimeType===r.mimeType.gltfJson||e.mimeType===r.mimeType.gltfBinary)return s.hH.Model;if(e.mimeType===r.mimeType.imageJpeg||e.mimeType===r.mimeType.imagePng)return s.hH.Image}const t=e.uri.split(".").pop().toLowerCase();return"gltf"===t||"glb"===t?s.hH.Model:"obj"===t||"ply"===t?s.hH.Geometry:"jpg"===t||"png"===t?s.hH.Image:void 0}guessAssetMimeType(){const e=this.data;if(e.mimeType)return e.mimeType;const t=e.uri.split(".").pop().toLowerCase();return"gltf"===t?r.mimeType.gltfJson:"glb"===t?r.mimeType.gltfBinary:"jpg"===t?r.mimeType.imageJpeg:"png"===t?r.mimeType.imagePng:""}}r.mimeType={gltfJson:"model/gltf+json",gltfBinary:"model/gltf-binary",imageJpeg:"image/jpeg",imagePng:"image/png"}},37117:(e,t,n)=>{"use strict";n.d(t,{$l:()=>o.$l,ZP:()=>c,_U:()=>o._U,hH:()=>l.hH});var i=n(8035),s=n(79961),r=n(2627),o=n(43875),a=n(10290),l=n(38642);class c extends r.Z{constructor(){super(...arguments),this.model=null}static fromJSON(e){return new c(e)}dispose(){this.unload(),super.dispose()}load(e){if(this.data.usage!==o._U.Web3D)throw new Error("can't load, not a Web3D derivative");const t=this.findAsset(l.hH.Model);if(t)return e.getModel(t.data.uri).then((e=>(this.model&&(0,s.D7)(this.model),this.model=e,e)));const n=this.findAsset(l.hH.Geometry),r=this.findAssets(l.hH.Image);return n?e.getGeometry(n.data.uri).then((t=>(this.model=new i.K(t,new a.Z),Promise.all(r.map((t=>e.getTexture(t.data.uri)))).catch((e=>(console.warn("failed to load texture files"),[])))))).then((e=>{const t=this.model.material;return this.assignTextures(r,e,t),t.map||(t.color.setScalar(.5),t.roughness=.8,t.metalness=0),this.model})):void 0}unload(){this.model&&((0,s.D7)(this.model),this.model=null)}createAsset(e,t){const n=new l.ZP;return n.data.type=e,n.data.uri=t,this.addAsset(n),n}addAsset(e){if(!e.data.uri)throw new Error("uri must be specified");this.data.assets.push(e),this.update()}removeAsset(e){const t=this.data.assets.indexOf(e);t>=0&&this.data.assets.splice(t,1)}findAsset(e){return this.data.assets.find((t=>t.data.type===e))}findAssets(e){return this.data.assets.filter((t=>t.data.type===e))}toString(e=!1){const t=this.data;return e?`Derivative - usage: '${o._U[t.usage]}', quality: '${o.$l[t.quality]}'\n `+t.assets.map((e=>e.toString())).join("\n "):`Derivative - usage: '${o._U[t.usage]}', quality: '${o.$l[t.quality]}', #assets: ${t.assets.length})`}init(){return{usage:o._U.Web3D,quality:o.$l.Medium,assets:[]}}deflate(e,t){t.usage=o._U[e.usage],t.quality=o.$l[e.quality],t.assets=e.assets.map((e=>e.toJSON()))}inflate(e,t){if(t.usage=o._U[e.usage],void 0===t.usage)throw new Error(`unknown derivative usage: ${e.usage}`);if(t.quality=o.$l[e.quality],void 0===t.quality)throw new Error(`unknown derivative quality: ${e.quality}`);t.assets=e.assets.map((e=>new l.ZP(e)))}assignTextures(e,t,n){for(let i=0;i{"use strict";n.d(t,{Z:()=>a});var i=n(90199),s=n(36283),r=n(25864),o=n(31491);class a extends i.Z{get scene(){return this.components.get(s.Z)}get documentProvider(){return this.components.get(r.Z)}get nodeProvider(){return this.components.get(o.Z)}createComponents(){this.createComponent(s.Z,"Master Scene"),this.createComponent(r.Z),this.createComponent(o.Z)}}a.typeName="NVDocuments"},38303:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var i=n(90199),s=n(26220),r=n(15271),o=n(18345),a=n(38080),l=n(63872),c=n(96180),h=n(11359),d=n(30242);class u extends i.Z{get pulse(){return this.components.get(s.Z)}get renderer(){return this.components.get(r.Z)}get fullscreen(){return this.components.get(a.Z)}get selection(){return this.components.get(o.Z)}get assetManager(){return this.components.get(l.Z)}get assetReader(){return this.components.get(c.Z)}get analytics(){return this.components.get(h.Z)}get arManager(){return this.components.get(d.Z)}createComponents(){this.createComponent(s.Z),this.createComponent(r.Z),this.createComponent(a.Z),this.createComponent(l.Z),this.createComponent(c.Z),this.createComponent(h.Z),this.createComponent(d.Z);this.createComponent(o.Z).ins.viewportBrackets.setValue(!1)}}u.typeName="NVEngine"},75222:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var i=n(90199),s=n(13227),r=n(27884),o=n(41282),a=n(84678),l=n(3388),c=n(26629),h=n(89167);class d extends i.Z{get transform(){return this.components.get(s.Z)}get meta(){return this.components.get(a.Z,!0)}get model(){return this.components.get(l.Z,!0)}get camera(){return this.components.get(r.Z,!0)}get light(){return this.components.get(o.f,!0)}get scene(){return this.components.get(c.Z,!0)}createComponents(){this.name="Node",this.createComponent(s.Z)}createModel(){this.name="Model",this.createComponent(a.Z),this.createComponent(l.Z)}fromDocument(e,t,n){const i=e.nodes[t];this.transform.fromData(i),n.set(`node/${t}`,this.transform);let s="Node";if(isFinite(i.meta)&&(this.createComponent(a.Z).fromDocument(e,i),n.set(`meta/${i.meta}`,this.meta),s="Meta"),isFinite(i.model)&&(this.createComponent(l.Z).fromDocument(e,i),n.set(`model/${i.model}`,this.model),s="Model"),isFinite(i.camera)&&(this.addTag("controlled"),this.createComponent(r.Z).fromDocument(e,i),n.set(`camera/${i.camera}`,this.camera),s="Camera"),isFinite(i.light)){this.addTag("controlled");const t=e.lights[i.light].type;let r=h.J.find((e=>e.type==t));if(!r)throw new Error(`unknown light type: '${t}'`);this.createComponent(r).fromDocument(e,i),s=r.text,n.set(`light/${i.light}`,this.light)}this.name=i.name||s;const o=i.children;o&&o.forEach((t=>{const i=this.graph.createCustomNode(d);this.transform.addChild(i.transform),i.fromDocument(e,t,n)}))}toDocument(e,t,n){n=n||{meta:!0,setup:!0,model:!0,camera:!0,light:!0},e.nodes=e.nodes||[];const i=e.nodes.length,s=this.transform.toData();e.nodes.push(s),t.set(this.transform,`node/${i}`),this.name&&(s.name=this.name),this.model&&n.model&&(s.model=this.model.toDocument(e,s),t.set(this.model,`model/${s.model}`)),this.camera&&n.camera&&(s.camera=this.camera.toDocument(e,s),t.set(this.camera,`camera/${s.camera}`)),this.light&&n.light&&(s.light=this.light.toDocument(e,s),t.set(this.light,`light/${s.light}`)),this.meta&&n.meta&&(s.meta=this.meta.toDocument(e,s),t.set(this.meta,`info/${s.meta}`));const r=this.transform.children.map((e=>e.node)).filter((e=>e.is(d)));return r.forEach((i=>{if(i.hasNodeComponents(n)){const r=i.toDocument(e,t,n);s.children=s.children||[],s.children.push(r)}})),i}hasNodeComponents(e){if(!e)return!0;const t=this.transform,n=this.components;return!(!e.model||!n.has(l.Z)&&!t.hasChildComponents(l.Z,!0))||(!(!e.camera||!n.has(r.Z)&&!t.hasChildComponents(r.Z,!0))||!(!e.light||!n.has(o.f)&&!t.hasChildComponents(o.f,!0)))}}d.typeName="NVNode"},82567:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(75222),s=n(26629),r=n(79815),o=n(84678);class a extends i.Z{get setup(){return this.components.get(r.Z,!0)}createComponents(){this.createComponent(s.Z),this.createComponent(r.Z),this.createComponent(o.Z)}fromDocument(e,t,n){const s=e.scenes[t];s.name&&(this.name=s.name),this.scene.fromDocument(e,s),isFinite(s.meta)&&(this.meta.fromDocument(e,s),n.set(`meta/${s.meta}`,this.meta)),isFinite(s.setup)&&this.setup.fromDocument(e,t,n);const r=s.nodes;if(r&&r.forEach((t=>{const s=this.graph.createCustomNode(i.Z);this.transform.addChild(s.transform),s.fromDocument(e,t,n)})),isFinite(s.setup)){const t=e.setups[s.setup];t.snapshots&&this.setup.snapshots.fromData(t.snapshots,n)}}toDocument(e,t,n){e.scenes=e.scenes||[];const s=e.scenes.length,r={units:"cm"};e.scenes.push(r),this.name&&(r.name=this.name),this.scene.toDocument(e,r);return this.transform.children.map((e=>e.node)).filter((e=>e.is(i.Z))).forEach((i=>{if(i.hasNodeComponents(n)){const s=i.toDocument(e,t,n);r.nodes=r.nodes||[],r.nodes.push(s)}})),n&&!n.setup||(this.meta&&(r.meta=this.meta.toDocument(e,r),t.set(this.meta,`meta/${r.meta}`)),this.setup&&this.setup.toDocument(e,s,t)),s}}a.typeName="NVScene"},1594:(e,t,n)=>{"use strict";var i,s,r;n.d(t,{PD:()=>s,f_:()=>i,k$:()=>o,oS:()=>r}),function(e){e[e.mm=0]="mm",e[e.cm=1]="cm",e[e.m=2]="m",e[e.km=3]="km",e[e.in=4]="in",e[e.ft=5]="ft",e[e.yd=6]="yd",e[e.mi=7]="mi"}(i||(i={})),function(e){e[e.EN=0]="EN",e[e.ES=1]="ES",e[e.DE=2]="DE",e[e.NL=3]="NL",e[e.JA=4]="JA",e[e.FR=5]="FR",e[e.HAW=6]="HAW"}(s||(s={})),function(e){e.EN="English",e.ES="Spanish (Español)",e.DE="German (Deutsch)",e.NL="Dutch (Nederlands)",e.JA="Japanese (日本語)",e.FR="French (Français)",e.HAW="Hawaiian (ʻŌlelo Hawaiʻi)"}(r||(r={}));const o="EN"},43875:(e,t,n)=>{"use strict";n.d(t,{$l:()=>s,_U:()=>i,f_:()=>l.f_,hH:()=>r,id:()=>a,xd:()=>o});var i,s,r,o,a,l=n(1594);!function(e){e[e.Image2D=0]="Image2D",e[e.Web3D=1]="Web3D",e[e.App3D=2]="App3D",e[e.iOSApp3D=3]="iOSApp3D",e[e.Print3D=4]="Print3D",e[e.Editorial3D=5]="Editorial3D"}(i||(i={})),function(e){e[e.Thumb=0]="Thumb",e[e.Low=1]="Low",e[e.Medium=2]="Medium",e[e.High=3]="High",e[e.Highest=4]="Highest",e[e.AR=5]="AR"}(s||(s={})),function(e){e[e.Model=0]="Model",e[e.Geometry=1]="Geometry",e[e.Image=2]="Image",e[e.Texture=3]="Texture",e[e.Points=4]="Points",e[e.Volume=5]="Volume"}(r||(r={})),function(e){e[e.Color=0]="Color",e[e.Emissive=1]="Emissive",e[e.Occlusion=2]="Occlusion",e[e.Normal=3]="Normal",e[e.MetallicRoughness=4]="MetallicRoughness",e[e.Zone=5]="Zone"}(o||(o={})),function(e){e[e.Front=0]="Front",e[e.Back=1]="Back",e[e.Double=2]="Double"}(a||(a={}))},60206:(e,t,n)=>{"use strict";var i,s,r,o,a;n.d(t,{fi:()=>a,pH:()=>i,u6:()=>s,we:()=>o}),function(e){e[e.Default=0]="Default",e[e.Clay=1]="Clay",e[e.XRay=2]="XRay",e[e.Normals=3]="Normals",e[e.Wireframe=4]="Wireframe"}(i||(i={})),function(e){e[e.Solid=0]="Solid",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient"}(s||(s={})),function(e){e[e.Orbit=0]="Orbit",e[e.Walk=1]="Walk"}(r||(r={})),function(e){e[e.Overlay=0]="Overlay",e[e.Left=1]="Left",e[e.Right=2]="Right"}(o||(o={})),function(e){e[e.X=0]="X",e[e.Y=1]="Y",e[e.Z=2]="Z"}(a||(a={}))},10290:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p,p:()=>h.pH});var i=n(6965),s=n(93113),r=n(75544),o=n(8173),a=n(17393),l=n(19588),c=n(84538),h=n(60206);const d=n(8669).Z,u=n(9849).Z;class p extends i.W{constructor(e){super(),this._clayColor=new s.I("#a67a6c").convertLinearToSRGB(),this._wireColor=new s.I("#004966").convertLinearToSRGB(),this._wireEmissiveColor=new s.I("#004966").convertLinearToSRGB(),this._objectSpaceNormalMap=!1,this._paramCopy={},this._sideCopy=r.Wl3,this.type="UberPBRMaterial",this.isUberPBRMaterial=!0,this.isMeshStandardMaterial=!0,this.isMeshPhysicalMaterial=!1,this.defines={STANDARD:!0,PHYSICAL:!1,OBJECTSPACE_NORMALMAP:!1,MODE_NORMALS:!1,MODE_XRAY:!1,CUT_PLANE:!1,USE_ZONEMAP:!1},this.uniforms=o.rD.merge([a.V.standard.uniforms,{aoMapMix:{value:new l.P(.25,.25,.25)},cutPlaneDirection:{value:new c.L(0,0,-1,0)},cutPlaneColor:{value:new l.P(1,0,0)},zoneMap:{value:null}}]),this._aoMapMix=this.uniforms.aoMapMix.value,this._cutPlaneDirection=this.uniforms.cutPlaneDirection.value,this._cutPlaneColor=this.uniforms.cutPlaneColor.value,this._zoneMap=this.uniforms.zoneMap.value,this.vertexShader=u,this.fragmentShader=d,this.color=new s.I(16777215),this.roughness=.7,this.metalness=0,e&&this.setValues(e)}set cutPlaneDirection(e){this._cutPlaneDirection.copy(e)}get cutPlaneDirection(){return this._cutPlaneDirection}set cutPlaneColor(e){this._cutPlaneColor.copy(e)}get cutPlaneColor(){return this._cutPlaneColor}set aoMapMix(e){this._aoMapMix.copy(e)}get aoMapMix(){return this._aoMapMix}set zoneMap(e){this._zoneMap=e,this.uniforms.zoneMap.value=e,this.needsUpdate=!0}get zoneMap(){return this._zoneMap}setShaderMode(e){switch(Object.assign(this,this._paramCopy),this.defines.MODE_NORMALS=!1,this.defines.MODE_XRAY=!1,this.defines.OBJECTSPACE_NORMALMAP=!(!this.normalMap||!this._objectSpaceNormalMap),this.side=this.defines.CUT_PLANE?r.ehD:this.side,this.needsUpdate=!0,e){case h.pH.Clay:this._paramCopy={color:this.color,map:this.map,roughness:this.roughness,metalness:this.metalness,aoMapIntensity:this.aoMapIntensity,blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite},this.color=this._clayColor,this.map=null,this.roughness=1,this.metalness=0,this.aoMapIntensity*=1,this.blending=r.jFi,this.transparent=!1,this.depthWrite=!0;break;case h.pH.Normals:this._paramCopy={blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite},this.defines.MODE_NORMALS=!0,this.blending=r.jFi,this.transparent=!1,this.depthWrite=!0;break;case h.pH.XRay:this._paramCopy={side:this.side,blending:this.blending,transparent:this.transparent,depthWrite:this.depthWrite},this.defines.MODE_XRAY=!0,this.side=r.ehD,this.blending=r.WMw,this.transparent=!0,this.depthWrite=!1;break;case h.pH.Wireframe:this._paramCopy={color:this.color,emissive:this.emissive,roughness:this.roughness,metalness:this.metalness,wireframe:this.wireframe,map:this.map,aoMap:this.aoMap,emissiveMap:this.emissiveMap,normalMap:this.normalMap},this.color=this._wireColor,this.emissive=this._wireEmissiveColor,this.roughness=.8,this.metalness=.1,this.wireframe=!0,this.map=null,this.aoMap=null,this.emissiveMap=null,this.normalMap=null,this.defines.OBJECTSPACE_NORMALMAP=!1}}enableCutPlane(e){this.defines.CUT_PLANE=e,e?(this._sideCopy=this.side,this.side=r.ehD):this.side=this._sideCopy}enableObjectSpaceNormalMap(e){e!==this._objectSpaceNormalMap&&(this._objectSpaceNormalMap=e),this.normalMap&&(this.normalMapType=r.PA7,this.needsUpdate=!0)}enableZoneMap(e){this.defines.USE_ZONEMAP=e}}},97010:(e,t,n)=>{"use strict";var i=n(51120),s=(n(98595),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let r=class extends i.ZP{constructor(){super(...arguments),this.property=null,this.name="",this.text=null,this.language=null,this.disabled=!1,this.customLabelStyle=""}firstConnected(){this.classList.add("sv-property","sv-property-boolean")}update(e){if(!this.property)throw new Error("missing property attribute");if("boolean"!==this.property.type)throw new Error("not a boolean property");if(e.has("property")){const t=e.get("property");t&&t.off("value",this.onUpdate,this),this.property&&this.property.on("value",this.onUpdate,this)}super.update(e)}render(){const e=this.property,t=this.name||e.name,n=t.replace(/\s/g,""),s=this.text,r=this.language,o=this.customLabelStyle;let a=e.value?Array.isArray(s)?s[1]:s||"On":Array.isArray(s)?s[0]:s||"Off";return i.dy` +
`}onButtonClick(e){this.property.setValue(!this.property.value)}};s([(0,i.Cb)({attribute:!1})],r.prototype,"property",void 0),s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({attribute:!1})],r.prototype,"text",void 0),s([(0,i.Cb)({attribute:!1})],r.prototype,"language",void 0),s([(0,i.Cb)({type:Boolean})],r.prototype,"disabled",void 0),s([(0,i.Cb)({type:String})],r.prototype,"customLabelStyle",void 0),r=s([(0,i.Mo)("sv-property-boolean")],r)},46436:(e,t,n)=>{"use strict";var i=n(47855),s=n(51120),r=(n(98595),n(34834),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let o=class extends s.ZP{constructor(){super(),this.property=null,this.name="",this.color=new i.ZP}firstConnected(){super.firstConnected(),this.classList.add("sv-property","sv-property-color")}update(e){if(!this.property)throw new Error("missing property attribute");if("number"!==this.property.type||3!==this.property.elementCount)throw new Error(`not an color property: '${this.property.path}'`);if(e.has("property")){const t=e.get("property");t&&t.off("value",this.onPropertyChange,this),this.property&&(this.property.on("value",this.onPropertyChange,this),this.color.fromArray(this.property.value))}super.update(e)}render(){const e=this.property,t=this.name||e.name,n=this.color.toString();return s.dy` + + `}onColorChange(e){this.color=new i.ZP(e.target.value),this.property.setValue(this.color.toRGBArray())}onPropertyChange(e){this.color.fromArray(e),this.requestUpdate()}};r([(0,s.Cb)({attribute:!1})],o.prototype,"property",void 0),r([(0,s.Cb)({type:String})],o.prototype,"name",void 0),o=r([(0,s.Mo)("sv-property-color")],o)},85203:(e,t,n)=>{"use strict";var i=n(51120),s=(n(98595),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let r=class extends i.ZP{constructor(){super(...arguments),this.property=null,this.name="",this.text="",this.icon=""}firstConnected(){this.classList.add("sv-property","sv-property-event")}update(e){if(!this.property)throw new Error("missing property attribute");if(!this.property.schema.event)throw new Error(`not an event property: '${this.property.path}'`);if(e.has("property")){const t=e.get("property");t&&t.off("value",this.onUpdate,this),this.property&&this.property.on("value",this.onUpdate,this)}super.update(e)}render(){const e=this.property,t=this.name||e.name,n=this.text,s=this.icon;return i.dy` +
+ +
`}onButtonClick(e){this.property.set()}};s([(0,i.Cb)({attribute:!1})],r.prototype,"property",void 0),s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({type:String})],r.prototype,"text",void 0),s([(0,i.Cb)({type:String})],r.prototype,"icon",void 0),r=s([(0,i.Mo)("sv-property-event")],r)},18257:(e,t,n)=>{"use strict";var i=n(53868);const s=(0,i.XM)((e=>t=>{let n;if(t instanceof i.K1||t instanceof i.nt)throw new Error("The `live` directive is not allowed on text or event bindings");if(t instanceof i.JG)r(t.strings),n=t.element.hasAttribute(t.name),t.value=n;else{const{element:s,name:o,strings:a}=t.committer;if(r(a),t instanceof i.sL){if(n=s[o],n===e)return}else t instanceof i._l&&(n=s.getAttribute(o));if(n===String(e))return}t.setValue(e)})),r=e=>{if(2!==e.length||""!==e[0]||""!==e[1])throw new Error("`live` bindings can only contain a single expression")};var o=n(51120),a=(n(98595),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let l=class extends o.ZP{constructor(){super(...arguments),this.property=null,this.name="",this.options=null,this.indexMap=null,this.language=null,this.dropdown=!1}firstConnected(){this.classList.add("sv-property","sv-property-options")}update(e){if(!this.property)throw new Error("missing property attribute");if("number"!==this.property.type||!this.property.schema.options)throw new Error("not an options property");if(e.has("property")){const t=e.get("property");t&&(t.off("value",this.onUpdate,this),t.off("change",this.onUpdate,this)),this.property&&(this.property.on("value",this.onUpdate,this),this.property.on("change",this.onUpdate,this))}super.update(e)}render(){return this.dropdown?this.renderDropdown():this.renderButtons()}renderDropdown(){const e=this.property,t=this.indexMap,n=this.name||e.name,i=this.options||e.schema.options,r=e.value,a=this.language;let l;return l=t?t.map((e=>o.dy``)):i.map(((e,t)=>e?o.dy``:null)),o.dy` + + + `}renderButtons(){const e=this.property,t=this.indexMap,n=this.name||e.name,i=this.options||e.schema.options,s=(e.value,this.language);let r;return r=t?t.map((e=>o.dy` + `)):i.map(((e,t)=>e?o.dy` + `:null)),o.dy` + +
this.onKeyDown(e)} title=${n} class="sv-options"> + ${r} +
`}isSelected(e){return this.property.isMulti()?this.property.value.includes(e):this.property.value==e}onButtonClick(e){const t=e.target.index;if(this.property.isMulti()){let e=this.property.value.slice();-1!==e.indexOf(t)?e=e.filter((e=>e!==t)):e.push(t),this.property.setValue(e)}else this.property.setValue(t)}onKeyDown(e){if("ArrowUp"===e.code||"ArrowLeft"===e.code){const t=this.getElementsByTagName("ff-button"),n=Array.from(t).findIndex((t=>e.target===t));n>0&&(t[n].setAttribute("tabIndex","-1"),t[n-1].setAttribute("tabIndex","0"),t[n-1].focus())}else if("ArrowDown"===e.code||"ArrowRight"===e.code){const t=this.getElementsByTagName("ff-button"),n=Array.from(t).findIndex((t=>e.target===t));n0===e.tabIndex)),0)].focus()}tabReset(e){const t=this.getElementsByTagName("ff-button"),n=Array.from(t),i=n.findIndex((e=>0===e.tabIndex)),s=n.findIndex((e=>"true"===e.getAttribute("aria-checked")));if(i!=s){t[i].setAttribute("tabIndex","-1");t[s>-1?s:0].setAttribute("tabIndex","0")}}};a([(0,o.Cb)({attribute:!1})],l.prototype,"property",void 0),a([(0,o.Cb)({type:String})],l.prototype,"name",void 0),a([(0,o.Cb)({attribute:!1})],l.prototype,"options",void 0),a([(0,o.Cb)({attribute:!1})],l.prototype,"indexMap",void 0),a([(0,o.Cb)({attribute:!1})],l.prototype,"language",void 0),a([(0,o.Cb)({type:Boolean,reflect:!0})],l.prototype,"dropdown",void 0),l=a([(0,o.Mo)("sv-property-options")],l)},90470:(e,t,n)=>{"use strict";var i=n(51120),s=(n(61497),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let r=class extends i.ZP{constructor(){super(...arguments),this.property=null,this.name="",this.min=void 0,this.max=void 0}firstConnected(){super.firstConnected(),this.classList.add("sv-property","sv-property-slider")}update(e){if(!this.property)throw new Error("missing property attribute");if("number"!==this.property.type)throw new Error(`not a number property: '${this.property.path}'`);if(e.has("property")){const t=e.get("property");t&&t.off("value",this.onUpdate,this),this.property&&this.property.on("value",this.onUpdate,this)}super.update(e)}render(){const e=this.property,t=this.name||e.name,n=e.getValidatedValue(),s=isFinite(this.min)?this.min:e.schema.min,r=isFinite(this.max)?this.max:e.schema.max,o=(n-s)/(r-s);return i.dy` + `}onSliderChange(e){const t=this.property,n=isFinite(this.min)?this.min:t.schema.min,i=isFinite(this.max)?this.max:t.schema.max,s=n+e.detail.value*(i-n);t.setValue(s)}onKeyDown(e){const t=this.property;"ArrowRight"===e.code||"ArrowUp"===e.code||"PageUp"===e.code?t.setValue(this.clamp("PageUp"===e.code?t.value+.1:t.value+.01)):"ArrowLeft"!==e.code&&"ArrowDown"!==e.code&&"PageDown"!==e.code||t.setValue(this.clamp("PageDown"===e.code?t.value-.1:t.value-.01))}clamp(e){const t=this.property,n=isFinite(this.min)?this.min:t.schema.min,i=isFinite(this.max)?this.max:t.schema.max;return Math.min(Math.max(e,n),i)}};s([(0,i.Cb)({attribute:!1})],r.prototype,"property",void 0),s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"min",void 0),s([(0,i.Cb)({type:Number})],r.prototype,"max",void 0),r=s([(0,i.Mo)("sv-property-slider")],r)},77804:(e,t,n)=>{"use strict";var i=n(51120),s=(n(98595),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let r=class extends i.ZP{constructor(){super(...arguments),this.property=null,this.name="",this.onChange=e=>{const t=e.target.value;this.property.setValue(t)}}firstConnected(){this.classList.add("sv-property","sv-property-string")}update(e){if(!this.property)throw new Error("missing property attribute");if("string"!==this.property.type)throw new Error(`not a string property: '${this.property.path}'`);if(e.has("property")){const t=e.get("property");t&&t.off("value",this.onUpdate,this),this.property&&this.property.on("value",this.onUpdate,this)}super.update(e)}render(){const e=this.property,t=this.name||e.name,n=e.value;return i.dy`${t?i.dy``:null} + {e.target.select()}}} + @keypress=${e=>{"Enter"===e.key&&e.target.blur()}} + > + `}};s([(0,i.Cb)({attribute:!1})],r.prototype,"property",void 0),s([(0,i.Cb)({type:String})],r.prototype,"name",void 0),r=s([(0,i.Mo)("sv-property-string")],r)},47425:(e,t,n)=>{"use strict";n.d(t,{Mo:()=>i.Mo,ZP:()=>o,dy:()=>i.dy});var i=n(51120),s=n(67695),r=n(25864);class o extends s.ZP{constructor(){super(...arguments),this.activeDocument=null}get documentProvider(){return this.system.getMainComponent(r.Z)}connected(){const e=this.documentProvider;e.on("active-component",this.onActiveDocumentEvent,this);const t=e.activeComponent;t&&(this.activeDocument=t,this.onActiveDocument(null,t))}disconnected(){this.documentProvider.off("active-component",this.onActiveDocumentEvent,this);const e=this.activeDocument;e&&(this.activeDocument=null,this.onActiveDocument(e,null))}onActiveDocument(e,t){}onActiveDocumentEvent(e){this.activeDocument=e.next,this.onActiveDocument(e.previous,e.next)}}},94860:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Ze});var i=n(38080),s=n(30242),r=n(27643),o=n(51120),a=n(1239),l=n(10564),c=n(13772),h=n(25976),d=n(60206),u=n(11359),p=n(63872);class f{constructor(e){this.next=null,this.activePositions=[],this.activeType="",this.centerX=0,this.centerY=0,this.startX=0,this.startY=0,this.isDragging=!1,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUpOrCancel=this.onPointerUpOrCancel.bind(this),this.onDoubleClick=this.onDoubleClick.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.onWheel=this.onWheel.bind(this),this.onKeyDown=this.onKeyDown.bind(this),e&&(e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUpOrCancel),e.addEventListener("pointercancel",this.onPointerUpOrCancel),e.addEventListener("contextmenu",this.onContextMenu),e.addEventListener("wheel",this.onWheel),e.addEventListener("keydown",this.onKeyDown))}onPointerDown(e){if(this.activeType&&e.pointerType!==this.activeType)return;0===this.activePositions.length&&(this.startX=e.clientX,this.startY=e.clientY,this.isDragging=!1),this.activeType=e.pointerType,this.activePositions.push({id:e.pointerId,clientX:e.clientX,clientY:e.clientY});const t=this.createManipPointerEvent(e,"pointer-down");this.sendPointerEvent(t)&&e.stopPropagation()}onPointerMove(e){const t=this.activePositions;for(let n=0,i=t.length;n0&&!this.isDragging){Math.abs(e.clientX-this.startX)+Math.abs(e.clientY-this.startY)>4&&(this.isDragging=!0)}const n=t.length?"pointer-move":"pointer-hover",i=this.createManipPointerEvent(e,n);this.sendPointerEvent(i)&&e.stopPropagation()}onPointerUpOrCancel(e){const t=this.activePositions;let n=!1;for(let i=0,s=t.length;i0){for(let e=0;e=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});!function(e){e[e.Single=0]="Single",e[e.HorizontalSplit=1]="HorizontalSplit",e[e.VerticalSplit=2]="VerticalSplit",e[e.Quad=3]="Quad"}(m||(m={}));let y=class extends o.ZP{constructor(){super(...arguments),this.layout=m.Single,this.horizontalPosition=.5,this.verticalPosition=.5}firstConnected(){this.classList.add("ff-quad-splitter")}render(){const e=this.layout;if(e===m.Single)return o.dy``;const t=[];return e!==m.HorizontalSplit&&e!==m.Quad||t.push(o.dy` +
+
+ +
+
+ `),e!==m.VerticalSplit&&e!==m.Quad||t.push(o.dy` +
+
+ +
+
+ `),o.dy`${t}`}onSplitterChange(e){"horizontal"===e.detail.direction?this.horizontalPosition=e.detail.position:this.verticalPosition=e.detail.position,this.onChange&&this.onChange({layout:this.layout,horizontalSplit:this.horizontalPosition,verticalSplit:this.verticalPosition,isDragging:e.detail.isDragging})}};v([(0,o.Cb)({attribute:!1})],y.prototype,"layout",void 0),v([(0,o.Cb)({attribute:!1})],y.prototype,"horizontalPosition",void 0),v([(0,o.Cb)({attribute:!1})],y.prototype,"verticalPosition",void 0),y=v([(0,o.Mo)("ff-quad-splitter")],y);const b=y;var _=n(25864),x=n(44661),w=n(79815),E=n(53310),C=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let S=class extends A.ZP{constructor(e){super(e),this.view=null,this.canvas=null,this.overlay=null,this.srAnnouncement=null,this.splitter=null,this.resizeObserver=null,this.pointerEventsEnabled=!1,this.measuring=!1,this.onPointerUpOrCancel=this.onPointerUpOrCancel.bind(this),this.onKeyDownOverlay=this.onKeyDownOverlay.bind(this),this.manipTarget=new f,this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointermove",this.manipTarget.onPointerMove),this.addEventListener("pointerup",this.onPointerUpOrCancel),this.addEventListener("pointercancel",this.onPointerUpOrCancel),this.ownerDocument.addEventListener("pointermove",this.manipTarget.onPointerMove),this.ownerDocument.addEventListener("pointerup",this.onPointerUpOrCancel),this.ownerDocument.addEventListener("pointercancel",this.onPointerUpOrCancel),this.addEventListener("wheel",this.manipTarget.onWheel),this.addEventListener("contextmenu",this.manipTarget.onContextMenu),this.addEventListener("keydown",this.manipTarget.onKeyDown),this.pointerEventsEnabled=!0}getView(){return this.view}firstConnected(){this.classList.add("sv-scene-view"),this.style.touchAction="none",this.setAttribute("touch-action","none"),this.tabIndex=0,this.id="sv-scene",this.ariaLabel="Interactive 3D Model. Use mouse, touch, or arrow keys to rotate. Escape key to exit annotations.",this.setAttribute("role","application"),this.srAnnouncement=this.appendElement("div"),this.srAnnouncement.classList.add("sr-only"),this.srAnnouncement.setAttribute("aria-live","polite"),this.canvas=this.appendElement("canvas",{display:"block",width:"100%",height:"100%"}),this.overlay=this.appendElement("div",{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",overflow:"hidden"}),this.overlay.classList.add("sv-content-overlay"),this.overlay.addEventListener("keydown",this.onKeyDownOverlay),this.splitter=this.appendElement(b,{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",overflow:"hidden"}),this.splitter.onChange=e=>{this.view.horizontalSplit=e.horizontalSplit,this.view.verticalSplit=e.verticalSplit},this.view=new g.Z(this.system,this.canvas,this.overlay),this.view.on("layout",(e=>{this.splitter.layout=e.layout,this.dispatchEvent(new CustomEvent("layout"))})),this.view.layout=m.Single,this.splitter.layout=m.Single,this.manipTarget.next=this.view}connected(){this.view.attach(),this.resizeObserver||(this.resizeObserver=new ResizeObserver((()=>this.view.resize()))),this.resizeObserver.observe(this.view.renderer.domElement),this.system.getMainComponent(_.Z).activeComponent.setup.navigation.ins.pointerEnabled.on("value",this.enablePointerEvents,this),this.system.getComponent(x.ZP).ins.keyNavActive.on("value",this.onKeyboardNavigation,this),this.system.getComponent(w.Z).tape.ins.enabled.on("value",this.onMeasure,this)}disconnected(){this.resizeObserver.disconnect(),this.system.getComponent(w.Z).tape.ins.enabled.off("value",this.onMeasure,this),this.system.getComponent(x.ZP).ins.keyNavActive.off("value",this.onKeyboardNavigation,this),this.system.getMainComponent(_.Z).activeComponent.setup.navigation.ins.pointerEnabled.off("value",this.enablePointerEvents,this),this.view.detach()}enablePointerEvents(){const e=this.system.getMainComponent(_.Z).activeComponent.setup.navigation.ins.pointerEnabled.value;e&&!this.pointerEventsEnabled?(this.addEventListener("pointerdown",this.onPointerDown),this.addEventListener("pointermove",this.manipTarget.onPointerMove),this.addEventListener("pointerup",this.onPointerUpOrCancel),this.addEventListener("pointercancel",this.onPointerUpOrCancel),this.ownerDocument.addEventListener("pointermove",this.manipTarget.onPointerMove),this.ownerDocument.addEventListener("pointerup",this.onPointerUpOrCancel),this.ownerDocument.addEventListener("pointercancel",this.onPointerUpOrCancel),this.addEventListener("wheel",this.manipTarget.onWheel),this.addEventListener("contextmenu",this.manipTarget.onContextMenu),this.addEventListener("keydown",this.manipTarget.onKeyDown),this.style.touchAction="none",this.setAttribute("touch-action","none"),this.pointerEventsEnabled=!0):!e&&this.pointerEventsEnabled&&(this.removeEventListener("pointerdown",this.onPointerDown),this.removeEventListener("pointermove",this.manipTarget.onPointerMove),this.removeEventListener("pointerup",this.onPointerUpOrCancel),this.removeEventListener("pointercancel",this.onPointerUpOrCancel),this.ownerDocument.removeEventListener("pointermove",this.manipTarget.onPointerMove),this.ownerDocument.removeEventListener("pointerup",this.onPointerUpOrCancel),this.ownerDocument.removeEventListener("pointercancel",this.onPointerUpOrCancel),this.removeEventListener("wheel",this.manipTarget.onWheel),this.removeEventListener("contextmenu",this.manipTarget.onContextMenu),this.removeEventListener("keydown",this.manipTarget.onKeyDown),this.style.touchAction="auto",this.setAttribute("touch-action","auto"),this.pointerEventsEnabled=!1,this.style.cursor="default")}onPointerDown(e){this.pointerEventsEnabled&&(this.style.cursor="default"==this.style.cursor?"default":"grabbing",this.manipTarget.onPointerDown(e))}onPointerUpOrCancel(e){this.pointerEventsEnabled&&(this.style.cursor="default"==this.style.cursor?"default":"grab",this.manipTarget.onPointerUpOrCancel(e))}onKeyboardNavigation(){const e=this.system.getComponent(x.ZP).ins;switch(e.keyNavActive.value){case x.dT.Orbit:this.srAnnouncement.textContent="Orbit "+e.orbit.value[0].toFixed(0)+", "+e.orbit.value[1].toFixed(0)+", "+e.orbit.value[2].toFixed(0);break;case x.dT.Pan:case x.dT.Zoom:this.srAnnouncement.textContent="Offset "+e.offset.value[0].toFixed(0)+", "+e.offset.value[1].toFixed(0)+", "+e.offset.value[2].toFixed(0)}}onMeasure(){this.measuring=this.system.getComponent(w.Z).tape.ins.enabled.value,this.style.cursor=this.measuring?"default":"grab"}onKeyDownOverlay(e){const t=this.system.getComponent(w.Z).viewer;if("Escape"===e.code)if(e.preventDefault(),t.ins.sortedTags.value.length>0){const e=t.rootElement.shadowRoot.querySelector(".sv-tag-buttons").getElementsByClassName("ff-button")[0];e&&e.focus()}else this.system.getComponent(w.Z).viewer.ins.annotationExit.set();else"Tab"===e.code&&(0,E.e)((0,E.G)(this.overlay),e)}};S=C([(0,A.Mo)("sv-scene-view")],S);const M=S;var I,T=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let P=I=class extends o.ZP{constructor(){super(...arguments),this.visible=!1,this.assetPath=""}firstConnected(){super.firstConnected(),this.classList.add("sv-spinner")}render(){const e=o.dy`
+ ${I.template} +
`;return this.style.visibility=this.visible?"visible":"hidden",e}};P.template=o.dy`
`,T([(0,o.Cb)({type:Boolean})],P.prototype,"visible",void 0),T([(0,o.Cb)({type:String})],P.prototype,"assetPath",void 0),P=I=T([(0,o.Mo)("sv-spinner")],P);var B,R=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let D=B=class extends o.ZP{firstConnected(){super.firstConnected(),this.classList.add("sv-action-prompt")}render(){return o.dy`
${B.icon}
`}};D.icon=o.dy``,D=B=R([(0,o.Mo)("sv-action-prompt")],D);var L=n(98595),N=n(47425),k=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let O=class extends N.ZP{constructor(){super(...arguments),this.reader=null,this.tours=null,this.language=null,this.firstRender=!0}firstConnected(){super.firstConnected(),this.classList.add("sv-reader-view")}renderMenuEntry(e,t){const n=e.article;return N.dy`
this.onKeyDown(e,n.id)} class="sv-entry" @click=${e=>this.onClickArticle(e,n.id)}> +
+

${n.title}

+ +
+

${n.lead}

+
`}render(){const e=this.reader,t=this.language;this.tours;if(!e)return N.dy`
Please select a document to display its articles.
`;const n=this.tours.ins.enabled.value?null:N.dy``;if(!e.activeArticle){const n=e.articles;return N.dy`
+ + ${n.map(((e,t)=>this.renderMenuEntry(e,t)))} +
`}return N.dy`
this.onKeyDown(t,e.activeArticle.id)} > + + ${n} +
+
`}onClickMenu(e){e.stopPropagation(),this.reader.ins.articleId.setValue(""),this.reader.ins.focus.setValue(!0)}onClickClose(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("close"))}onClickArticle(e,t){this.reader.ins.articleId.setValue(t)}updated(e){super.updated(e);const t=this.reader;if(t){if(t.activeArticle){const e=this.getElementsByClassName("sv-container").item(0);e.innerHTML=t.outs.content.value,this.firstRender&&(setTimeout((()=>{e.insertAdjacentHTML("beforeend","
-end of article-
")}),200),this.firstRender=!1)}t.ins.focus.value&&(this.setFocus(),t.ins.focus.setValue(!1,!0))}}onActiveDocument(e,t){e&&(e.setup.language.outs.language.off("value",this.onUpdate,this),this.reader.outs.content.off("value",this.onUpdate,this),this.reader.outs.article.off("value",this.onUpdate,this),this.tours=null,this.language=null,this.reader=null),t&&(this.reader=t.setup.reader,this.language=t.setup.language,this.tours=t.setup.tours,this.reader.outs.content.on("value",this.onUpdate,this),this.reader.outs.article.on("value",this.onUpdate,this),t.setup.language.outs.language.on("value",this.onUpdate,this))}onKeyDown(e,t){const n=this.reader;if("Space"!==e.code&&"Enter"!==e.code||!n||n.activeArticle){if("Escape"===e.code)e.preventDefault(),n.activeArticle?(n.ins.articleId.setValue(""),n.ins.focus.setValue(!0)):this.dispatchEvent(new CustomEvent("close"));else if("Tab"===e.code)(0,E.e)((0,E.G)(this),e);else if(("ArrowUp"===e.code||"ArrowDown"===e.code)&&n&&!n.activeArticle){const t=e.target instanceof Element?e.target:null;if(t){const n="ArrowUp"===e.code?t.previousElementSibling:t.nextElementSibling;n&&(t.setAttribute("tabIndex","-1"),n.setAttribute("tabIndex","0"),n.focus())}}}else e.preventDefault(),this.reader.ins.articleId.setValue(t),this.reader.ins.focus.setValue(!0)}setFocus(){(this.reader.activeArticle?this.getElementsByClassName("sv-nav-button").item(1):this.getElementsByClassName("sv-entry").item(0)).focus()}};O=k([(0,N.Mo)("sv-reader-view")],O);var U=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let F=class extends N.ZP{constructor(){super(...arguments),this.audioManager=null,this.documentProps=new h.Z("value",this.onUpdate,this)}firstConnected(){super.firstConnected(),this.classList.add("sv-caption-view")}render(){const e=this.audioManager,t=e.ins.activeCaption.value,n=e.ins.captionsEnabled.value;return t.length>0&&n?N.dy`
${t}
`:null}onActiveDocument(e,t){if(e&&this.documentProps.off(),t){const e=t.setup;this.audioManager=t.setup.audio,this.documentProps.on(e.audio.ins.captionsEnabled,e.audio.ins.activeCaption)}this.requestUpdate()}};F=U([(0,N.Mo)("sv-caption-view")],F);const V=F;var Q=n(15271),z=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let G=class extends N.ZP{get arManager(){return this.system.getMainComponent(s.Z)}firstConnected(){super.firstConnected()}render(){const e=this.arManager,t=e.outs,n=!0===e.ins.wallMount.value?"a wall":"the floor";return!t.isPlaced.value&&t.isPresenting.value?N.dy`
+
+
+ Point your device at ${n} and move it around to place your Smithsonian object!

**BETA** +
+
`:null}onActiveDocument(e,t){e&&(this.arManager.outs.isPlaced.off("value",this.onUpdate,this),this.arManager.outs.isPresenting.off("value",this.onUpdate,this)),t&&(this.arManager.outs.isPlaced.on("value",this.onUpdate,this),this.arManager.outs.isPresenting.on("value",this.onUpdate,this)),this.requestUpdate()}};G=z([(0,N.Mo)("sv-ar-prompt-container")],G);const j=G;var H=n(51462),$=n(26629),W=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let Z=class extends N.ZP{constructor(){super(...arguments),this.documentProps=new h.Z("value",this.onUpdate,this),this.shareButtonSelected=!1}get analytics(){return this.system.getMainComponent(u.Z)}get arManager(){return this.system.getMainComponent(s.Z)}get sceneNode(){return this.system.getComponent($.Z)}firstConnected(){super.firstConnected(),this.classList.add("sv-ar-menu-container")}connected(){super.connected()}disconnected(){super.disconnected()}render(){const e=this.activeDocument;if(!e)return N.dy``;const t=this.arManager.outs,n=e.setup,i=this.sceneNode.getGraphComponents(H.Z).some((e=>e.hasAnnotations)),s=n.viewer.ins.annotationsVisible.value,r=n.audio.outs.narrationEnabled.value,o=n.audio.outs.narrationPlaying.value;return t.isPlaced.value&&t.isPresenting.value?N.dy`
+ ${i?N.dy``:null} + ${r?N.dy``:null} +
`:null}onToggleReader(){const e=this.activeDocument.setup.reader.ins;e.enabled.setValue(!e.enabled.value),this.analytics.sendProperty("Reader_Enabled",e.enabled.value)}onToggleNarration(){const e=this.activeDocument.setup.audio;e.setupAudio(),e.ins.playNarration.set()}onToggleAnnotations(){const e=this.activeDocument.setup.viewer.ins;e.annotationsVisible.setValue(!e.annotationsVisible.value),this.analytics.sendProperty("Annotations_Visible",e.annotationsVisible.value)}onActiveDocument(e,t){if(e&&(this.documentProps.off(),this.arManager.outs.isPlaced.off("value",this.onUpdate,this),this.arManager.outs.isPresenting.off("value",this.onUpdate,this)),t){const e=t.setup;this.documentProps.on(e.viewer.ins.annotationsVisible,e.audio.outs.narrationPlaying),this.arManager.outs.isPlaced.on("value",this.onUpdate,this),this.arManager.outs.isPresenting.on("value",this.onUpdate,this)}this.requestUpdate()}};Z=W([(0,N.Mo)("sv-ar-menu")],Z);const q=Z;var K=n(96180),Y=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let X=class extends N.ZP{constructor(){super(...arguments),this.sceneView=null,this.captionView=null,this.documentProps=new h.Z("value",this.onUpdate,this),this.isMobile=null,this.assetPath=""}get analytics(){return this.system.getMainComponent(u.Z)}get assetManager(){return this.system.getMainComponent(p.Z)}get reader(){return this.activeDocument?this.activeDocument.setup.reader:null}get tours(){return this.activeDocument?this.activeDocument.setup.tours:null}get navigation(){return this.activeDocument?this.activeDocument.setup.navigation:null}get renderer(){return this.system.getMainComponent(Q.Z)}get arManager(){return this.system.getMainComponent(s.Z)}get assetReader(){return this.system.getMainComponent(K.Z)}firstConnected(){this.classList.add("sv-content-view"),this.sceneView=new M(this.system),this.captionView=new V(this.system),this.isMobile=this.mobileCheck()}connected(){super.connected(),this.assetManager.outs.busy.on("value",this.onUpdate,this),this.sceneView.on("layout",(()=>this.onUpdate())),this.assetPath=this.assetReader.getSystemAssetUrl("")}disconnected(){this.sceneView.off("layout",(()=>this.onUpdate())),this.assetManager.outs.busy.off("value",this.onUpdate,this),super.disconnected()}render(){const e=this.system,t=this.assetManager.outs.busy.value,n=this.assetManager.initialLoad;let i=!1,s=d.we.Overlay,r=!1,o=!1;const a=this.reader,l=this.tours,c=this.navigation,h=this.arManager.shadowRoot.querySelector("ff-viewport-overlay");if(h&&(null===this.arManager.shadowRoot.querySelector("sv-ar-prompt-container")&&h.append(new j(this.system)),null===this.arManager.shadowRoot.querySelector("sv-ar-menu")&&h.append(new q(this.system))),l&&(r=l.ins.enabled.value&&-1===l.outs.tourIndex.value),a&&(i=!r&&a.ins.enabled.value&&a.ins.visible.value,s=a.ins.position.getValidatedValue(),!0===this.isMobile&&(s=d.we.Overlay)),c){const e=c.ins.pointerEnabled.value,s=c.ins.promptEnabled.value;if(e&&s){const e=c.ins.isInUse.value;o=!t&&n&&!e&&!i,c.ins.promptActive.setValue(o)}}const u=this.sceneView,p=this.captionView;if((i&&s===d.we.Overlay||r)&&this.sceneView.getView().layout==g.t.Single?u.classList.contains("sv-blur")||setTimeout((()=>{u.classList.add("sv-blur"),this.renderer.views[0].render()}),1):u.classList.remove("sv-blur"),!t&&n&&(this.analytics.sendProperty("Loading_Time",this.analytics.getTimerTime()/1e3),this.analytics.resetTimer(),this.assetManager.initialLoad=!1),i){if(s===d.we.Right)return N.dy`
+
+ ${u} +
+ +
+
+ +
+
+
+ + ${p}`;if(s===d.we.Overlay)return N.dy`
${u} +
+ +
+ + ${p} +
`}return N.dy`
${u}
+ + ${p} + ${o?N.dy``:null}`}onReaderClose(){this.reader.ins.enabled.setValue(!1),this.reader.ins.closed.set()}onActiveDocument(e,t){e&&this.documentProps.off(),t&&this.documentProps.on(t.setup.reader.ins.position,t.setup.reader.ins.enabled,t.setup.tours.outs.tourIndex,t.setup.navigation.ins.isInUse),this.requestUpdate()}mobileCheck(){var e,t=!1;return e=navigator.userAgent||navigator.vendor,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t}};X=Y([(0,N.Mo)("sv-content-view")],X);const J=X;var ee=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let te=class extends o.ZP{constructor(){super(),this.mode="radio",this.selectionIndex=-1,this.observer=new MutationObserver(this.onObserver),this.selectedButton=null,this.addEventListener("click",(e=>this.onClick(e)))}firstConnected(){this.classList.add("ff-button-group"),this.parseChildren()}connected(){this.observer.observe(this,{childList:!0})}disconnected(){this.observer.disconnect()}onObserver(e){e.forEach((e=>{"childList"===e.type&&this.parseChildren()}))}onClick(e){let t=e.target;for(;t&&t!==this&&!(t instanceof L.Z);)t=t.parentElement;t instanceof L.Z&&(t.selected?"exclusive"===this.mode&&(t.selected=!1,this.selectedButton=null,this.selectionIndex=-1):(this.selectedButton&&(this.selectedButton.selected=!1),this.selectedButton=t,this.selectedButton.selected=!0,this.selectionIndex=this.getButtons().indexOf(t)))}parseChildren(){const e=this.getButtons();this.selectedButton&&(this.selectionIndex=e.indexOf(this.selectedButton),this.selectionIndex<0&&(this.selectedButton.selected=!1,this.selectedButton=null)),(this.selectionIndex<0||this.selectionIndex>=e.length)&&(this.selectionIndex="radio"===this.mode?0:-1),this.selectionIndex>=0&&(this.selectedButton=e[this.selectionIndex],this.selectedButton.selected=!0)}getButtons(){return this.getChildrenArray().filter((e=>e instanceof L.Z))}};ee([(0,o.Cb)({type:String})],te.prototype,"mode",void 0),ee([(0,o.Cb)({type:Number})],te.prototype,"selectionIndex",void 0),te=ee([(0,o.Mo)("ff-button-group")],te);var ne,ie=n(22040),se=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let re=ne=class extends o.ZP{constructor(){super(...arguments),this.assetPath=""}firstConnected(){super.firstConnected(),this.classList.add("sv-logo")}render(){const e=o.dy`
+ ${ne.defaultSmall} +
`,t=o.dy`
+ ${ne.defaultFull} +
`;return o.dy`
${e}
${t}
`}};re.defaultSmall=o.dy`voyager-75grey`,re.defaultFull=o.dy`voyager-75grey`,se([(0,o.Cb)({type:String})],re.prototype,"assetPath",void 0),re=ne=se([(0,o.Mo)("sv-logo")],re);var oe,ae=n(3388),le=n(43875),ce=n(34287),he=(n(13470),function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o});let de=oe=class extends ce.ZP{constructor(e){super(),this.language=null,this.needsFocus=!1,this.language=e,this.position="center",this.modal=!0,this.url=window.location.href}static show(e,t){const n=new oe(t);return e.appendChild(n),new Promise(((e,t)=>{n.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-share-menu"),this.needsFocus=!0}render(){const e=encodeURIComponent(this.url),t=encodeURI("Check out this interactive 3D model with Smithsonian Voyager:"),n=this.language,i=`http://twitter.com/share?text=${t}&url=${e}`,s=`https://www.facebook.com/sharer/sharer.php?u=${e}`,r=`https://www.linkedin.com/shareArticle?url=${e}&mini=true&title=${t}`,o=``,a=`mailto:?subject=${t}&body=${e}`,l=n.getLocalizedString("Share Experience");return ce.dy` +
this.onKeyDown(e)}> +
+
${l}
+ +
+
+ + + + +
+
${n.getLocalizedString("Embed Link")}
+ +
+ `}update(e){if(super.update(e),this.needsFocus){this.getElementsByClassName("sv-share-button-twitter").item(0).focus(),this.needsFocus=!1}}onClickCopy(){this.getElementsByTagName("ff-text-edit").item(0).select(),document.execCommand("copy")}onKeyDown(e){"Escape"===e.code?(e.preventDefault(),this.close()):"Tab"===e.code&&(0,E.e)((0,E.G)(this),e)}};de=oe=he([(0,ce.Mo)("sv-share-menu")],de);const ue=de;var pe,fe=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let me=pe=class extends ce.ZP{constructor(e,t){super(),this.language=null,this.imageUri=null,this.needsFocus=!1,this.language=e,this.imageUri=t,this.position="center",this.modal=!0,this.url=window.location.href}static show(e,t,n){const i=new pe(t,n);return e.appendChild(i),new Promise(((e,t)=>{i.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-ar-code"),this.needsFocus=!0}render(){const e=this.language,t=e.getLocalizedString("AR Experience");return ce.dy` +
this.onKeyDown(e)}> +
+
${t}
+ +
+
${e.getLocalizedString("1. Scan the code with your mobile device to return here.")}
+
+ +
+
${e.getLocalizedString("2. Tap ")}${e.getLocalizedString(" to launch an AR experience! ")}
+
+ `}update(e){if(super.update(e),this.needsFocus){this.getElementsByClassName("ff-close-button").item(0).focus(),this.needsFocus=!1}}onKeyDown(e){"Escape"===e.code?(e.preventDefault(),this.close()):"Tab"===e.code&&(0,E.e)((0,E.G)(this),e)}};me=pe=fe([(0,ce.Mo)("sv-ar-code")],me);const ge=me;var Ae=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let ve=class extends N.ZP{constructor(){super(...arguments),this.documentProps=new h.Z("value",this.onUpdate,this),this.shareButtonSelected=!1,this.resizeObserver=null,this.isClipped=!1}get fullscreen(){return this.system.getMainComponent(i.Z)}get toolProvider(){return this.system.getMainComponent(ie.Z)}get analytics(){return this.system.getMainComponent(u.Z)}get arManager(){return this.system.getMainComponent(s.Z)}get sceneNode(){return this.system.getComponent($.Z)}firstConnected(){super.firstConnected(),this.classList.add("sv-main-menu")}connected(){super.connected(),this.fullscreen.outs.fullscreenActive.on("value",this.onUpdate,this),this.toolProvider.ins.visible.on("value",this.onUpdate,this),this.activeDocument.setup.language.outs.language.on("value",this.onUpdate,this),this.activeDocument.setup.audio.outs.narrationEnabled.on("value",this.onUpdate,this),this.activeDocument.setup.tours.ins.closed.on("value",this.setTourFocus,this),this.activeDocument.setup.reader.ins.closed.on("value",this.setReaderFocus,this),this.activeDocument.setup.viewer.ins.annotationExit.on("value",this.setAnnotationFocus,this),this.toolProvider.ins.closed.on("value",this.setToolsFocus,this),this.resizeObserver||(this.resizeObserver=new ResizeObserver((()=>this.onResize()))),this.resizeObserver.observe(this)}disconnected(){this.resizeObserver.disconnect(),this.toolProvider.ins.closed.off("value",this.setToolsFocus,this),this.activeDocument.setup.viewer.ins.annotationExit.off("value",this.setAnnotationFocus,this),this.activeDocument.setup.reader.ins.closed.off("value",this.setReaderFocus,this),this.activeDocument.setup.tours.ins.closed.off("value",this.setTourFocus,this),this.activeDocument.setup.audio.outs.narrationEnabled.off("value",this.onUpdate,this),this.activeDocument.setup.language.outs.language.off("value",this.onUpdate,this),this.toolProvider.ins.visible.off("value",this.onUpdate,this),this.fullscreen.outs.fullscreenActive.off("value",this.onUpdate,this),super.disconnected()}render(){const e=this.activeDocument;if(!e)return N.dy``;const t=!!this.system.getComponent("CVStoryApplication",!0),n=e.setup,i=this.sceneNode,s=n.tours.outs.count.value>0,r=n.tours.ins.enabled.value,o=r&&!t,a=n.reader.articles.length>0,l=n.reader.ins.enabled.value,c=i.getGraphComponents(H.Z).some((e=>e.hasAnnotations)),h=n.viewer.ins.annotationsVisible.value,d=this.fullscreen,u=d.outs.fullscreenAvailable.value,p=d.outs.fullscreenActive.value,f=n.interface.ins.tools.value,m=this.toolProvider.ins.visible.value,g=n.audio.outs.narrationEnabled.value,A=n.audio.outs.narrationPlaying.value,v=n.language,y=i.getGraphComponents(ae.Z);let b=!1;y.forEach((e=>{b=e.derivatives.getByQuality(le.$l.AR).length>0||b}));const _=(this.arManager.outs.available.value||this.arManager.arCodeImage)&&b&&y.length>=1;return N.dy` + ${_?N.dy``:null} + ${g?N.dy``:null} + ${s?N.dy``:null} + ${a?N.dy``:null} + ${c?N.dy``:null} + + ${u?N.dy``:null} + ${f?N.dy``:null}`}onToggleReader(){const e=this.activeDocument.setup.reader,t=e.ins;t.enabled.setValue(!t.enabled.value),t.focus.setValue(t.enabled.value),t.enabled.value&&t.articleId.setValue(1===e.articles.length?e.articles[0].article.id:""),this.analytics.sendProperty("Reader_Enabled",t.enabled.value)}onToggleTours(){const e=this.activeDocument.setup.tours.ins,t=this.activeDocument.setup.reader.ins;e.enabled.value?e.enabled.setValue(!1):(t.enabled.value&&t.enabled.setValue(!1),e.enabled.setValue(!0),e.tourIndex.setValue(-1)),this.analytics.sendProperty("Tours_Enabled",e.enabled.value)}onToggleAnnotations(){const e=this.toolProvider.ins,t=this.activeDocument.setup.viewer.ins;e.visible.value&&e.visible.setValue(!1),t.annotationsVisible.setValue(!t.annotationsVisible.value),this.analytics.sendProperty("Annotations_Visible",t.annotationsVisible.value)}onToggleShare(){this.shareButtonSelected||(this.shareButtonSelected=!0,this.requestUpdate(),ue.show(this,this.activeDocument.setup.language).then((()=>{this.shareButtonSelected=!1,this.requestUpdate(),this.setElementFocus("share-btn")})),this.analytics.sendProperty("Menu_Share"))}onToggleFullscreen(){this.fullscreen.toggle(),this.analytics.sendProperty("Menu_Fullscreen")}onToggleTools(){const e=this.toolProvider.ins,t=this.activeDocument.setup.viewer.ins;t.annotationsVisible.value&&t.annotationsVisible.setValue(!1),e.visible.setValue(!e.visible.value),this.analytics.sendProperty("Tools_Visible",e.visible.value)}onEnterAR(){const e=this.arManager,t=e.ins;e.outs.available.value?t.enabled.setValue(!0):ge.show(this.parentElement.parentElement.parentElement,this.activeDocument.setup.language,e.arCodeImage).then((()=>{this.setElementFocus("ar-btn")}))}onToggleNarration(){const e=this.activeDocument.setup.audio;e.setupAudio(),e.ins.playNarration.set()}setTourFocus(){this.setElementFocus("tour-btn")}setReaderFocus(){this.setElementFocus("reader-btn")}setToolsFocus(){this.setElementFocus("tools-btn")}setAnnotationFocus(){this.setElementFocus("anno-btn")}setElementFocus(e){const t=this.getElementsByTagName("ff-button"),n=Array.from(t).find((t=>t.id===e));void 0!==n?n.focus():console.warn("Can't focus. Element ["+e+"] not found.")}onActiveDocument(e,t){if(e&&this.documentProps.off(),t){const e=t.setup;this.documentProps.on(e.interface.ins.tools,e.reader.ins.enabled,e.reader.outs.count,e.tours.ins.enabled,e.tours.outs.count,e.viewer.ins.annotationsVisible,e.audio.outs.narrationPlaying,this.toolProvider.ins.visible)}this.requestUpdate()}onResize(){const e=this.scrollHeight>this.clientHeight;this.isClipped!==e&&(e&&this.scrollTo({top:this.scrollTop+this.scrollHeight,behavior:"smooth"}),this.isClipped=e)}};ve=Ae([(0,N.Mo)("sv-main-menu")],ve);var ye=n(93072),be=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let _e=class extends A.ZP{constructor(){super(...arguments),this.needsFocus=!1}get toolProvider(){return this.system.getMainComponent(ie.Z)}get language(){return this.system.getComponent(ye.Z)}firstConnected(){super.firstConnected(),this.classList.add("sv-bottom-bar-container","sv-tool-bar"),this.needsFocus=!0}connected(){super.connected(),this.toolProvider.on("active-component",this.onUpdate,this),this.language.outs.language.on("value",this.onUpdate,this)}disconnected(){this.language.outs.language.off("value",this.onUpdate,this),this.toolProvider.off("active-component",this.onUpdate,this),super.disconnected()}render(){const e=this.toolProvider.scopedComponents,t=this.toolProvider.activeComponent,n=this.language,i=(t&&A.dy`
`,e.map((e=>A.dy`this.onSelectTool(e)}>`)));return A.dy`
this.onKeyDownTool(e)}>${t?t.createView():null}
+
`}onSelectTool(e){this.toolProvider.activeComponent=e}onClose(e){this.dispatchEvent(new CustomEvent("close")),e.stopPropagation()}update(e){if(super.update(e),this.needsFocus){this.getElementsByClassName("sv-tool-button").item(0).focus(),this.needsFocus=!1}}onKeyDownMain(e){if("Escape"===e.code)e.preventDefault(),this.dispatchEvent(new CustomEvent("close"));else if("Tab"===e.code){const t=Array.from(this.getElementsByTagName("div")).find((e=>"mainmenu"===e.id));(0,E.e)((0,E.G)(t),e)}}onKeyDownTool(e){if("Escape"===e.code)e.preventDefault(),this.closeTool();else if("Tab"===e.code){const t=Array.from(this.getElementsByTagName("div")).find((e=>"toolmenu"===e.id));(0,E.e)((0,E.G)(t),e)}}closeTool(){const e=this.getElementsByTagName("ff-button");Array.from(e).find((e=>e.getAttribute("text")===this.language.getLocalizedString(this.toolProvider.activeComponent.text))).focus(),this.toolProvider.activeComponent=null}};_e=be([(0,A.Mo)("sv-tool-bar")],_e);var xe=n(40490),we=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let Ee=class extends N.ZP{constructor(){super(...arguments),this.needsFocus=!1,this.firstRender=!0,this.stepTitle=""}firstConnected(){super.firstConnected(),this.classList.add("sv-bottom-bar-container","sv-tour-navigator"),this.needsFocus=!0}render(){const e=this.tours,t=this.language,n=this.interface,i=e.activeTour;let s,r;if(e&&i){const n=e.outs.stepIndex.value+1,i=e.outs.stepCount.value;s=i>0?e.stepTitle:e.title,r=i>0?`${t.getLocalizedString("Step")} ${n} ${t.getLocalizedString("of")} ${i}`:t.getLocalizedString("No tour steps defined")}else s=t.getLocalizedString("No tour selected"),r="---";this.stepTitle=s,this.firstRender&&(s="");const o=n.isShowing(xe.p.tour_exit)?N.dy``:null;return N.dy`
this.onKeyDown(e)}>
+ ${o} +
+
${s}
+
${r}
+
+ + + +
`}updated(e){if(super.updated(e),this.needsFocus){this.getElementsByClassName("sv-section-trail").item(2).focus(),this.needsFocus=!1}const t=this.getElementsByClassName("sv-title").item(0);t&&(this.firstRender?(setTimeout((()=>{t.innerText=this.stepTitle}),100),this.firstRender=!1):t.innerText=this.stepTitle)}onClickExit(){this.tours.ins.enabled.setValue(!1),this.tours.ins.closed.set()}onClickMenu(){this.tours.ins.tourIndex.setValue(-1)}onClickPrevious(){this.tours.ins.previous.set();this.querySelector("#title-inner").classList.remove("sv-text-scroll")}onClickNext(){this.tours.ins.next.set();this.querySelector("#title-inner").classList.remove("sv-text-scroll")}onClickTitle(){this.textHelper()}onActiveDocument(e,t){e&&(this.tours.outs.tourIndex.off("value",this.onUpdate,this),this.tours.outs.stepIndex.off("value",this.onUpdate,this),this.language.outs.language.off("value",this.onUpdate,this)),t&&(this.tours=t.setup.tours,this.language=t.setup.language,this.interface=t.setup.interface,this.tours.outs.tourIndex.on("value",this.onUpdate,this),this.tours.outs.stepIndex.on("value",this.onUpdate,this),this.language.outs.language.on("value",this.onUpdate,this)),this.requestUpdate()}onKeyDown(e){"Escape"===e.code?(e.preventDefault(),this.tours.ins.tourIndex.setValue(-1)):"Tab"===e.code&&(0,E.e)((0,E.G)(this),e)}textHelper(){const e=this.querySelector("#title-inner"),t=e.scrollWidth-e.offsetWidth+12;if(t>12){const n=this.querySelector("#title-area"),i=t/30;e.classList.remove("ff-ellipsis"),e.style.setProperty("animation-duration",i.toString()+"s"),e.style.setProperty("--x-offset","-"+t+"px"),n.style.setProperty("pointer-events","none"),e.classList.add("sv-text-scroll"),e.addEventListener("animationend",(()=>{e.classList.remove("sv-text-scroll"),e.classList.add("ff-ellipsis"),n.style.setProperty("pointer-events","auto")})),e.addEventListener("animationcancel",(()=>{e.classList.remove("sv-text-scroll"),e.classList.add("ff-ellipsis"),n.style.setProperty("pointer-events","auto")}))}}};Ee=we([(0,N.Mo)("sv-tour-navigator")],Ee);var Ce=n(1594),Se=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let Me=class extends o.ZP{constructor(){super(...arguments),this.needsFocus=!1,this.focusableElements=[]}firstConnected(){super.firstConnected(),this.classList.add("sv-document-overlay","sv-article","sv-tour-menu"),this.needsFocus=!0}renderEntry(e,t){return o.dy`
this.onKeyDown(e,t)} class="sv-entry" @click=${e=>this.onClickTour(e,t)}> +
+

${Object.keys(e.titles).length>0?e.titles[Ce.PD[this.activeLanguage]]||"undefined":e.title}

+ +
+

${Object.keys(e.leads).length>0?e.leads[Ce.PD[this.activeLanguage]]:e.lead}

+
`}render(){const e=this.tours;return 0===e.length?o.dy`
+

No tours available.

+
`:o.dy`
+ ${e.map(((e,t)=>this.renderEntry(e,t)))} +
`}update(e){if(super.update(e),this.needsFocus){this.getElementsByClassName("sv-entry").item(0).focus(),this.needsFocus=!1}}onClickTour(e,t){e.stopPropagation(),this.dispatchEvent(new CustomEvent("select",{detail:{index:t}}))}onKeyDown(e,t){if("Space"===e.code||"Enter"===e.code)e.preventDefault(),this.dispatchEvent(new CustomEvent("select",{detail:{index:t}}));else if("Escape"===e.code)e.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{index:t}}));else if("Tab"===e.code)0===this.focusableElements.length&&(this.focusableElements=(0,E.G)(this)),(0,E.e)(this.focusableElements,e);else if("ArrowUp"===e.code||"ArrowDown"===e.code){const t=e.target instanceof Element?e.target:null;if(t){const n="ArrowUp"===e.code?t.previousElementSibling:t.nextElementSibling;n&&(t.setAttribute("tabIndex","-1"),n.setAttribute("tabIndex","0"),n.focus())}}}};Se([(0,o.Cb)({attribute:!1})],Me.prototype,"tours",void 0),Se([(0,o.Cb)({attribute:!1})],Me.prototype,"activeLanguage",void 0),Me=Se([(0,o.Mo)("sv-tour-menu")],Me);var Ie,Te=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let Pe=Ie=class extends ce.ZP{constructor(e){super(),this.language=null,this.language=e,this.position="center",this.modal=!0,this.url=window.location.href}static show(e,t){const n=new Ie(t);return e.appendChild(n),new Promise(((e,t)=>{n.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-language-menu","sv-option-menu")}renderEntry(e,t){const n=e.name===this.language.nameString();return ce.dy`
this.onClickLanguage(e,t)} @keydown=${e=>this.onKeyDownEntry(e,t)} ?selected=${n}> + ${e.name} +
`}render(){const e=this.language;return ce.dy` +
this.onKeyDownMain(e)}> +
+
${e.getLocalizedString("Set Language")}
+ +
+
+
+ ${e.activeLanguages.map(((e,t)=>this.renderEntry(e,t)))} +
+
+
+ `}firstUpdated(e){super.firstUpdated(e),Array.from(this.getElementsByClassName("sv-entry")).find((e=>"0"===e.getAttribute("tabIndex"))).focus()}onClickLanguage(e,t){const n=this.language;e.stopPropagation(),n.ins.language.setValue(n.activeLanguages[t].id),this.close()}onKeyDownEntry(e,t){const n=this.language;if("Space"===e.code||"Enter"===e.code)e.preventDefault(),e.stopPropagation(),n.ins.language.setValue(n.activeLanguages[t].id),this.close();else if("ArrowUp"===e.code||"ArrowDown"===e.code){const t=e.target instanceof Element?e.target:null;if(t){const n="ArrowUp"===e.code?t.previousElementSibling:t.nextElementSibling;n&&(t.setAttribute("tabIndex","-1"),n.setAttribute("tabIndex","0"),n.focus())}}else"Tab"===e.code&&this.addEventListener("blur",this.tabReset,{once:!0,capture:!0})}onKeyDownMain(e){"Escape"===e.code?this.close():"Tab"===e.code&&(0,E.e)((0,E.G)(this),e)}tabReset(e){const t=e.target instanceof Element?e.target:null;if(t){const e=Array.from(t.parentElement.children).find((e=>e.hasAttribute("selected")));e!==t&&(t.setAttribute("tabIndex","-1"),e.setAttribute("tabIndex","0"))}}};Pe=Ie=Te([(0,ce.Mo)("sv-language-menu")],Pe);const Be=Pe;var Re=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let De=class extends N.ZP{get activeTags(){return this.viewer?this.viewer.ins.activeTags.value.split(",").map((e=>e.trim())).filter((e=>!!e)):[]}get tagCloud(){return this.viewer?this.viewer.outs.tagCloud.value.split(",").map((e=>e.trim())).filter((e=>!!e)):[]}firstConnected(){super.firstConnected(),this.classList.add("sv-bottom-bar-container","sv-tag-cloud","sv-transition"),setTimeout((()=>this.classList.remove("sv-transition")),1)}render(){const e=this.activeTags,t=this.tagCloud.map((t=>N.dy`=0} + @click=${e=>this.onSelectTag(t)}>`));return N.dy`
+ +
${t}
+
`}onClickClose(){this.viewer.ins.annotationsVisible.setValue(!1),this.viewer.ins.annotationExit.set()}onSelectTag(e){let t=this.activeTags;const n=this.viewer.ins.radioTags.value,i=t.indexOf(e);i>=0&&!n?t.splice(i,1):i<0&&(n?t=[e]:t.push(e)),this.viewer.ins.activeTags.setValue(t.join(", "))}onActiveDocument(e,t){e&&(this.viewer.ins.activeTags.off("value",this.onUpdate,this),this.viewer.outs.tagCloud.off("value",this.onUpdate,this)),t&&(this.viewer=t.setup.viewer,this.viewer.ins.activeTags.on("value",this.onUpdate,this),this.viewer.outs.tagCloud.on("value",this.onUpdate,this))}onKeyDown(e){"Escape"===e.code?(e.preventDefault(),this.onClickClose()):"Tab"===e.code&&(0,E.e)((0,E.G)(this),e)}};De=Re([(0,N.Mo)("sv-tag-cloud")],De);var Le,Ne,ke=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};!function(e){e[e.Nav=0]="Nav",e[e.Menu=1]="Menu"}(Ne||(Ne={}));let Oe=Le=class extends ce.ZP{constructor(e){super(),this.language=null,this.helpView=Ne.Nav,this.language=e,this.position="center",this.modal=!0,this.url=window.location.href}static show(e,t){const n=new Le(t);return e.appendChild(n),new Promise(((e,t)=>{n.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.classList.add("sv-main-help")}render(){const e=this.language,t=this.helpView,n=!!this.parentElement.querySelector("#ar-btn"),i=!!this.parentElement.querySelector("#audio-btn"),s=!!this.parentElement.querySelector("#tour-btn"),r=!!this.parentElement.querySelector("#reader-btn"),o=!!this.parentElement.querySelector("#anno-btn"),a=!!this.parentElement.querySelector("#fullscreen-btn"),l=!!this.parentElement.querySelector("#tools-btn"),c=ce.dy`
+
+ +
Orbit
+
${Le.leftClick}Left-click and drag
+
Or.
+
${Le.oneFinger}One-finger drag
+
Or.
+
${Le.arrowKeys}Arrow keys
+
+
+ +
Pan
+
${Le.rightClick}Right-click and drag
+
Or.
+
${Le.twoFinger}Two-finger drag
+
Or.
+
Shift + ${Le.arrowKeys}Arrow keys
+
+
+ +
Zoom
+
${Le.mouseWheel}Mouse wheel
+
Or.
+
${Le.pinch}Two-finger pinch
+
Or.
+
Ctrl + ${Le.arrowKeys}Arrow keys
+
+
+
`,h=ce.dy`
The tools below can be accessed by clicking the corresponding icons on the menu bar to the left of the screen.
+
+ ${n?ce.dy`
+ +
Launch an augmented
reality experience.
+
`:""} + ${i?ce.dy`
+ +
Hear an audio
narration of the scene.
+
`:""} + ${s?ce.dy`
+ +
Take a curated guided
tour of the scene.
+
`:""} + ${r?ce.dy`
+ +
Read articles about
the scene content.
+
`:""} + ${o?ce.dy`
+ +
Show annotations
highlighting key points.
+
`:""} +
+ +
Share the experience
with a friend!
+
+ ${a?ce.dy`
+ +
View the experience
in fullscreen mode.
+
`:""} + ${l?ce.dy`
+ +
Open the advanced
tool menu.
+
`:""} +
`;return ce.dy` +
this.onKeyDownMain(e)}> +
+
${e.getLocalizedString("Introduction to Voyager")}
+ +
+
+ this.onClickSection(e,Ne.Nav)}> + this.onClickSection(e,Ne.Menu)}> +
+ ${t===Ne.Nav?c:h} +
+ `}firstUpdated(e){super.firstUpdated(e),Array.from(this.getElementsByClassName("ff-button")).find((e=>"Navigation"===e.getAttribute("text"))).focus(),setTimeout((()=>{this.querySelector("#sr-trigger").textContent="section end"}),100)}onClickSection(e,t){this.helpView=t,this.requestUpdate()}onKeyDownMain(e){"Escape"===e.code?this.close():"Tab"===e.code&&(0,E.e)((0,E.G)(this),e)}tabReset(e){const t=e.target instanceof Element?e.target:null;if(t){const e=Array.from(t.parentElement.children).find((e=>e.hasAttribute("selected")));e!==t&&(t.setAttribute("tabIndex","-1"),e.setAttribute("tabIndex","0"))}}};Oe.leftClick=ce.dy``,Oe.rightClick=ce.dy``,Oe.mouseWheel=ce.dy``,Oe.pinch=ce.dy` + + + `,Oe.oneFinger=ce.dy` + + + `,Oe.twoFinger=ce.dy` + + + `,Oe.arrowKeys=ce.dy` + + + + `,Oe=Le=ke([(0,ce.Mo)("sv-main-help")],Oe);const Ue=Oe;var Fe,Ve=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let Qe=Fe=class extends ce.ZP{constructor(e,t){super(),this.language=null,this.content="",this.language=e,this.content=t,this.position="center",this.modal=!0,this.url=window.location.href}static show(e,t,n){const i=new Fe(t,n);return e.appendChild(i),new Promise(((e,t)=>{i.on("close",(()=>e()))}))}close(){this.dispatchEvent(new CustomEvent("close")),this.remove()}firstConnected(){super.firstConnected(),this.contentElement=this.createElement("div",null),this.classList.add("sv-splash")}render(){const e=this.language,t=this.contentElement;return t.innerHTML=this.content,ce.dy` +
this.onKeyDownMain(e)}> +
+
${e.getLocalizedString("Welcome to Voyager")}
+ +
+
+ ${t} +
+
+ `}firstUpdated(e){super.firstUpdated(e),this.querySelector("#main").focus()}onKeyDownMain(e){"Escape"===e.code?this.close():"Tab"===e.code&&(0,E.e)((0,E.G)(this),e)}};Qe=Fe=Ve([(0,ce.Mo)("sv-splash")],Qe);const ze=Qe;var Ge=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};let je=class extends N.ZP{constructor(){super(...arguments),this.documentProps=new h.Z("value",this.onUpdate,this),this.assetPath="",this.needsSplash=!0}get toolProvider(){return this.system.getMainComponent(ie.Z)}get assetReader(){return this.system.getMainComponent(K.Z)}firstConnected(){this.style.pointerEvents="none",this.setAttribute("pointer-events","none"),this.classList.add("sv-chrome-view")}connected(){super.connected(),this.toolProvider.ins.visible.on("value",this.onUpdate,this),this.activeDocument.setup.language.outs.language.on("value",this.onUpdate,this),this.activeDocument.setup.audio.outs.isPlaying.on("value",this.onUpdate,this),this.activeDocument.setup.audio.outs.narrationPlaying.on("value",this.onUpdate,this),this.activeDocument.setup.audio.ins.captionsEnabled.on("value",this.onUpdate,this),this.titleElement=this.createElement("div",null),this.titleElement.classList.add("ff-ellipsis"),this.assetPath=this.assetReader.getSystemAssetUrl("")}disconnected(){this.activeDocument.setup.audio.ins.captionsEnabled.off("value",this.onUpdate,this),this.activeDocument.setup.audio.outs.narrationPlaying.off("value",this.onUpdate,this),this.activeDocument.setup.audio.outs.isPlaying.off("value",this.onUpdate,this),this.activeDocument.setup.language.outs.language.off("value",this.onUpdate,this),this.toolProvider.ins.visible.off("value",this.onUpdate,this),super.disconnected()}render(){const e=this.activeDocument,t=this.titleElement;if(!e)return N.dy``;const n=e.setup,i=n.interface.ins.visible.value,s=n.interface.ins.logo.value&&n.interface.isShowing(xe.p.logo),r=n.interface.ins.menu.value&&n.interface.isShowing(xe.p.menu),o=n.interface.ins.visibleElements.value&&n.interface.isShowing(xe.p.title),a=n.interface.ins.visibleElements.value&&n.interface.isShowing(xe.p.help),l=n.reader.ins.enabled.value,c=n.tours.tours,h=n.tours.ins.enabled.value,d=n.tours.outs.tourIndex.value>=0,u=n.language,p=u.activeLanguages,f=u.outs.language.value,m=p.length>1&&n.interface.isShowing(xe.p.language),g=n.audio.outs.isPlaying.value,A=n.audio.ins.captionsEnabled.value,v=n.audio.outs.narrationPlaying.value,y=!!this.system.getComponent("CVStoryApplication",!0)||!h,b=n.viewer.ins.annotationsVisible.value&&n.viewer.outs.tagCloud.value,_=!l&&this.toolProvider.ins.visible.value,x=this.activeDocument.setup.tours.outs.ending.value;this.activeDocument.setup.tours.outs.ending.setValue(!1);const w=this.activeDocument.outs.intro.value;if(w&&(this.needsSplash&&w.length>0&&ze.show(this,this.activeDocument.setup.language,w).then((()=>{this.getRootNode().getElementById("sv-scene").focus()})),this.needsSplash=!1),!i)return N.dy``;let E;return E=h?d?u.getLocalizedString("Tour")+": "+n.tours.outs.tourTitle.value:u.getLocalizedString("Interactive Tours"):e.outs.title.value||"Missing Title",t.innerHTML=E,N.dy`${x?N.dy``:null} + ${v?N.dy`
${n.audio.getPlayerById(n.audio.narrationId)}
`:null} +
+
+ ${r?N.dy``:null} +
+
+ ${o?N.dy`
${t}
`:null} + ${s?N.dy``:null} +
+
+
+ ${h&&d?N.dy``:null} + ${h&&!d?N.dy``:null} + ${b&&y?N.dy``:null} + ${_&&y?N.dy`
`:null} + `}onSelectTour(e){this.activeDocument.setup.tours.ins.tourIndex.setValue(e.detail.index)}closeTours(){const e=this.activeDocument.setup.tours;e.ins.enabled.setValue(!1),e.ins.closed.set()}updateCaptions(){const e=this.activeDocument.setup.audio.ins;e.captionsEnabled.setValue(!e.captionsEnabled.value)}openLanguageMenu(){const e=this.activeDocument.setup.language;e.ins.enabled.value||(e.ins.enabled.setValue(!0),Be.show(this,this.activeDocument.setup.language).then((()=>{e.ins.enabled.setValue(!1),this.querySelector("#language").focus()})))}openHelp(){this.activeDocument.setup.language;Ue.show(this,this.activeDocument.setup.language).then((()=>{this.querySelector("#main-help").focus()}))}closeTools(){const e=this.toolProvider.ins;e.visible.setValue(!1),e.closed.set()}onActiveDocument(e,t){if(e&&this.documentProps.off(),t){const e=t.setup;this.documentProps.on(t.outs.title,t.outs.assetPath,e.interface.ins.visible,e.interface.ins.logo,e.interface.ins.menu,e.viewer.ins.annotationsVisible,e.reader.ins.enabled,e.tours.ins.enabled,e.tours.outs.tourIndex)}this.requestUpdate()}};je=Ge([(0,N.Mo)("sv-chrome-view")],je);const He=je;var $e=function(e,t,n,i){var s,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o};a.Z.add("globe",o.dy``),a.Z.add("cog",o.dy``),a.Z.add("eye",o.dy``),a.Z.add("palette",o.dy``),a.Z.add("comment",o.dy``),a.Z.add("article",o.dy``),a.Z.add("document",o.dy``),a.Z.add("share",o.dy``),a.Z.add("expand",o.dy``),a.Z.add("zoom",o.dy``),a.Z.add("tools",o.dy``),a.Z.add("environment",o.dy``),a.Z.add("bulb",o.dy``),a.Z.add("spot",o.dy``),a.Z.add("area",o.dy``),a.Z.add("sun",o.dy``),a.Z.add("half-sun",o.dy``),a.Z.add("tape",o.dy``),a.Z.add("knife",o.dy``),a.Z.add("bars",o.dy``),a.Z.add("triangle-left",o.dy``),a.Z.add("triangle-right",o.dy``),a.Z.add("twitter",o.dy``),a.Z.add("facebook",o.dy``),a.Z.add("instagram",o.dy``),a.Z.add("linkedin",o.dy``),a.Z.add("email",o.dy``),a.Z.add("copy",o.dy``),a.Z.add("ar",o.dy``),a.Z.add("device-move",o.dy``),a.Z.add("audio",o.dy``),a.Z.add("help",o.dy`?`),a.Z.add("move",o.dy``),a.Z.add("rotate",o.dy``),a.Z.add("pause",o.dy``),a.Z.add("caption",o.dy``);let We=class extends o.ZP{constructor(e){super(),this.application=null,e&&(this.application=e),this.addEventListener("focus",this.onFocus)}static get observedAttributes(){return["root","document"]}get fullscreen(){return this.application.system.getMainComponent(i.Z)}get arManager(){return this.application.system.getMainComponent(s.Z)}get viewer(){return this.application.system.getComponent(r.Z)}firstConnected(){if(super.firstConnected(),!this.application){const e={root:this.getAttribute("root"),dracoRoot:this.getAttribute("dracoRoot"),resourceRoot:this.getAttribute("resourceRoot"),document:this.getAttribute("document"),model:this.getAttribute("model"),geometry:this.getAttribute("geometry"),texture:this.getAttribute("texture"),quality:this.getAttribute("quality"),uiMode:this.getAttribute("uiMode"),bgColor:this.getAttribute("bgColor"),bgStyle:this.getAttribute("bgStyle"),controls:this.getAttribute("controls"),prompt:this.getAttribute("prompt"),reader:this.getAttribute("reader"),lang:this.getAttribute("lang")};this.application=new c.Z(null,e)}this.attachShadow({mode:"open"});const e=this.shadowRoot;var t=document.createElement("style");t.innerText='/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:normal;-webkit-text-size-adjust:100%}body{margin:0}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.ff-fullsize{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box}.ff-container{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;overflow:hidden}.ff-fullsize{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box}.ff-caret-down{width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-bottom:5px solid #a0a0a0;transform:rotate(180deg);transition:transform .05s}.ff-caret-up{width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-bottom:5px solid #a0a0a0;transform:rotate(0deg);transition:transform .05s}.ff-caret-right{width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-bottom:5px solid #a0a0a0;transform:rotate(90deg);transition:transform .05s}.ff-caret-left{width:0;height:0;border-left:5px solid rgba(0,0,0,0);border-right:5px solid rgba(0,0,0,0);border-bottom:5px solid #a0a0a0;transform:rotate(270deg);transition:transform .05s}html{color:#c8c8c8}button,input{display:block;padding:0;margin:0;border:none;background-color:inherit;color:inherit;font-size:inherit;cursor:inherit}*:focus{outline:1px solid #0089bf;outline-offset:0}*:focus:not(:focus-visible){outline:0}*:focus-visible{outline:1px solid #0089bf;outline-offset:0}.ff-fullscreen{position:fixed;left:0;right:0;top:0;bottom:0}.ff-noselect{user-select:none;-moz-user-select:none;-webkit-user-select:none}.ff-off{user-select:none;-moz-user-select:none;-webkit-user-select:none;pointer-events:none}.ff-on{user-select:auto;-webkit-user-select:none;pointer-events:auto}.ff-focusable{tab-index:0}.ff-flex-row{display:flex}.ff-flex-column{display:flex;flex-direction:column}.ff-flex-wrap{flex-wrap:wrap}.ff-flex-centered{align-items:center}.ff-flex-item-fixed{flex:0 0 auto;position:relative}.ff-flex-item-stretch,.ff-flex-spacer{flex:1 1 auto;position:relative}.ff-scroll-y{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;overflow-y:auto}.ff-position-above{position:absolute;bottom:0}.ff-position-below{position:absolute;top:100%}.ff-position-left{position:absolute;right:0}.ff-position-right{position:absolute;left:100%}.ff-position-above.ff-align-left,.ff-position-below.ff-align-left{left:0}.ff-position-above.ff-align-right,.ff-position-below.ff-align-right{right:0}.ff-position-left.ff-align-top,.ff-position-right.ff-align-top{top:0}.ff-position-left.ff-align-bottom,.ff-position-right.ff-align-bottom{bottom:0}.ff-ellipsis{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ff-placeholder{flex:1 1 auto;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.ff-splitter-section{flex:1 1 auto;position:relative;box-sizing:border-box;overflow:hidden}.ff-splitter[direction=vertical]+.ff-splitter-section{border-top:2px solid #1b1b1b}.ff-splitter:not([direction=vertical])+.ff-splitter-section{border-left:2px solid #1b1b1b}.ff-frame{padding:4px}.ff-frame .ff-control{margin:4px}.ff-icon{display:inline-block;position:relative;height:1rem;fill:#a0a0a0}.ff-icon svg{width:inherit;height:inherit}.ff-button{cursor:pointer}.ff-button[vertical]{flex-direction:column}.ff-button.ff-inline .ff-icon+.ff-text{padding-left:.5em}.ff-button.ff-inline .ff-icon{display:inline}.ff-button.ff-inline .ff-text{display:inline}.ff-button.ff-transparent{position:relative;display:flex;justify-content:center;align-items:center;flex:0 1 auto;flex-wrap:wrap;padding:5px;background:rgba(0,0,0,0);fill:#a0a0a0;transition:fill .2s}.ff-button.ff-transparent:hover,.ff-button.ff-transparent:focus{fill:#c8c8c8}.ff-button.ff-transparent[selected]{fill:#c8c8c8}.ff-button.ff-transparent>.ff-text{margin:3px;white-space:nowrap}.ff-button.ff-transparent>.ff-icon{margin:3px;height:1.3em}.ff-button.ff-transparent>.ff-caret-down{margin:3px}.ff-button.ff-transparent.ff-disabled{color:gray;fill:#606060;user-select:none;pointer-events:none}.ff-button.ff-control{position:relative;display:flex;justify-content:center;align-items:center;flex:1 1 auto;flex-wrap:wrap;padding:5px;background:#4e4e4e;transition:background-color .2s}.ff-button.ff-control:hover,.ff-button.ff-control:focus{background-color:#676767}.ff-button.ff-control[selected]{background-color:#0089bf}.ff-button.ff-control[selected]:hover,.ff-button.ff-control[selected]:focus{background-color:#00a6e8}.ff-button.ff-control>.ff-text{margin:3px;white-space:nowrap}.ff-button.ff-control>.ff-icon{margin:3px;height:1.3em}.ff-button.ff-control>.ff-caret-down{margin:3px}.ff-button.ff-control.ff-disabled{color:gray;fill:#606060;user-select:none;pointer-events:none}.ff-button.ff-control.ff-disabled>.ff-icon{fill:#606060}.ff-menu{background-color:#4e4e4e;z-index:100;display:flex;flex-direction:column}.ff-menu .ff-divider{height:1px;padding:0;background:#a0a0a0}.ff-menu .ff-button{justify-content:flex-start;margin:0;padding:4px 4px}.ff-menu .ff-button .ff-icon{height:1.2em;width:2.2em;margin-right:4px}.ff-dropdown .ff-menu{min-width:100%;margin-top:3px}.ff-modal-plane{position:fixed;left:0;right:0;top:0;bottom:0;background-color:rgba(0,0,0,.6);opacity:0;transition:opacity .3s;z-index:990;pointer-events:auto}.ff-modal-plane.ff-transition{opacity:1}ff-dialog{box-sizing:border-box;background:#343434;border:1px solid #4e4e4e;box-shadow:3px 3px 24px rgba(0,0,0,.4)}ff-title-bar{background:#1b1b1b;padding:2px}ff-title-bar .ff-text{flex:1 1 auto;padding-right:8px}ff-title-bar .ff-icon{padding:2px}ff-popup-button .ff-content{transition:opacity .15s}.ff-line-edit{display:block;overflow:hidden;background-color:#1b1b1b;min-height:1.2em}.ff-line-edit input{padding:2px}.ff-text-edit{box-sizing:border-box;flex:1 1 auto;display:flex;background-color:#1b1b1b}.ff-text-edit textarea{display:block;box-sizing:border-box;width:100%;padding:2px;resize:none;background:rgba(0,0,0,0);color:inherit;border:none}.ff-color-edit{font-size:.8rem}.ff-color-edit .ff-control{margin:0}.ff-color-edit .ff-slider-controls{align-items:stretch;flex:1 1 auto}.ff-color-edit .ff-numeric-controls{flex:0 0 auto;align-items:center;margin-top:6px}.ff-color-edit .ff-text{color:#a0a0a0;margin:0 3px}.ff-color-edit .ff-line-edit{flex:4 5 auto}.ff-color-edit .ff-line-edit.ff-wide{flex:5 4 auto}.ff-color-edit .ff-knob{margin:-2px 0 0 -2px;border:2px solid #fff;box-shadow:0 0 5px rgba(0,0,0,.5)}.ff-color-edit .ff-vector-slider{flex:1 0 auto;padding:0 10px 10px 0;background-image:linear-gradient(to bottom, transparent, black),linear-gradient(to right, white, red)}.ff-color-edit .ff-vector-slider .ff-knob{width:10px;height:10px}.ff-color-edit .ff-linear-slider{flex:0 0 24px;margin-left:6px;padding-bottom:10px}.ff-color-edit .ff-linear-slider .ff-knob{width:100%;height:10px}.ff-color-edit .ff-hue-slider{background:linear-gradient(to bottom, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)}.ff-color-edit .ff-alpha-slider{color:#4e4e4e}.ff-quad-splitter .ff-left{box-sizing:border-box;border-right:1px solid #343434}.ff-quad-splitter .ff-top{box-sizing:border-box;border-bottom:1px solid #343434}#ff-notification-stack{position:fixed;z-index:100;bottom:0;right:0;width:30%;min-width:250px;max-width:500px}.ff-notification{position:relative;left:0;display:flex;margin:8px;padding:4px;background:#4e4e4e;box-shadow:0 0 20px rgba(0,0,0,.35)}.ff-notification.ff-info>.ff-icon{fill:#73adff}.ff-notification.ff-success>.ff-icon{fill:#8ae65c}.ff-notification.ff-warning>.ff-icon{fill:#e6a345}.ff-notification.ff-error>.ff-icon{fill:#e64545}.ff-notification>.ff-icon{height:2em;padding:8px}.ff-notification.ff-out{transition:left .5s ease-in;left:100%}.ff-notification .ff-text{flex:1;padding:8px;text-overflow:ellipsis;overflow:hidden}.ff-notification .ff-button{flex:0;padding:8px}.ff-message-box{position:relative;min-width:350px;max-width:450px;width:90%;padding:16px;background:#343434;box-shadow:0 0 20px rgba(0,0,0,.35);opacity:0;transition:opacity .15s}.ff-message-box.ff-transition{opacity:1}.ff-message-box .ff-title{align-items:flex-start}.ff-message-box .ff-title .ff-type-icon{margin:0 16px 0 0;height:2.5em}.ff-message-box .ff-title .ff-type-icon[name=prompt]{fill:#e6cf5c}.ff-message-box .ff-title .ff-type-icon[name=info]{fill:#73adff}.ff-message-box .ff-title .ff-type-icon[name=warning]{fill:#e6a345}.ff-message-box .ff-title .ff-type-icon[name=error]{fill:#e64545}.ff-message-box .ff-title .ff-content{flex:1 1 auto;margin:0 0 2em 0}.ff-message-box .ff-title .ff-caption{font-size:1.5em}.ff-message-box .ff-title .ff-text{margin:2em 0 1em 0}.ff-message-box .ff-title .ff-line-edit{margin:0 0 1em 0}.ff-message-box .ff-title .ff-line-edit input{padding:4px}.ff-message-box .ff-title .ff-close-button{margin:0 0 0 16px;padding:0}.ff-message-box .ff-button+.ff-button{margin-left:8px}.ff-popup-options{box-sizing:border-box;background:#343434;border:1px solid #4e4e4e;box-shadow:3px 3px 24px rgba(0,0,0,.4);min-width:6rem}.ff-popup-options button{padding:4px 8px;text-align:start;user-select:none}.ff-popup-options button+button{margin-top:1px}.ff-popup-options button:hover{background-color:#4e4e4e}.ff-popup-options button:focus{outline:none;background-color:#0089bf}.ff-list{flex:1 1 auto;background-color:#272727}.ff-list .ff-list-item{cursor:pointer;user-select:none;padding:2px}.ff-list .ff-list-item:hover{background-color:#343434}.ff-list .ff-list-item[selected]{background-color:#0089bf}.ff-list .ff-list-item+.ff-list-item{border-top:1px solid #343434}.ff-table{position:relative;box-sizing:border-box;width:100%}.ff-table table{box-sizing:border-box;width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}.ff-table tr[selected]{background-color:#0089bf}.ff-table th,.ff-table td{padding:4px}.ff-table th{background-color:#1b1b1b;color:#a0a0a0;text-align:start}.ff-table .ff-table-sort-icon{height:.8em;margin-left:4px;color:#a0a0a0}.ff-tree{position:relative;overflow-y:auto}.ff-tree .ff-tree-node-container{margin-left:-501px;border-top:1px solid #3e3e3e;border-bottom:1px solid #3e3e3e;margin-bottom:-1px}.ff-tree .ff-tree-node{margin-left:500px}.ff-tree .ff-tree-node.ff-inner{background-color:#2f2f2f}.ff-tree .ff-tree-node.ff-leaf{background-color:#3c3c3c}.ff-tree .ff-tree-node.ff-root{background-color:#272727}.ff-tree .ff-tree-node[selected]{background-color:#0089bf}.ff-tree .ff-tree-node .ff-header{position:relative;cursor:pointer;padding-left:14px}.ff-tree .ff-tree-node .ff-header .ff-text{user-select:none}.ff-tree .ff-tree-node.ff-drop-target>.ff-header{outline:1px dashed #0089bf}.ff-tree .ff-tree-node.ff-inner[expanded]>.ff-header:before{content:"";position:absolute;top:.6em;left:3px;width:0;height:0;border-left:4px solid rgba(0,0,0,0);border-right:4px solid rgba(0,0,0,0);border-bottom:4px solid #a0a0a0;transform:rotate(180deg);transition:transform .05s}.ff-tree .ff-tree-node.ff-inner:not([expanded])>.ff-header:before{content:"";position:absolute;top:.6em;left:3px;width:0;height:0;border-left:4px solid rgba(0,0,0,0);border-right:4px solid rgba(0,0,0,0);border-bottom:4px solid #a0a0a0;transform:rotate(90deg);transition:transform .05s}.ff-tree .ff-tree-node.ff-leaf .ff-header{cursor:default}.ff-tree .ff-tree-node .ff-content{margin-left:10px}.ff-tree .ff-tree-node:not([expanded])>.ff-content{display:none}ff-tab-container{background:#343434}ff-tab-container,ff-dock-stack{background:#272727;border:1px solid #1b1b1b}ff-tab-container header,ff-dock-stack header{background:#1b1b1b}ff-tab-header,ff-dock-panel-header{background:#1b1b1b;color:#c8c8c8;padding:1px 3px 2px 2px}ff-tab-header[active],ff-dock-panel-header[active]{background:linear-gradient(#626262, #343434);color:#c8c8c8}ff-tab-header label,ff-dock-panel-header label{pointer-events:none}ff-tab-header .ff-text,ff-dock-panel-header .ff-text{padding:0 1px}ff-tab-header .ff-icon,ff-dock-panel-header .ff-icon{top:1px;height:.8rem;padding:0 1px}.ff-dock-drop-marker{box-sizing:border-box;background:rgba(0,137,191,.3);border:1px solid #0089bf}.ff-viewport-overlay{padding:6px;font-size:.75rem}.ff-viewport-overlay .ff-row{display:flex;justify-content:space-between}.ff-viewport-overlay .ff-labels{display:flex;flex-direction:column}.ff-viewport-overlay .ff-top-left,.ff-viewport-overlay .ff-bottom-left{align-items:flex-start}.ff-viewport-overlay .ff-top-center,.ff-viewport-overlay .ff-bottom-center{align-items:center}.ff-viewport-overlay .ff-top-right,.ff-viewport-overlay .ff-bottom-right{align-items:flex-end}.ff-viewport-overlay .ff-label-box{box-sizing:border-box;padding:1px 8px 2px 8px;background:rgba(0,0,0,.5);border-radius:2em}.sv-article h1{margin:.3em 0;font-family:"Amiri",serif;font-size:2.3em;font-weight:normal;color:#e8e8e8}.sv-article h1:before{content:"";position:absolute;top:0;left:0;width:75px;height:5px;background-color:#0089bf}.sv-article p,.sv-article h2,.sv-article h3,.sv-article h4,.sv-article h5,.sv-article h6,.sv-article ul,.sv-article ol,.sv-article li{font-family:"Hind Siliguri",sans-serif;color:#c8c8c8}.sv-article h2,.sv-article h3,.sv-article h4,.sv-article h5,.sv-article h6{font-size:1.3em;margin:1.2em 0 .8em 0}.sv-article p,.sv-article ul,.sv-article ol{font-size:1.15em;margin:.8em 0}.sv-article p{line-height:1.55em}.sv-article ul{padding-inline-start:2.5em;list-style:disc outside}.sv-article ol{padding-inline-start:2.5em;list-style:decimal outside}.sv-article a:link,.sv-article a:visited,.sv-article a:hover,.sv-article a:active{color:#0089bf}.sv-article img{max-width:100%;height:auto}.sv-article figure{display:table;margin:1rem auto}.sv-article figure.align-left{float:left}.sv-article figure.align-right{float:right}.sv-article figure.image figcaption{color:#999;display:block;margin-top:.25rem;text-align:center;-webkit-user-modify:read-only}.sv-content-view{font-family:"Segoe UI","HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;font-size:.85em;line-height:1.35;color:#c8c8c8;background-color:#343434;position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;overflow:hidden;user-select:none;-moz-user-select:none;-webkit-user-select:none}.sv-logo{flex:0 50 180px;min-width:40px;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;overflow:hidden;height:40px;user-select:none}.sv-logo .sv-short{flex-grow:1;width:0;max-width:40px}.sv-logo .sv-full{flex:1 0 180px;display:flex;height:100%}.sv-logo .sv-full .sv-logo-full{flex:auto;height:100%}.ff-flex-spacer{user-select:none;-moz-user-select:none;-webkit-user-select:none}.sr-only{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}@keyframes spin{100%{transform:rotate(360deg)}}.sv-prompt,.sv-spinner{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;display:flex;justify-content:center;align-items:center;pointer-events:none}.sv-spinner-wheel{height:120px;width:120px;animation:spin 5s linear infinite}*{scrollbar-color:#676767 #1b1b1b;scrollbar-width:thin}* ::-webkit-scrollbar{width:8px;height:8px}* ::-webkit-scrollbar-track{background-color:#1b1b1b}* ::-webkit-scrollbar-thumb{background-color:#676767;border-radius:8px}voyager-explorer{font-size:16px}.sv-content-only .sv-scene-view,.sv-content-stack .sv-scene-view{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;cursor:grab}.sv-content-only .sv-scene-view:focus,.sv-content-stack .sv-scene-view:focus{border:2px solid #bfedff}.sv-content-only .sv-scene-view:focus:not(:focus-visible),.sv-content-stack .sv-scene-view:focus:not(:focus-visible){border:none;outline:0}.sv-content-only .sv-scene-view:focus-visible,.sv-content-stack .sv-scene-view:focus-visible{border:2px solid #bfedff}.sv-reader-container{overflow-y:auto}.sv-content-stack .sv-reader-container{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;margin-top:52px}.sv-content-stack .sv-reader-view{pointer-events:auto;display:flex;justify-content:center}.sv-content-stack .sv-reader-view .sv-left{flex:0 0 52px}.sv-content-stack .sv-reader-view .sv-article{flex:0 2 720px;background-color:rgba(27,34,38,.5);padding-bottom:35px}.sv-content-stack .sv-reader-view .sv-right{flex:0 3 16px;background-color:rgba(27,34,38,.5)}.sv-content-split{display:flex}.sv-content-split .sv-reader-container{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;margin-top:52px}.sv-content-split .sv-scene-view{flex:1 1 60%}.sv-content-split .sv-reader-view{pointer-events:auto;flex:1 1 40%;padding:0 20px}.sv-content-split .sv-reader-view .sv-left{flex:0 0 52px}.sv-content-split .sv-reader-view .sv-article{flex:0 2 720px;background-color:rgba(27,34,38,.5);padding-bottom:35px;padding-right:16px}.sv-content-split .sv-reader-view .sv-right{flex:0 3 16px;background-color:rgba(27,34,38,.5)}.sv-article{position:relative;padding:5px 8px 0 16px;user-select:text;-moz-user-select:text;-webkit-user-select:text}.ff-viewport-overlay{font-size:1em}.sv-scene-view{position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;overflow:hidden}.sv-scene-view.sv-blur{filter:brightness(60%) blur(5px);transition:filter .5s}.sv-annotation{box-sizing:border-box;position:absolute;z-index:1;user-select:none;-moz-user-select:none;-webkit-user-select:none}.sv-annotation a:link,.sv-annotation a:visited,.sv-annotation a:hover,.sv-annotation a:active{color:#0089bf}.sv-annotation img{max-height:120px;max-width:100%}.sv-annotation .sv-img-credit{font-size:x-small}.sv-annotation:has(:focus-visible){outline:none;background-color:rgba(31,36,38,.8);box-shadow:0 0 3pt 2pt #bfedff;opacity:1 !important}.sv-annotation-img{max-width:100%}.sv-circle-annotation{display:flex}.sv-circle-annotation.sv-expanded{z-index:2;width:16%;min-width:180px;max-width:280px}.sv-circle-annotation .sv-marker{background-color:rgba(0,0,0,.65);border-radius:50%;text-align:center;height:18px;aspect-ratio:1/1;border-style:solid;border-width:1px;cursor:pointer;font-size:.9em;color:#fff;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sv-circle-annotation .sv-annotation-body{padding:4px 8px;background-color:rgba(0,0,0,.7);border-radius:4px;margin:0px 1px;width:100%}.sv-circle-annotation .sv-annotation-body .sv-title{padding:0 0 2px 0;font-weight:bold}.sv-circle-annotation .sv-annotation-body p{font-family:"Segoe UI","HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;font-size:.88em;line-height:1.35;color:#c8c8c8;margin:.5em 0}.sv-circle-annotation .sv-annotation-body .ff-button{background:rgba(0,0,0,.01)}.sv-circle-annotation .sv-annotation-body .ff-button:hover{text-decoration:underline}.sv-circle-annotation .sv-annotation-body .sv-content{overflow:hidden;overflow-wrap:break-word}.sv-pin-annotation{padding:0 4px;background-color:rgba(0,0,0,.5);color:#c8c8c8;transform:translate(-50%, -100%)}.sv-scale-annotation{opacity:0;transition:opacity .3s ease-in;position:absolute;color:#000;background-color:#fff;font-weight:bold;border-radius:20px;padding-left:4px;padding-right:4px}.sv-scale-annotation.sv-show{opacity:1}.sv-standard-annotation,.sv-extended-annotation{max-width:20%;min-width:min-content;padding:0 4px;background-color:rgba(0,0,0,.5);color:#c8c8c8;pointer-events:auto;overflow-wrap:normal}.sv-standard-annotation.sv-expanded,.sv-extended-annotation.sv-expanded{width:20%;min-width:180px;background-color:rgba(0,0,0,.8);z-index:2}.sv-standard-annotation.sv-short,.sv-extended-annotation.sv-short{width:unset;min-width:min-content}.sv-standard-annotation.sv-q0,.sv-extended-annotation.sv-q0{transform:translate(0, -100%);border-bottom-style:solid;border-bottom-width:1px;text-align:left}.sv-standard-annotation.sv-q1,.sv-extended-annotation.sv-q1{transform:translate(-100%, -100%);border-bottom-style:solid;border-bottom-width:1px;text-align:right}.sv-standard-annotation.sv-q2,.sv-extended-annotation.sv-q2{transform:translate(-100%, 0);border-top-style:solid;border-top-width:1px;text-align:right}.sv-standard-annotation.sv-q3,.sv-extended-annotation.sv-q3{transform:translate(0, 0);border-top-style:solid;border-top-width:1px;text-align:left}.sv-standard-annotation.sv-static-width,.sv-extended-annotation.sv-static-width{width:fit-content}.sv-standard-annotation .sv-title,.sv-extended-annotation .sv-title{padding:1px 0 2px 0;font-weight:bold;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sv-standard-annotation .sv-title:focus-visible,.sv-extended-annotation .sv-title:focus-visible{outline:none}.sv-standard-annotation .sv-content,.sv-extended-annotation .sv-content{padding:2px 0;height:0;overflow:hidden;overflow-wrap:break-word;transition:height .2s}.sv-standard-annotation p,.sv-extended-annotation p{font-family:"Segoe UI","HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;font-size:.88em;line-height:1.35;color:#c8c8c8;margin:.5em 0}.sv-standard-annotation .ff-button,.sv-extended-annotation .ff-button{background:rgba(0,0,0,.01)}.sv-standard-annotation .ff-button .ff-icon,.sv-extended-annotation .ff-button .ff-icon{fill:#a0a0a0}.sv-standard-annotation .ff-button:hover,.sv-extended-annotation .ff-button:hover{text-decoration:underline}.sv-extended-annotation .sv-title{cursor:pointer}.sv-standard-annotation{pointer-events:none}.sv-standard-annotation.sv-enable-events{pointer-events:auto;cursor:pointer}.sv-annotation-overlay{padding:7px;pointer-events:auto;background-color:rgba(54,61,64,.6);max-width:min(80%, 800px);min-width:50%;max-height:90%;overflow-y:auto;cursor:auto}.sv-annotation-overlay .sv-annotation-body .ff-button{background:rgba(0,0,0,.01)}.sv-annotation-overlay .sv-annotation-body .ff-button:hover{text-decoration:underline}.sv-ar-prompt{flex:1 1 auto;display:flex;flex-direction:column;align-items:center;text-align:center;border-radius:20px;margin:30% 0 0 0;overflow:hidden;background-color:rgba(54,61,64,.6)}.sv-ar-prompt .sv-content{flex:1;width:100%;margin:10px 10px;text-align:center;-webkit-user-select:none;-ms-user-select:none;user-select:none}.sv-ar-prompt .sv-content .sv-ar-icon{height:10em}.sv-ar-menu{display:flex;position:absolute;bottom:0px;flex-direction:row;margin:0 0 6px 6px}.sv-ar-menu>.ff-button{box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);width:38px;height:38px;margin:0 6px 2px 0;background-color:rgba(74,82,87,.5);border-radius:20px;font-size:17px;transition:all .15s;pointer-events:auto}.sv-ar-menu>.ff-button:hover,.sv-ar-menu>.ff-button:focus{outline:none;background-color:rgba(74,82,87,.5);fill:#c8c8c8}.sv-ar-menu>.ff-button[selected]{background-color:#0089bf;color:#f0f0f0}.sv-ar-menu>.ff-button[selected]>.ff-icon{filter:drop-shadow(1px 1px 6px #00648c);fill:#c8c8c8}.sv-ar-menu>.ff-button[selected]:hover,.sv-ar-menu>.ff-button[selected]:focus{background-color:#00a6e8}.sv-ar-code{position:relative;width:420px;max-width:85%;max-height:90%;padding:8px;background:#343434;box-shadow:0 0 20px rgba(0,0,0,.35);pointer-events:auto}.sv-ar-code .ff-title{margin:.5em 0 1em 0}.sv-ar-code .ff-title .ff-icon{height:2em;width:2em;padding:2px;border-radius:20px;background-color:rgba(74,82,87,.5)}.sv-ar-code img{height:250px;margin:auto}.sv-chrome-view{font-family:"Segoe UI","HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400;font-size:.85em;line-height:1.35;color:#c8c8c8;position:absolute;left:0;right:0;top:0;bottom:0;box-sizing:border-box;overflow:hidden;display:flex;flex-direction:column;background:linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.15) 10%, transparent 25%);z-index:3}.sv-chrome-view .ff-button{flex:0 1 auto;box-sizing:border-box}.sv-chrome-view .ff-button:focus{outline:none;box-shadow:0 0 3pt 2pt #bfedff}.sv-chrome-view .ff-button:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-chrome-view .ff-button:focus-visible{outline:none;box-shadow:0 0 3pt 2pt #bfedff}.sv-chrome-view .ff-button:hover{outline:none}.sv-chrome-view .ff-button:hover>.ff-icon{fill:#c8c8c8}.sv-chrome-view .ff-button[selected]{background-color:#0089bf}.sv-chrome-view .ff-button[selected][disabled]{background-color:#4e4e4e}.sv-chrome-view .ff-button[selected]>.ff-icon{filter:drop-shadow(1px 1px 6px #00648c);fill:#c8c8c8}.sv-chrome-header{display:flex;align-items:flex-start;height:100%;position:relative}.sv-chrome-header .sv-top-bar{flex:1 1 auto;display:flex;align-items:flex-start;height:40px;margin:9px 9px 0 0;overflow:hidden}.sv-chrome-header .sv-main-title{flex:1 1 auto;margin:6px 8px;font-family:"Hind Siliguri",sans-serif;font-weight:normal;font-size:1.412em;white-space:pre;color:#e8e8e8;user-select:none;-moz-user-select:none;-webkit-user-select:none}.sv-chrome-header .sv-main-title span{color:rgba(0,0,0,0)}.sv-chrome-footer{display:block;position:absolute;bottom:0;right:0}.sv-chrome-footer .sv-bottom-bar{flex:1 1 auto;display:flex;align-items:flex-end;text-align:right;overflow:hidden}.sv-chrome-footer .sv-bottom-bar>.ff-button{margin:6px 6px 6px 5px;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);width:38px;height:38px;background-color:rgba(31,36,38,.8);border-radius:20px;font-size:17px;transition:all .15s;pointer-events:auto}.sv-chrome-footer .sv-bottom-bar>.ff-button .ff-text{color:#a0a0a0}.sv-chrome-footer .sv-bottom-bar>.ff-button:focus{outline:none;background-color:rgba(31,36,38,.8);box-shadow:0 0 3pt 2pt #bfedff}.sv-chrome-footer .sv-bottom-bar>.ff-button:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-chrome-footer .sv-bottom-bar>.ff-button:focus-visible{outline:none;background-color:rgba(31,36,38,.8);box-shadow:0 0 3pt 2pt #bfedff}.sv-chrome-footer .sv-bottom-bar>.ff-button:hover{background-color:rgba(74,82,87,.5);fill:#c8c8c8}.sv-chrome-footer .sv-bottom-bar>.ff-button:hover>.ff-text{color:#c8c8c8}.sv-chrome-footer .sv-bottom-bar>.ff-button[selected]{background-color:#0089bf;color:#f0f0f0}.sv-chrome-footer .sv-bottom-bar>.ff-button[selected]>.ff-icon{filter:drop-shadow(1px 1px 6px #00648c);fill:#c8c8c8}.sv-chrome-footer .sv-bottom-bar>.ff-button[selected]:hover,.sv-chrome-footer .sv-bottom-bar>.ff-button[selected]:focus{background-color:#00a6e8}.sv-chrome-footer .sv-text-icon{font-family:"Hind Siliguri",sans-serif;font-weight:bold;line-height:25px}.sv-main-menu-wrapper{position:relative;height:100%;min-width:50px}.sv-main-menu{display:flex;flex-direction:column;padding:6px 9px 6px 6px;height:100%;overflow-y:auto;overflow-x:hidden;pointer-events:auto;position:absolute;box-sizing:border-box;overscroll-behavior-y:contain}.sv-main-menu>.ff-button{margin:2px 0;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);width:38px;height:38px;background-color:rgba(31,36,38,.8);border-radius:20px;font-size:17px;transition:all .15s;pointer-events:auto}.sv-main-menu>.ff-button .ff-text{color:#a0a0a0}.sv-main-menu>.ff-button:focus{outline:none;background-color:rgba(31,36,38,.8);box-shadow:0 0 3pt 2pt #bfedff}.sv-main-menu>.ff-button:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-main-menu>.ff-button:focus-visible{outline:none;background-color:rgba(31,36,38,.8);box-shadow:0 0 3pt 2pt #bfedff}.sv-main-menu>.ff-button:hover{background-color:rgba(74,82,87,.5);fill:#c8c8c8}.sv-main-menu>.ff-button:hover>.ff-text{color:#c8c8c8}.sv-main-menu>.ff-button[selected]{background-color:#0089bf;color:#f0f0f0}.sv-main-menu>.ff-button[selected]>.ff-icon{filter:drop-shadow(1px 1px 6px #00648c);fill:#c8c8c8}.sv-main-menu>.ff-button[selected]:hover,.sv-main-menu>.ff-button[selected]:focus{background-color:#00a6e8}.sv-share-menu{position:relative;width:450px;max-width:85%;padding:8px;background:#343434;box-shadow:0 0 20px rgba(0,0,0,.35);pointer-events:auto}.sv-share-menu .ff-title{margin:.5em 0 1em 0}.sv-share-menu .ff-button{flex:0 0 auto}.sv-share-menu .ff-text-edit{height:6.5em}.sv-share-menu .sv-share-buttons .ff-button{width:48px;height:48px;border-radius:48px;margin:0 1em 1em 0;padding:0}.sv-share-menu .sv-share-buttons .ff-button .ff-icon{height:30px;fill:#f0f0f0}.sv-share-menu .sv-share-button-twitter{background-color:#00aced}.sv-share-menu .sv-share-button-twitter:focus{outline:none;background-color:#00aced;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-twitter:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-share-menu .sv-share-button-twitter:focus-visible{outline:none;background:#00aced;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-twitter:hover{background-color:#21c2ff}.sv-share-menu .sv-share-button-facebook{background-color:#3c5a99}.sv-share-menu .sv-share-button-facebook:focus{outline:none;background-color:#3c5a99;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-facebook:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-share-menu .sv-share-button-facebook:focus-visible{outline:none;background:#3c5a99;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-facebook:hover{background-color:#4e71ba}.sv-share-menu .sv-share-button-linkedin{background-color:#0077b5}.sv-share-menu .sv-share-button-linkedin:focus{outline:none;background-color:#0077b5;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-linkedin:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-share-menu .sv-share-button-linkedin:focus-visible{outline:none;background:#0077b5;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-linkedin:hover{background-color:#0099e8}.sv-share-menu .sv-share-button-email{background-color:#d28842}.sv-share-menu .sv-share-button-email:focus{outline:none;background-color:#d28842;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-email:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-share-menu .sv-share-button-email:focus-visible{outline:none;background:#d28842;box-shadow:0 0 3pt 2pt #bfedff}.sv-share-menu .sv-share-button-email:hover{background-color:#dca26b}.sv-document-overlay{position:absolute;left:52px;top:52px;right:6px;bottom:0;pointer-events:auto}.sv-tour-menu .sv-article,.sv-reader-view .sv-article{position:relative}.sv-tour-menu .sv-article .sv-nav-button,.sv-reader-view .sv-article .sv-nav-button{float:right;margin:1em .5em;padding:2px}.sv-tour-menu .sv-article .sv-nav-button .ff-icon,.sv-reader-view .sv-article .sv-nav-button .ff-icon{height:1.5em}.sv-tour-menu .sv-entry,.sv-reader-view .sv-entry{position:relative;cursor:pointer;padding:5px 0 5px 15px;margin:2px 2px 16px 2px;max-width:960px;background-color:rgba(27,34,38,.5)}.sv-tour-menu .sv-entry:hover,.sv-reader-view .sv-entry:hover{background-color:rgba(51,59,64,.5)}.sv-tour-menu .sv-entry .sv-titlebar,.sv-reader-view .sv-entry .sv-titlebar{display:flex}.sv-tour-menu .sv-entry .ff-icon,.sv-reader-view .sv-entry .ff-icon{margin:auto 10px auto auto;height:1.5em;border-radius:60px;border-style:solid;box-shadow:0 0 2px #a0a0a0;padding:.6em .6em}.sv-option-menu{position:relative;width:225px;max-width:85%;height:200px;max-height:85%;padding:8px;background:#343434;box-shadow:0 0 20px rgba(0,0,0,.35);pointer-events:auto}.sv-option-menu .ff-title{margin:.3em 0 .3em .3em}.sv-option-menu .ff-header{padding:.3em 0 .3em .3em;background:rgba(31,36,38,.8)}.sv-option-menu .ff-button{flex:0 0 auto}.sv-option-menu .sv-scroll-offset{top:50px}.sv-option-menu .sv-centered{justify-content:center;padding:.3em 0 .3em .3em}.sv-option-menu .sv-entry{position:relative;cursor:pointer;padding:5px 0 5px 15px;margin-bottom:2px;max-width:960px;background-color:rgba(27,34,38,.5);user-select:none;-moz-user-select:none;-webkit-user-select:none}.sv-option-menu .sv-entry:focus{outline:2px solid #bfedff;outline-offset:-2px;background-color:rgba(27,34,38,.5)}.sv-option-menu .sv-entry:focus:not(:focus-visible){outline:0}.sv-option-menu .sv-entry:focus-visible{outline:2px solid #bfedff;outline-offset:-2px;background-color:rgba(27,34,38,.5)}.sv-option-menu .sv-entry:hover{background-color:rgba(51,59,64,.5);fill:#c8c8c8}.sv-option-menu .sv-entry[selected]{background-color:#0089bf;color:#f0f0f0}.sv-option-menu .sv-entry[selected]:hover,.sv-option-menu .sv-entry[selected]:focus{background-color:#00a6e8}.sv-main-help{position:relative;width:90%;height:90%;padding:8px;background:#343434;pointer-events:auto}.sv-main-help .sv-help-section{display:flex;text-align:center;width:33%;min-width:180px;max-height:90%;flex-direction:column;justify-content:center;margin-top:20px;margin-bottom:20px}.sv-main-help .sv-help-short{min-width:100px}.sv-main-help .sv-help-row{display:flex;flex-wrap:wrap;height:90%;justify-content:center;overflow:auto}.sv-main-help .sv-help-text{padding:5px 5px 0px 5px;display:flex;align-items:center;justify-content:center}.sv-main-help .sv-help-region{height:100%;display:flex;flex-direction:column}.sv-main-help .ff-icon{height:2rem}.sv-main-help .sv-commands{flex:0 0 auto;display:flex;flex-wrap:wrap;padding:2px}.sv-main-help .sv-commands .ff-button{width:50%;min-width:100px}.sv-bottom-bar-container{position:relative;display:flex;justify-content:center;transition:transform .3s ease-out,opacity .15s ease-out;z-index:1}.sv-bottom-bar-container.sv-transition{transform:translateY(40px);opacity:0}.sv-bottom-bar-container .ff-button{transition:all .15s}.sv-blue-bar{flex:0 1 960px;display:flex;flex-direction:column;background-color:rgba(5,7,8,.85);border-left:1px solid rgba(0,137,191,.5);border-right:1px solid rgba(0,137,191,.5);margin:0 -1px 0 -1px;min-width:0px;pointer-events:auto;user-select:none;-moz-user-select:none;-webkit-user-select:none}.sv-blue-bar .sv-group{display:flex;flex-direction:column}.sv-blue-bar .sv-section{position:relative;display:flex;flex-direction:row;border-top:1px solid rgba(0,137,191,.5)}.sv-blue-bar .sv-section-lead,.sv-blue-bar .sv-section-trail{flex:0 0 auto;padding:6px;width:38px}.sv-blue-bar .sv-section-lead:hover,.sv-blue-bar .sv-section-trail:hover{background-color:rgba(74,82,87,.5)}.sv-blue-bar .sv-section-lead{border-right:1px solid rgba(0,137,191,.5)}.sv-blue-bar .sv-section-trail{border-left:1px solid rgba(0,137,191,.5)}.sv-blue-bar .sv-transparent-button{flex:0 1 auto;padding:6px;border-radius:2px}.sv-blue-bar .sv-transparent-button .ff-text{margin:1px 2px}.sv-blue-bar .sv-transparent-button .ff-icon{height:22px;margin:1px 2px}.sv-tour-navigator{color:#c8c8c8}.sv-tour-navigator .sv-content{flex:1;margin:2px 8px;text-align:center}.sv-tour-navigator .sv-title{font-size:1.1em}@keyframes ticker{100%{transform:translateX(var(--x-offset))}}.sv-tour-navigator .sv-text{font-size:.9em}.sv-text-scroll{animation:ticker 1s linear 1;text-overflow:clip}.sv-target-navigator .sv-content{flex:1;margin:2px 8px;text-align:center}.sv-target-navigator .sv-title{font-size:1.1em}.sv-tag-cloud .sv-tag-buttons{flex:1 1 auto;display:flex;flex-wrap:wrap;justify-content:center;margin:4px}.sv-tag-cloud .sv-tag-button{flex:0 1 auto;margin:3px 3px;padding:2px 4px;background-color:rgba(31,36,38,.8);border-radius:3px;font-size:.88em}.sv-tag-cloud .sv-tag-button:hover{background-color:rgba(74,82,87,.5)}.sv-tag-cloud .sv-tag-button[selected]{background-color:#0089bf}.sv-tag-cloud .sv-tag-button .ff-text{margin:1px 2px}.sv-tag-cloud .sv-tag-button .ff-icon{height:22px;margin:1px 2px}.sv-property .ff-input{min-width:auto;width:0;margin:0;padding:2px}.sv-property .ff-input,.sv-property select{text-align:right;background-image:none;appearance:auto}.sv-property .ff-input:focus,.sv-property select:focus{text-align:left}.sv-property.sv-property-color input[type=color]{cursor:pointer;border:none;margin:2px;height:26px;inline-size:26px;padding:1px;background:#343434;border-radius:2px}.sv-property.sv-property-color input[type=color]::-webkit-color-swatch-wrapper{padding:0}.sv-property.sv-property-color input[type=color]::-webkit-color-swatch,.sv-property.sv-property-color input[type=color]::-moz-color-swatch{border:none;border-radius:2px}.sv-property.sv-property-number .sv-property-field{position:relative;touch-action:none;display:inline-flex}.sv-property.sv-property-number .sv-property-field .ff-bar{background:#272727;position:absolute;inset:0;margin:0;width:0;box-sizing:border-box;border:2px solid #1b1b1b}.sv-property.sv-property-number .sv-property-field .ff-input,.sv-property.sv-property-number .sv-property-field .ff-unit{position:relative;touch-action:none}.sv-property.sv-property-number .sv-property-field .ff-bar,.sv-property.sv-property-number .sv-property-field .ff-unit{pointer-events:none;user-select:none}.sv-property.sv-property-slider{flex:0 2 180px}.sv-property.sv-property-slider .ff-linear-slider{height:6px;margin:12px 2px;padding-right:16px;border-radius:2px;background-color:#4e4e4e}.sv-property.sv-property-slider .ff-linear-slider .ff-knob{width:16px;height:26px;margin:-10px 0 0 0;border-radius:2px;background-color:#0089bf;box-shadow:0 0 6px #000}.sv-property.sv-property-options .sv-options-buttons{display:flex;flex-wrap:wrap;justify-content:center;padding:2px 0;gap:2px}.sv-property.sv-property-options .sv-options-buttons .ff-button.ff-control{flex:0 1 auto}.sv-tool-bar{color:#c8c8c8;pointer-events:auto}.sv-tool-bar .sv-tool-buttons{flex:1 1 auto;display:flex;margin:4px;overflow-x:auto}.sv-tool-bar .sv-tool-buttons .sv-tool-button:first-child{margin-left:auto}.sv-tool-bar .sv-tool-buttons .sv-tool-button:last-child{margin-right:auto}.sv-tool-bar .sv-tool-button{flex:0 1 auto;margin:2px;padding:1px 2px;border-radius:3px;font-size:.882em}.sv-tool-bar .sv-tool-button .ff-text{margin:1px 2px}.sv-tool-bar .sv-tool-button .ff-icon{height:22px;margin:1px 2px}.sv-tool-bar-container{position:relative;bottom:0px;width:100%}.sv-tool-controls{flex:1 1 auto;display:flex;justify-content:center;align-items:center;font-size:.882em}.sv-tool-controls .sv-property{flex:0 1 auto;align-self:start;display:flex;flex-direction:column;margin:4px}.sv-tool-controls .sv-property label{height:1.25em}.sv-tool-controls .sv-property.sv-nogap{margin:4px 0 !important}.sv-tool-controls .sv-property.sv-property-slider{flex:0 2 180px}.sv-tool-controls .sv-options{display:flex}.sv-tool-controls .ff-label{margin:2px}.sv-tool-controls .ff-string{flex:0 1 auto;height:26px;margin:2px;font-size:1.34em}.sv-tool-controls .ff-button{height:26px;margin:2px;padding:0 4px;background:#343434;border-radius:2px}.sv-tool-controls .ff-button:focus{outline:none;background:#343434;box-shadow:0 0 3pt 2pt #bfedff}.sv-tool-controls .ff-button:focus:not(:focus-visible){outline:0;box-shadow:0 0}.sv-tool-controls .ff-button:focus-visible{outline:none;background:#343434;box-shadow:0 0 3pt 2pt #bfedff}.sv-tool-controls .ff-button:hover{background-color:#676767;fill:#c8c8c8}.sv-view-tool-view .sv-options,.sv-render-tool-view .sv-options,.sv-light-tool-view .sv-options{flex-wrap:wrap}.sv-tape-tool-view .sv-tool-controls,.sv-slice-tool-view .sv-tool-controls,.sv-environment-tool-view .sv-tool-controls{flex-wrap:wrap}.sv-action-prompt{height:30px;width:30px;fill:#fff}.sv-caption-view{position:absolute;bottom:10%;z-index:2;font-size:1.5rem;justify-content:center;display:flex;width:100%}.sv-caption-box{position:relative;text-align:center;background-color:rgba(0,0,0,.85);max-width:85%}.sv-splash{padding:7px;pointer-events:auto;background-color:rgba(54,61,64,.6);max-width:min(80%, 800px);min-width:50%;max-height:90%;overflow-y:auto}.sv-splash>:focus-visible{outline:none;box-shadow:0 0}.sv-audio-view{display:flex;align-items:center;flex:1 1 auto;max-width:100%;min-width:110px;height:30px;background-color:#f0f0f0;border-radius:15px;color:#000;cursor:auto}.sv-audio-view>.ff-button{width:30px;height:30px;border-radius:15px;flex:0 1 auto;padding:0px;margin-right:3px;background-color:#f0f0f0;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sv-audio-view>.ff-button .ff-icon{height:1.5em;margin:5px;fill:#000}.sv-audio-view>.ff-button:focus{background-color:#f0f0f0}.sv-audio-view>.ff-button:hover{background-color:#a4a4a4}.sv-audio-view>.ff-button:hover>.ff-icon{fill:#000}.sv-audio-view .sv-timer{font-size:small;display:flex}.sv-audio-view input{width:100%;margin-left:3px;margin-right:3px}.sv-narrate-player{position:absolute;pointer-events:auto;width:200px;max-width:75%;margin:auto auto;left:0;right:0;z-index:4;padding-top:6px}',e.appendChild(t);const n=this.application.system;e.appendChild(new J(n)),e.appendChild(new He(n));const i=document.createElement("div");i.setAttribute("id",l.ZP.stackId),e.appendChild(i),l.ZP.shadowRootNode=e;const s=document.createElement("div");s.classList.add("sr-only"),s.setAttribute("id","sr-intro"),s.setAttribute("aria-live","polite"),e.appendChild(s)}connected(){this.fullscreen.fullscreenElement=this,this.viewer.rootElement=this,this.arManager.shadowRoot=this.shadowRoot}disconnected(){super.disconnected(),this.fullscreen.fullscreenElement=null,this.viewer.rootElement=null,window.VoyagerStory||(this.application.dispose(),this.application=null)}attributeChangedCallback(e,t,n){const i=this.application;if(super.attributeChangedCallback(e,t,n),i&&"root"===e){const e=this.getAttribute("root");e.length>0&&(i.props.root=e,i.reloadDocument(),this.connected())}else i&&"document"===e?(i.props.document=this.getAttribute("document"),i.reloadDocument(),this.connected()):i&&"controls"===e&&i.enableNavigation(n)}onFocus(){this.shadowRoot.getElementById("sr-intro").innerText="The Voyager web application allows you to view and interact with a 3D model from the Smithsonian collection. Use the tab key to move through interactive elements, enter or spacebar keys to activate, and the escape key to exit menus."}toggleAnnotations(){this.application&&this.application.toggleAnnotations()}toggleReader(){this.application&&this.application.toggleReader()}toggleTours(){this.application&&this.application.toggleTours()}toggleTools(){this.application&&this.application.toggleTools()}toggleMeasurement(){this.application&&this.application.toggleMeasurement()}enableAR(){this.application&&this.application.enableAR()}getArticles(){if(this.application){return this.application.getArticles()}}getAnnotations(){if(this.application){return this.application.getAnnotations()}}getCameraOrbit(e){if(this.application){return this.application.getCameraOrbit(e||null)}}setCameraOrbit(e,t){this.application&&this.application.setCameraOrbit(e,t)}getCameraOffset(e){if(this.application){return this.application.getCameraOffset(e||null)}}setCameraOffset(e,t,n){this.application&&this.application.setCameraOffset(e,t,n)}setBackgroundColor(e,t){this.application&&this.application.setBackgroundColor(e,t||null)}setBackgroundStyle(e){this.application&&this.application.setBackgroundStyle(e)}setActiveAnnotation(e){this.application&&this.viewer.ins.activeAnnotation.setValue(e)}setActiveArticle(e){this.application&&this.application.setActiveArticle(e)}setTourStep(e,t,n){this.application&&this.application.setTourStep(e,t,void 0===n||n)}setLanguage(e){this.application&&this.application.setLanguage(e)}};We=$e([(0,o.Mo)("voyager-explorer")],We);const Ze=We},11598:(e,t,n)=>{"use strict";n.d(t,{Cb:()=>i.Cb,Mo:()=>i.Mo,ZP:()=>o,dy:()=>i.dy});var i=n(51120),s=n(31491),r=n(47425);class o extends r.ZP{constructor(){super(...arguments),this.activeNode=null}get nodeProvider(){return this.system.getMainComponent(s.Z)}connected(){super.connected();const e=this.nodeProvider;e.on("active-node",this.onActiveNodeEvent,this),e.activeNode&&(this.activeNode=e.activeNode,this.onActiveNode(null,e.activeNode))}disconnected(){const e=this.nodeProvider;e.off("active-node",this.onActiveNodeEvent,this),e.activeNode&&(this.activeNode=null,this.onActiveNode(e.activeNode,null)),super.disconnected()}onActiveNode(e,t){this.requestUpdate()}onActiveNodeEvent(e){this.activeNode=e.next,this.onActiveNode(e.previous,e.next)}}},88300:(e,t,n)=>{"use strict";n.d(t,{k:()=>r,u:()=>s});var i=n(82587);function s(e,t,n){return Math.min(Math.max(e,t),n)}function r(e,t){var n=new i.y,s=new i.y;n.identity();do{s.compose(t.position,t.quaternion,t.scale),n.multiply(s.invert()),t=t.parent}while(e!==t);return n}},53310:(e,t,n)=>{"use strict";n.d(t,{G:()=>i,e:()=>s});function i(e){return[...e.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])')].filter((e=>!e.hasAttribute("disabled")&&!!e.getClientRects().length&&"hidden"!==e.style.visibility&&!e.getAttribute("aria-hidden")&&"-1"!==e.getAttribute("tabindex")))}function s(e,t){const n=e[0],i=e[e.length-1];t.shiftKey?t.target===n&&(t.preventDefault(),i.focus()):t.target===i&&(t.preventDefault(),n.focus())}},15577:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var i=n(1594);const s={mm:{mm:1,cm:.1,m:.001,km:1,in:.0393701,ft:.00328084,yd:.00109361,mi:1},cm:{mm:10,cm:1,m:.01,km:1,in:.393701,ft:.0328084,yd:.0109361,mi:1},m:{mm:1e3,cm:100,m:1,km:1,in:39.3701,ft:3.28084,yd:1.09361,mi:1},km:{mm:1e6,cm:1e5,m:1e3,km:1,in:39370.1,ft:3280.84,yd:1093.61,mi:1},in:{mm:25.4,cm:2.54,m:.0254,km:1,in:1,ft:.0833333,yd:.0277778,mi:1},ft:{mm:304.8,cm:30.48,m:.3048,km:1,in:12,ft:1,yd:.333334,mi:1},yd:{mm:914.4,cm:91.44,m:.9144,km:1,in:36,ft:3,yd:1,mi:1},mi:{mm:1609e3,cm:160900,m:1609,km:1,in:63346456.693,ft:5278871.391,yd:1759623.797,mi:1}};function r(e,t){const n=i.f_[e],r=i.f_[t];return s[n][r]||1}},19853:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(10613),s=n(53868);const r=new WeakMap,o=(0,s.XM)((e=>t=>{if(!(t instanceof s.nt))throw new Error("unsafeHTML can only be used in text bindings");const n=r.get(t);if(void 0!==n&&(0,i.pt)(e)&&e===n.value&&t.value===n.fragment)return;const o=document.createElement("template");o.innerHTML=e;const a=document.importNode(o.content,!0);t.setValue(a),r.set(t,{value:e,fragment:a})}))},25352:(e,t,n)=>{"use strict";n.d(t,{X:()=>s,w:()=>r});const i=new WeakMap,s=e=>(...t)=>{const n=e(...t);return i.set(n,!0),n},r=e=>"function"==typeof e&&i.has(e)},93909:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,eC:()=>i,r4:()=>r});const i="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,s=(e,t,n=null,i=null)=>{for(;t!==n;){const n=t.nextSibling;e.insertBefore(t,i),t=n}},r=(e,t,n=null)=>{for(;t!==n;){const n=t.nextSibling;e.removeChild(t),t=n}}},66390:(e,t,n)=>{"use strict";n.d(t,{J:()=>i,L:()=>s});const i={},s={}},10613:(e,t,n)=>{"use strict";n.d(t,{JG:()=>f,K1:()=>v,QG:()=>d,_l:()=>u,m:()=>m,nt:()=>p,pt:()=>c,sL:()=>g});var i=n(25352),s=n(93909),r=n(66390),o=n(66825),a=n(47275),l=n(14056);const c=e=>null===e||!("object"==typeof e||"function"==typeof e),h=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class d{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(let e=0;e{try{const e={get capture(){return A=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class v{constructor(e,t,n){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=n,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;(0,i.w)(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=r.J,e(this)}if(this.__pendingValue===r.J)return;const e=this.__pendingValue,t=this.value,n=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),s=null!=e&&(null==t||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=y(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=r.J}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const y=e=>e&&(A?{capture:e.capture,passive:e.passive,once:e.once}:e.capture)},44574:(e,t,n)=>{"use strict";n.d(t,{L:()=>o,s:()=>a});var i=n(93909),s=n(10613),r=n(41998);const o=new WeakMap,a=(e,t,n)=>{let a=o.get(t);void 0===a&&((0,i.r4)(t,t.firstChild),o.set(t,a=new s.nt(Object.assign({templateFactory:r.t},n))),a.appendInto(t)),a.setValue(e),a.commit()}},41998:(e,t,n)=>{"use strict";n.d(t,{r:()=>r,t:()=>s});var i=n(14056);function s(e){let t=r.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},r.set(e.type,t));let n=t.stringsArray.get(e.strings);if(void 0!==n)return n;const s=e.strings.join(i.Jw);return n=t.keyString.get(s),void 0===n&&(n=new i.YS(e,e.getTemplateElement()),t.keyString.set(s,n)),t.stringsArray.set(e.strings,n),n}const r=new Map},66825:(e,t,n)=>{"use strict";n.d(t,{R:()=>r});var i=n(93909),s=n(14056);class r{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this.options=n}update(e){let t=0;for(const n of this.__parts)void 0!==n&&n.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=i.eC?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],n=this.template.parts,r=document.createTreeWalker(e,133,null,!1);let o,a=0,l=0,c=r.nextNode();for(;a{"use strict";n.d(t,{j:()=>o});n(93909);var i=n(14056);const s=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:e=>e}),r=` ${i.Jw} `;class o{constructor(e,t,n,i){this.strings=e,this.values=t,this.type=n,this.processor=i}getHTML(){const e=this.strings.length-1;let t="",n=!1;for(let s=0;s-1||n)&&-1===e.indexOf("--\x3e",o+1);const a=i.W5.exec(e);t+=null===a?e+(n?r:i.N):e.substr(0,a.index)+a[1]+a[2]+i.$E+a[3]+i.Jw}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==s&&(t=s.createHTML(t)),e.innerHTML=t,e}}},14056:(e,t,n)=>{"use strict";n.d(t,{$E:()=>o,IW:()=>h,Jw:()=>i,N:()=>s,W5:()=>d,YS:()=>a,pC:()=>c});const i=`{{lit-${String(Math.random()).slice(2)}}}`,s=`\x3c!--${i}--\x3e`,r=new RegExp(`${i}|${s}`),o="$lit$";class a{constructor(e,t){this.parts=[],this.element=t;const n=[],s=[],a=document.createTreeWalker(t.content,133,null,!1);let c=0,u=-1,p=0;const{strings:f,values:{length:m}}=e;for(;p0;){const t=f[p],n=d.exec(t)[2],i=n.toLowerCase()+o,s=e.getAttribute(i);e.removeAttribute(i);const a=s.split(r);this.parts.push({type:"attribute",index:u,name:n,strings:a}),p+=a.length-1}}"TEMPLATE"===e.tagName&&(s.push(e),a.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(i)>=0){const i=e.parentNode,s=t.split(r),a=s.length-1;for(let t=0;t{const n=e.length-t.length;return n>=0&&e.slice(n)===t},c=e=>-1!==e.index,h=()=>document.createComment(""),d=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/},53868:(e,t,n)=>{"use strict";n.d(t,{_l:()=>i._l,JG:()=>i.JG,K1:()=>i.K1,nt:()=>i.nt,sL:()=>i.sL,IW:()=>c.IW,XM:()=>o.X,dy:()=>h,r4:()=>a.r4,sY:()=>l.s,V:()=>a.V});var i=n(10613);const s=new class{handleAttributeExpressions(e,t,n,s){const r=t[0];if("."===r){return new i.m(e,t.slice(1),n).parts}if("@"===r)return[new i.K1(e,t.slice(1),s.eventContext)];if("?"===r)return[new i.JG(e,t.slice(1),n)];return new i.QG(e,t,n).parts}handleTextExpression(e){return new i.nt(e)}};var r=n(47275),o=n(25352),a=n(93909),l=(n(66390),n(44574)),c=(n(41998),n(66825),n(14056));"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const h=(e,...t)=>new r.j(e,t,"html",s)},60531:(e,t,n)=>{"use strict";n.d(t,{H:()=>s});var i=n(67440);class s extends i.c{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}},68347:(e,t,n)=>{"use strict";n.d(t,{V:()=>o});var i=n(75544),s=n(82587),r=n(25499);class o extends r.T{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new s.y,this.projectionMatrix=new s.y,this.projectionMatrixInverse=new s.y,this.coordinateSystem=i._RZ}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}},53203:(e,t,n)=>{"use strict";n.d(t,{_:()=>a});var i=n(75544),s=n(25499),r=n(67440);const o=-90;class a extends s.T{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new r.c(o,1,e,t);i.layers=this.layers,this.add(i);const s=new r.c(o,1,e,t);s.layers=this.layers,this.add(s);const a=new r.c(o,1,e,t);a.layers=this.layers,this.add(a);const l=new r.c(o,1,e,t);l.layers=this.layers,this.add(l);const c=new r.c(o,1,e,t);c.layers=this.layers,this.add(c);const h=new r.c(o,1,e,t);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,s,r,o,a,l]=t;for(const e of t)this.remove(e);if(e===i._RZ)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else{if(e!==i.JCZ)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,r,o,a,l,c]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),u=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,s),e.setRenderTarget(n,1,i),e.render(t,r),e.setRenderTarget(n,2,i),e.render(t,o),e.setRenderTarget(n,3,i),e.render(t,a),e.setRenderTarget(n,4,i),e.render(t,l),n.texture.generateMipmaps=f,e.setRenderTarget(n,5,i),e.render(t,c),e.setRenderTarget(h,d,u),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}},62257:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var i=n(68347);class s extends i.V{constructor(e=-1,t=1,n=1,i=-1,s=.1,r=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=r,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,r){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,r=n+e,o=i+t,a=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=e*this.view.offsetX,r=s+e*this.view.width,o-=t*this.view.offsetY,a=o-t*this.view.height}this.projectionMatrix.makeOrthographic(s,r,o,a,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}},67440:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var i=n(68347),s=n(71050);class r extends i.V{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*s.I3*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*s.qW*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*s.I3*Math.atan(Math.tan(.5*s.qW*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,r){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*s.qW*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const o=this.view;if(null!==this.view&&this.view.enabled){const e=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/e,t-=o.offsetY*n/s,i*=o.width/e,n*=o.height/s}const a=this.filmOffset;0!==a&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}},75544:(e,t,n)=>{"use strict";n.d(t,{$wi:()=>ie,AmZ:()=>Qt,BFQ:()=>Ge,BG$:()=>st,BVF:()=>V,Bf4:()=>ce,CaW:()=>qe,CdI:()=>J,CtA:()=>Ve,Cy:()=>O,D1R:()=>ye,D67:()=>qt,D9w:()=>Ue,Djp:()=>it,E2K:()=>Qe,EoG:()=>X,F1y:()=>Kt,FUD:()=>ht,FVh:()=>Ht,GG6:()=>lt,GUF:()=>Ft,Gih:()=>ct,HdW:()=>gt,Hy8:()=>R,IFH:()=>St,ILR:()=>He,IOt:()=>Nt,JCZ:()=>an,JQ4:()=>Ce,Jjb:()=>en,KI_:()=>Ut,KhW:()=>M,Kz5:()=>Ee,LSk:()=>sn,LY2:()=>te,L_r:()=>rn,LgZ:()=>P,LsT:()=>we,M$G:()=>Yt,M5h:()=>v,M6v:()=>W,N4l:()=>A,NDo:()=>K,NKc:()=>F,NMF:()=>_t,NYV:()=>rt,Ns1:()=>Z,O78:()=>Jt,OTo:()=>Be,OoA:()=>pe,PA7:()=>kt,PeU:()=>s,Pnf:()=>wt,QO2:()=>mt,RlZ:()=>N,S2y:()=>o,Se2:()=>Q,Sm8:()=>E,SvJ:()=>ut,Syv:()=>bt,T6w:()=>tn,T95:()=>_e,TyD:()=>fe,UZH:()=>i,UlW:()=>Tt,Vdb:()=>D,Vtg:()=>jt,VzW:()=>Se,W2J:()=>nn,WMw:()=>g,Wbm:()=>_,Wl3:()=>d,Wpd:()=>L,WwZ:()=>It,Xaj:()=>y,Y8D:()=>De,YGz:()=>ee,YLQ:()=>me,ZTh:()=>vt,Zen:()=>Xt,Zr5:()=>z,_AM:()=>$e,_Li:()=>u,_MY:()=>a,_RZ:()=>on,_iA:()=>l,_lf:()=>Et,_sL:()=>Ct,_wr:()=>k,aCh:()=>Ot,aH4:()=>ge,av9:()=>Fe,bGH:()=>b,bdR:()=>m,brP:()=>ke,bsb:()=>pt,c8b:()=>C,cLu:()=>Me,cRx:()=>Le,cum:()=>Wt,dSO:()=>le,dZ3:()=>ne,dwk:()=>h,eD:()=>j,eaV:()=>Ze,ehD:()=>p,ekQ:()=>Xe,f2y:()=>ft,fSK:()=>B,fY$:()=>oe,fto:()=>Ke,g8_:()=>he,gSk:()=>Mt,ghN:()=>S,gi4:()=>nt,hEm:()=>Oe,iAb:()=>xe,iWC:()=>I,iiP:()=>dt,irR:()=>Te,j17:()=>Gt,jFi:()=>f,jZA:()=>et,jes:()=>U,k0A:()=>Ie,k74:()=>T,knz:()=>Rt,ksN:()=>H,l0P:()=>Ye,l6D:()=>zt,lGU:()=>yt,mSO:()=>Lt,msZ:()=>se,ntZ:()=>c,ntt:()=>Vt,pIN:()=>xt,pKu:()=>at,ptH:()=>Je,qhX:()=>q,qkB:()=>Ne,qyh:()=>ve,rOj:()=>x,r_:()=>w,rnI:()=>Bt,rpg:()=>de,tm_:()=>r,uL9:()=>Y,uWy:()=>ue,v3W:()=>je,vCF:()=>G,vCx:()=>We,vuL:()=>At,vxC:()=>ae,w$m:()=>$,wJv:()=>Pe,wem:()=>Ae,wk1:()=>Re,wuA:()=>ze,x5V:()=>$t,xJs:()=>ot,xfE:()=>re,xoQ:()=>Zt,y2t:()=>tt,ywz:()=>be,z$h:()=>Pt,z81:()=>Dt});const i="158",s=0,r=1,o=2,a=0,l=1,c=2,h=3,d=0,u=1,p=2,f=0,m=1,g=2,A=3,v=4,y=5,b=100,_=101,x=102,w=103,E=104,C=200,S=201,M=202,I=203,T=204,P=205,B=206,R=207,D=208,L=209,N=210,k=211,O=212,U=213,F=214,V=0,Q=1,z=2,G=3,j=4,H=5,$=6,W=7,Z=0,q=1,K=2,Y=0,X=1,J=2,ee=3,te=4,ne=5,ie="attached",se="detached",re=300,oe=301,ae=302,le=303,ce=304,he=306,de=1e3,ue=1001,pe=1002,fe=1003,me=1004,ge=1005,Ae=1006,ve=1007,ye=1008,be=1009,_e=1010,xe=1011,we=1012,Ee=1013,Ce=1014,Se=1015,Me=1016,Ie=1017,Te=1018,Pe=1020,Be=1021,Re=1023,De=1024,Le=1025,Ne=1026,ke=1027,Oe=1028,Ue=1029,Fe=1030,Ve=1031,Qe=1033,ze=33776,Ge=33777,je=33778,He=33779,$e=35840,We=35841,Ze=35842,qe=35843,Ke=36196,Ye=37492,Xe=37496,Je=37808,et=37809,tt=37810,nt=37811,it=37812,st=37813,rt=37814,ot=37815,at=37816,lt=37817,ct=37818,ht=37819,dt=37820,ut=37821,pt=36492,ft=36494,mt=36495,gt=36283,At=36284,vt=36285,yt=36286,bt=2300,_t=2301,xt=2302,wt=2400,Et=2401,Ct=2402,St=2500,Mt=2501,It=0,Tt=1,Pt=2,Bt=3e3,Rt=3001,Dt=3200,Lt=3201,Nt=0,kt=1,Ot="",Ut="srgb",Ft="srgb-linear",Vt="display-p3",Qt="display-p3-linear",zt="linear",Gt="srgb",jt="rec709",Ht="p3",$t=7680,Wt=519,Zt=512,qt=513,Kt=514,Yt=515,Xt=516,Jt=517,en=518,tn=519,nn=35044,sn="300 es",rn=1035,on=2e3,an=2001},35322:(e,t,n)=>{"use strict";n.d(t,{Tl:()=>c,a$:()=>u,lC:()=>d,ql:()=>h});var i=n(19588),s=n(40693),r=n(71050),o=n(75544);const a=new i.P,l=new s.F;class c{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=o.W2J,this.updateRange={offset:0,count:-1},this.gpuType=o.VzW,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i{"use strict";n.d(t,{u:()=>_});var i=n(19588),s=n(40693),r=n(37840),o=n(19251),a=n(35322),l=n(57471),c=n(25499),h=n(82587),d=n(23130),u=n(71050),p=n(19564);let f=0;const m=new h.y,g=new c.T,A=new i.P,v=new r.Z,y=new r.Z,b=new i.P;class _ extends o.p{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:f++}),this.uuid=u.DO(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new((0,p.H7)(e)?a.lC:a.ql)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new d.V).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return m.makeRotationFromQuaternion(e),this.applyMatrix4(m),this}rotateX(e){return m.makeRotationX(e),this.applyMatrix4(m),this}rotateY(e){return m.makeRotationY(e),this.applyMatrix4(m),this}rotateZ(e){return m.makeRotationZ(e),this.applyMatrix4(m),this}translate(e,t,n){return m.makeTranslation(e,t,n),this.applyMatrix4(m),this}scale(e,t,n){return m.makeScale(e,t,n),this.applyMatrix4(m),this}lookAt(e){return g.lookAt(e),g.updateMatrix(),this.applyMatrix4(g.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(A).negate(),this.translate(A.x,A.y,A.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const i=n[t];e.data.attributes[t]=i.toJSON(e.data)}const i={};let s=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],r=[];for(let t=0,i=n.length;t0&&(i[t]=r,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(e.data.groups=JSON.parse(JSON.stringify(r)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const i=e.attributes;for(const e in i){const n=i[e];this.setAttribute(e,n.clone(t))}const s=e.morphAttributes;for(const e in s){const n=[],i=s[e];for(let e=0,s=i.length;e{"use strict";n.d(t,{p:()=>i});class i{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,i=n.length;t{"use strict";n.d(t,{v:()=>r});var i=n(71050),s=n(75544);class r{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=s.W2J,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=i.DO()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;i{"use strict";n.d(t,{k:()=>a});var i=n(19588),s=n(35322),r=n(71050);const o=new i.P;class a{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t{"use strict";n.d(t,{S:()=>i});class i{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<{"use strict";n.d(t,{T:()=>E});var i=n(78943),s=n(19588),r=n(82587),o=n(19251),a=n(82954),l=n(45787),c=n(23130),h=n(71050);let d=0;const u=new s.P,p=new i._,f=new r.y,m=new s.P,g=new s.P,A=new s.P,v=new i._,y=new s.P(1,0,0),b=new s.P(0,1,0),_=new s.P(0,0,1),x={type:"added"},w={type:"removed"};class E extends o.p{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:d++}),this.uuid=h.DO(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=E.DEFAULT_UP.clone();const e=new s.P,t=new a.U,n=new i._,o=new s.P(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:o},modelViewMatrix:{value:new r.y},normalMatrix:{value:new c.V}}),this.matrix=new r.y,this.matrixWorld=new r.y,this.matrixAutoUpdate=E.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=E.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new l.S,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return p.setFromAxisAngle(e,t),this.quaternion.multiply(p),this}rotateOnWorldAxis(e,t){return p.setFromAxisAngle(e,t),this.quaternion.premultiply(p),this}rotateX(e){return this.rotateOnAxis(y,e)}rotateY(e){return this.rotateOnAxis(b,e)}rotateZ(e){return this.rotateOnAxis(_,e)}translateOnAxis(e,t){return u.copy(e).applyQuaternion(this.quaternion),this.position.add(u.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(y,e)}translateY(e){return this.translateOnAxis(b,e)}translateZ(e){return this.translateOnAxis(_,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(f.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?m.copy(e):m.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),g.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?f.lookAt(g,m,this.up):f.lookAt(m,g,this.up),this.quaternion.setFromRotationMatrix(f),i&&(f.extractRotation(i.matrixWorld),p.setFromRotationMatrix(f),this.quaternion.premultiply(p.invert()))}add(e){if(arguments.length>1){for(let e=0;e1){for(let e=0;e0&&(n=n.concat(s))}return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(g,e,A),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(g,v,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t0){i.children=[];for(let t=0;t0){i.animations=[];for(let t=0;t0&&(n.geometries=t),i.length>0&&(n.materials=i),s.length>0&&(n.textures=s),o.length>0&&(n.images=o),a.length>0&&(n.shapes=a),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=i,n;function r(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t{"use strict";n.d(t,{P:()=>o});var i=n(19564),s=n(19748);let r;class o{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===r&&(r=(0,i.c)("canvas")),r.width=e.width,r.height=e.height;const n=r.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=r}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=(0,i.c)("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),o=r.data;for(let e=0;e{"use strict";n.d(t,{a:()=>C});var i=n(75544),s=n(35322),r=n(75809),o=n(8035),a=n(62257),l=n(67440),c=n(44428),h=n(19588),d=n(93113),u=n(46953),p=n(24479),f=n(40071);const m=[.125,.215,.35,.446,.526,.582],g=20,A=new a.i,v=new d.I;let y=null,b=0,_=0;const x=(1+Math.sqrt(5))/2,w=1/x,E=[new h.P(1,1,1),new h.P(-1,1,1),new h.P(1,1,-1),new h.P(-1,1,-1),new h.P(0,x,w),new h.P(0,x,-w),new h.P(w,0,x),new h.P(-w,0,x),new h.P(x,w,0),new h.P(-x,w,0)];class C{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){y=this._renderer.getRenderTarget(),b=this._renderer.getActiveCubeFace(),_=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=T(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=I(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;ee-4?c=m[l-e+4-1]:0===l&&(c=0),i.push(c);const h=1/(a-2),d=-h,u=1+h,p=[d,d,u,d,u,u,d,d,u,u,d,u],f=6,g=6,A=3,v=2,y=1,b=new Float32Array(A*g*f),_=new Float32Array(v*g*f),x=new Float32Array(y*g*f);for(let e=0;e2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];b.set(i,A*g*e),_.set(p,v*g*e);const s=[e,e,e,e,e,e];x.set(s,y*g*e)}const w=new r.u;w.setAttribute("position",new s.Tl(b,A)),w.setAttribute("uv",new s.Tl(_,v)),w.setAttribute("faceIndex",new s.Tl(x,y)),t.push(w),o>4&&o--}return{lodPlanes:t,sizeLods:n,sigmas:i}}(o)),this._blurMaterial=function(e,t,n){const s=new Float32Array(g),r=new h.P(0,1,0);return new c.j({name:"SphericalGaussianBlur",defines:{n:g,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:P(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:i.jFi,depthTest:!1,depthWrite:!1})}(o,e,t)}return o}_compileMaterial(e){const t=new o.K(this._lodPlanes[0],e);this._renderer.compile(t,A)}_sceneToCubeUV(e,t,n,s){const r=new l.c(90,1,t,n),a=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,d=h.autoClear,u=h.toneMapping;h.getClearColor(v),h.toneMapping=i.uL9,h.autoClear=!1;const m=new p.v({name:"PMREM.Background",side:i._Li,depthWrite:!1,depthTest:!1}),g=new o.K(new f.D,m);let A=!1;const y=e.background;y?y.isColor&&(m.color.copy(y),e.background=null,A=!0):(m.color.copy(v),A=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(r.up.set(0,a[t],0),r.lookAt(c[t],0,0)):1===n?(r.up.set(0,0,a[t]),r.lookAt(0,c[t],0)):(r.up.set(0,a[t],0),r.lookAt(0,0,c[t]));const i=this._cubeSize;M(s,n*i,t>2?i:0,i,i),h.setRenderTarget(s),A&&h.render(g,r),h.render(e,r)}g.geometry.dispose(),g.material.dispose(),h.toneMapping=u,h.autoClear=d,e.background=y}_textureToCubeUV(e,t){const n=this._renderer,s=e.mapping===i.fY$||e.mapping===i.vxC;s?(null===this._cubemapMaterial&&(this._cubemapMaterial=T()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=I());const r=s?this._cubemapMaterial:this._equirectMaterial,a=new o.K(this._lodPlanes[0],r);r.uniforms.envMap.value=e;const l=this._cubeSize;M(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,A)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;tg&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);const v=[];let y=0;for(let e=0;eb-4?i-b+4:0),4*(this._cubeSize-_),3*_,2*_),l.setRenderTarget(t),l.render(h,A)}}function S(e,t,n){const s=new u.d(e,t,n);return s.texture.mapping=i.g8_,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function M(e,t,n,i,s){e.viewport.set(t,n,i,s),e.scissor.set(t,n,i,s)}function I(){return new c.j({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:P(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:i.jFi,depthTest:!1,depthWrite:!1})}function T(){return new c.j({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:P(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:i.jFi,depthTest:!1,depthWrite:!1})}function P(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}},40071:(e,t,n)=>{"use strict";n.d(t,{D:()=>o});var i=n(75809),s=n(35322),r=n(19588);class o extends i.u{constructor(e=1,t=1,n=1,i=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:o,depthSegments:a};const l=this;i=Math.floor(i),o=Math.floor(o),a=Math.floor(a);const c=[],h=[],d=[],u=[];let p=0,f=0;function m(e,t,n,i,s,o,a,m,g,A,v){const y=o/g,b=a/A,_=o/2,x=a/2,w=m/2,E=g+1,C=A+1;let S=0,M=0;const I=new r.P;for(let r=0;r0?1:-1,d.push(I.x,I.y,I.z),u.push(a/g),u.push(1-r/A),S+=1}}for(let e=0;e{"use strict";n.d(t,{_:()=>r});var i=n(75809),s=n(35322);class r extends i.u{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,o=t/2,a=Math.floor(n),l=Math.floor(i),c=a+1,h=l+1,d=e/a,u=t/l,p=[],f=[],m=[],g=[];for(let e=0;e{"use strict";n.d(t,{O:()=>l});var i=n(19816),s=n(95687),r=n(62257);class o extends s.h{constructor(){super(new r.i(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}var a=n(25499);class l extends i._{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(a.T.DEFAULT_UP),this.updateMatrix(),this.target=new a.T,this.shadow=new o}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}},57090:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var i=n(19816),s=n(93113),r=n(25499);class o extends i._{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(r.T.DEFAULT_UP),this.updateMatrix(),this.groundColor=new s.I(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}},19816:(e,t,n)=>{"use strict";n.d(t,{_:()=>r});var i=n(25499),s=n(93113);class r extends i.T{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new s.I(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}},95687:(e,t,n)=>{"use strict";n.d(t,{h:()=>d});var i=n(82587),s=n(40693),r=n(19588),o=n(84538),a=n(53763);const l=new i.y,c=new r.P,h=new r.P;class d{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new s.F(512,512),this.map=null,this.mapPass=null,this.matrix=new i.y,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new a.i,this._frameExtents=new s.F(1,1),this._viewportCount=1,this._viewports=[new o.L(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;c.setFromMatrixPosition(e.matrixWorld),t.position.copy(c),h.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(h),t.updateMatrixWorld(),l.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(l),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(l)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}},54992:(e,t,n)=>{"use strict";n.d(t,{c:()=>f});var i=n(19816),s=n(95687),r=n(67440),o=n(82587),a=n(40693),l=n(19588),c=n(84538);const h=new o.y,d=new l.P,u=new l.P;class p extends s.h{constructor(){super(new r.c(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new a.F(4,2),this._viewportCount=6,this._viewports=[new c.L(2,1,1,1),new c.L(0,1,1,1),new c.L(3,1,1,1),new c.L(1,1,1,1),new c.L(3,0,1,1),new c.L(1,0,1,1)],this._cubeDirections=[new l.P(1,0,0),new l.P(-1,0,0),new l.P(0,0,1),new l.P(0,0,-1),new l.P(0,1,0),new l.P(0,-1,0)],this._cubeUps=[new l.P(0,1,0),new l.P(0,1,0),new l.P(0,1,0),new l.P(0,1,0),new l.P(0,0,1),new l.P(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),d.setFromMatrixPosition(e.matrixWorld),n.position.copy(d),u.copy(n.position),u.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(u),n.updateMatrixWorld(),i.makeTranslation(-d.x,-d.y,-d.z),h.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(h)}}class f extends i._{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new p}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}},50910:(e,t,n)=>{"use strict";n.d(t,{T:()=>s});var i=n(19816);class s extends i._{constructor(e,t,n=10,i=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}},16426:(e,t,n)=>{"use strict";n.d(t,{P:()=>c});var i=n(19816),s=n(95687),r=n(71050),o=n(67440);class a extends s.h{constructor(){super(new o.c(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=2*r.I3*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;n===t.fov&&i===t.aspect&&s===t.far||(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}var l=n(25499);class c extends i._{constructor(e,t,n=0,i=Math.PI/3,s=0,r=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(l.T.DEFAULT_UP),this.updateMatrix(),this.target=new l.T,this.distance=n,this.angle=i,this.penumbra=s,this.decay=r,this.map=null,this.shadow=new a}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}},58754:(e,t,n)=>{"use strict";n.d(t,{l:()=>i,t:()=>s});class i{constructor(e,t,n){const i=this;let s,r=!1,o=0,a=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){a++,!1===r&&void 0!==i.onStart&&i.onStart(e,o,a),r=!0},this.itemEnd=function(e){o++,void 0!==i.onProgress&&i.onProgress(e,o,a),o===a&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t{"use strict";n.d(t,{n:()=>r});var i=n(63960),s=n(93113);class r extends i.F{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new s.I(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}},63960:(e,t,n)=>{"use strict";n.d(t,{F:()=>l});var i=n(93113),s=n(19251),r=n(75544),o=n(71050);let a=0;class l extends s.p{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:a++}),this.uuid=o.DO(),this.name="",this.type="Material",this.blending=r.bdR,this.side=r.Wl3,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=r.k74,this.blendDst=r.LgZ,this.blendEquation=r.bGH,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new i.I(0,0,0),this.blendAlpha=0,this.depthFunc=r.vCF,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=r.cum,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=r.x5V,this.stencilZFail=r.x5V,this.stencilZPass=r.x5V,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==r.bdR&&(n.blending=this.blending),this.side!==r.Wl3&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==r.k74&&(n.blendSrc=this.blendSrc),this.blendDst!==r.LgZ&&(n.blendDst=this.blendDst),this.blendEquation!==r.bGH&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==r.vCF&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==r.cum&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==r.x5V&&(n.stencilFail=this.stencilFail),this.stencilZFail!==r.x5V&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==r.x5V&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const t=i(e.textures),s=i(e.images);t.length>0&&(n.textures=t),s.length>0&&(n.images=s)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}},24479:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var i=n(63960),s=n(75544),r=n(93113);class o extends i.F{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new r.I(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=s.Ns1,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}},90652:(e,t,n)=>{"use strict";n.d(t,{l:()=>r});var i=n(63960),s=n(75544);class r extends i.F{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=s.z81,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}},35536:(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var i=n(63960);class s extends i.F{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}},41654:(e,t,n)=>{"use strict";n.d(t,{x:()=>a});var i=n(75544),s=n(63960),r=n(40693),o=n(93113);class a extends s.F{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new o.I(16777215),this.specular=new o.I(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new o.I(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=i.IOt,this.normalScale=new r.F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=i.Ns1,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}},6965:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var i=n(75544),s=n(63960),r=n(40693),o=n(93113);class a extends s.F{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new o.I(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new o.I(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=i.IOt,this.normalScale=new r.F(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}},44428:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});var i=n(63960),s=n(8173);class r extends i.F{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",this.fragmentShader="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=(0,s.dw)(e.uniforms),this.uniformsGroups=(0,s.fd)(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}},37840:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var i=n(19588);class s{constructor(e=new i.P(1/0,1/0,1/0),t=new i.P(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,o),o.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(f),m.subVectors(this.max,f),l.subVectors(e.a,f),c.subVectors(e.b,f),h.subVectors(e.c,f),d.subVectors(c,l),u.subVectors(h,c),p.subVectors(l,h);let t=[0,-d.z,d.y,0,-u.z,u.y,0,-p.z,p.y,d.z,0,-d.x,u.z,0,-u.x,p.z,0,-p.x,-d.y,d.x,0,-u.y,u.x,0,-p.y,p.x,0];return!!v(t,l,c,h,m)&&(t=[1,0,0,0,1,0,0,0,1],!!v(t,l,c,h,m)&&(g.crossVectors(d,u),t=[g.x,g.y,g.z],v(t,l,c,h,m)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,o).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(o).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(r[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),r[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),r[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),r[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),r[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),r[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),r[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),r[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(r)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const r=[new i.P,new i.P,new i.P,new i.P,new i.P,new i.P,new i.P,new i.P],o=new i.P,a=new s,l=new i.P,c=new i.P,h=new i.P,d=new i.P,u=new i.P,p=new i.P,f=new i.P,m=new i.P,g=new i.P,A=new i.P;function v(e,t,n,i,s){for(let r=0,o=e.length-3;r<=o;r+=3){A.fromArray(e,r);const o=s.x*Math.abs(A.x)+s.y*Math.abs(A.y)+s.z*Math.abs(A.z),a=t.dot(A),l=n.dot(A),c=i.dot(A);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}},93113:(e,t,n)=>{"use strict";n.d(t,{I:()=>h});var i=n(71050),s=n(19748),r=n(75544);const o={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},a={h:0,s:0,l:0},l={h:0,s:0,l:0};function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}class h{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(void 0===t&&void 0===n){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=r.KI_){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,s.ep.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=s.ep.workingColorSpace){return this.r=e,this.g=t,this.b=n,s.ep.toWorkingColorSpace(this,i),this}setHSL(e,t,n,r=s.ep.workingColorSpace){if(e=(0,i.kz)(e,1),t=(0,i.uZ)(t,0,1),n=(0,i.uZ)(n,0,1),0===t)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=c(s,i,e+1/3),this.g=c(s,i,e),this.b=c(s,i,e-1/3)}return s.ep.toWorkingColorSpace(this,r),this}setStyle(e,t=r.KI_){function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const n=i[1],s=n.length;if(3===s)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(6===s)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=r.KI_){const n=o[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=(0,s.PB)(e.r),this.g=(0,s.PB)(e.g),this.b=(0,s.PB)(e.b),this}copyLinearToSRGB(e){return this.r=(0,s.QP)(e.r),this.g=(0,s.QP)(e.g),this.b=(0,s.QP)(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=r.KI_){return s.ep.fromWorkingColorSpace(d.copy(this),e),65536*Math.round((0,i.uZ)(255*d.r,0,255))+256*Math.round((0,i.uZ)(255*d.g,0,255))+Math.round((0,i.uZ)(255*d.b,0,255))}getHexString(e=r.KI_){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=s.ep.workingColorSpace){s.ep.fromWorkingColorSpace(d.copy(this),t);const n=d.r,i=d.g,r=d.b,o=Math.max(n,i,r),a=Math.min(n,i,r);let l,c;const h=(a+o)/2;if(a===o)l=0,c=0;else{const e=o-a;switch(c=h<=.5?e/(o+a):e/(2-o-a),o){case n:l=(i-r)/e+(i{"use strict";n.d(t,{PB:()=>h,QP:()=>d,ep:()=>c});var i=n(75544),s=n(23130);const r=(new s.V).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),o=(new s.V).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),a={[i.GUF]:{transfer:i.l6D,primaries:i.Vtg,toReference:e=>e,fromReference:e=>e},[i.KI_]:{transfer:i.j17,primaries:i.Vtg,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[i.AmZ]:{transfer:i.l6D,primaries:i.FVh,toReference:e=>e.applyMatrix3(o),fromReference:e=>e.applyMatrix3(r)},[i.ntt]:{transfer:i.j17,primaries:i.FVh,toReference:e=>e.convertSRGBToLinear().applyMatrix3(o),fromReference:e=>e.applyMatrix3(r).convertLinearToSRGB()}},l=new Set([i.GUF,i.AmZ]),c={enabled:!0,_workingColorSpace:i.GUF,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(e){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!e},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!l.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,n){if(!1===this.enabled||t===n||!t||!n)return e;const i=a[t].toReference;return(0,a[n].fromReference)(i(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return a[e].primaries},getTransfer:function(e){return e===i.aCh?i.l6D:a[e].transfer}};function h(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function d(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}},82954:(e,t,n)=>{"use strict";n.d(t,{U:()=>l});var i=n(78943),s=n(82587),r=n(71050);const o=new s.y,a=new i._;class l{constructor(e=0,t=0,n=0,i=l.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],h=i[9],d=i[2],u=i[6],p=i[10];switch(t){case"XYZ":this._y=Math.asin((0,r.uZ)(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(u,c),this._z=0);break;case"YXZ":this._x=Math.asin(-(0,r.uZ)(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin((0,r.uZ)(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-d,p),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-(0,r.uZ)(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(u,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin((0,r.uZ)(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-(0,r.uZ)(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(u,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return o.makeRotationFromQuaternion(e),this.setFromRotationMatrix(o,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return a.setFromEuler(this),this.setFromQuaternion(a,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}l.DEFAULT_ORDER="XYZ"},53763:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var i=n(75544),s=n(19588),r=n(57471),o=n(82094);const a=new r.a,l=new s.P;class c{constructor(e=new o.J,t=new o.J,n=new o.J,i=new o.J,s=new o.J,r=new o.J){this.planes=[e,t,n,i,s,r]}set(e,t,n,i,s,r){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(s),o[5].copy(r),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=i._RZ){const n=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],h=s[5],d=s[6],u=s[7],p=s[8],f=s[9],m=s[10],g=s[11],A=s[12],v=s[13],y=s[14],b=s[15];if(n[0].setComponents(l-r,u-c,g-p,b-A).normalize(),n[1].setComponents(l+r,u+c,g+p,b+A).normalize(),n[2].setComponents(l+o,u+h,g+f,b+v).normalize(),n[3].setComponents(l-o,u-h,g-f,b-v).normalize(),n[4].setComponents(l-a,u-d,g-m,b-y).normalize(),t===i._RZ)n[5].setComponents(l+a,u+d,g+m,b+y).normalize();else{if(t!==i.JCZ)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(a,d,m,y).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),a.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),a.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(a)}intersectsSprite(e){return a.center.set(0,0,0),a.radius=.7071067811865476,a.applyMatrix4(e.matrixWorld),this.intersectsSphere(a)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,l.y=i.normal.y>0?e.max.y:e.min.y,l.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(l)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}},71050:(e,t,n)=>{"use strict";n.d(t,{DO:()=>a,Fv:()=>m,I3:()=>o,M8:()=>g,cY:()=>f,gy:()=>p,h3:()=>u,kz:()=>c,qW:()=>r,t7:()=>h,uZ:()=>l,wt:()=>d});const i=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let s=1234567;const r=Math.PI/180,o=180/Math.PI;function a(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,s=4294967295*Math.random()|0;return(i[255&e]+i[e>>8&255]+i[e>>16&255]+i[e>>24&255]+"-"+i[255&t]+i[t>>8&255]+"-"+i[t>>16&15|64]+i[t>>24&255]+"-"+i[63&n|128]+i[n>>8&255]+"-"+i[n>>16&255]+i[n>>24&255]+i[255&s]+i[s>>8&255]+i[s>>16&255]+i[s>>24&255]).toLowerCase()}function l(e,t,n){return Math.max(t,Math.min(n,e))}function c(e,t){return(e%t+t)%t}function h(e,t,n){return(1-n)*e+n*t}function d(e){return 0==(e&e-1)&&0!==e}function u(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function p(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function f(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function m(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const g={DEG2RAD:r,RAD2DEG:o,generateUUID:a,clamp:l,euclideanModulo:c,mapLinear:function(e,t,n,i,s){return i+(e-t)*(s-i)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:h,damp:function(e,t,n,i){return h(e,t,1-Math.exp(-n*i))},pingpong:function(e,t=1){return t-Math.abs(c(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(s=e);let t=s+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*r},radToDeg:function(e){return e*o},isPowerOfTwo:d,ceilPowerOfTwo:u,floorPowerOfTwo:p,setQuaternionFromProperEuler:function(e,t,n,i,s){const r=Math.cos,o=Math.sin,a=r(n/2),l=o(n/2),c=r((t+i)/2),h=o((t+i)/2),d=r((t-i)/2),u=o((t-i)/2),p=r((i-t)/2),f=o((i-t)/2);switch(s){case"XYX":e.set(a*h,l*d,l*u,a*c);break;case"YZY":e.set(l*u,a*h,l*d,a*c);break;case"ZXZ":e.set(l*d,l*u,a*h,a*c);break;case"XZX":e.set(a*h,l*f,l*p,a*c);break;case"YXY":e.set(l*p,a*h,l*f,a*c);break;case"ZYZ":e.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}},normalize:m,denormalize:f}},23130:(e,t,n)=>{"use strict";n.d(t,{V:()=>i});class i{constructor(e,t,n,s,r,o,a,l,c){i.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,s,r,o,a,l,c)}set(e,t,n,i,s,r,o,a,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=o,c[3]=t,c[4]=s,c[5]=a,c[6]=n,c[7]=r,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,r=n[0],o=n[3],a=n[6],l=n[1],c=n[4],h=n[7],d=n[2],u=n[5],p=n[8],f=i[0],m=i[3],g=i[6],A=i[1],v=i[4],y=i[7],b=i[2],_=i[5],x=i[8];return s[0]=r*f+o*A+a*b,s[3]=r*m+o*v+a*_,s[6]=r*g+o*y+a*x,s[1]=l*f+c*A+h*b,s[4]=l*m+c*v+h*_,s[7]=l*g+c*y+h*x,s[2]=d*f+u*A+p*b,s[5]=d*m+u*v+p*_,s[8]=d*g+u*y+p*x,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return t*r*c-t*o*l-n*s*c+n*o*a+i*s*l-i*r*a}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=c*r-o*l,d=o*a-c*s,u=l*s-r*a,p=t*h+n*d+i*u;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=h*f,e[1]=(i*l-c*n)*f,e[2]=(o*n-i*r)*f,e[3]=d*f,e[4]=(c*t-i*a)*f,e[5]=(i*s-o*t)*f,e[6]=u*f,e[7]=(n*a-l*t)*f,e[8]=(r*t-n*s)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,r,o){const a=Math.cos(s),l=Math.sin(s);return this.set(n*a,n*l,-n*(a*r+l*o)+r+e,-i*l,i*a,-i*(-l*r+a*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(s.makeScale(e,t)),this}rotate(e){return this.premultiply(s.makeRotation(-e)),this}translate(e,t){return this.premultiply(s.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const s=new i},82587:(e,t,n)=>{"use strict";n.d(t,{y:()=>r});var i=n(75544),s=n(19588);class r{constructor(e,t,n,i,s,o,a,l,c,h,d,u,p,f,m,g){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,i,s,o,a,l,c,h,d,u,p,f,m,g)}set(e,t,n,i,s,r,o,a,l,c,h,d,u,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=r,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=d,g[3]=u,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new r).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/o.setFromMatrixColumn(e,0).length(),s=1/o.setFromMatrixColumn(e,1).length(),r=1/o.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*r,t[9]=n[9]*r,t[10]=n[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,r=Math.cos(n),o=Math.sin(n),a=Math.cos(i),l=Math.sin(i),c=Math.cos(s),h=Math.sin(s);if("XYZ"===e.order){const e=r*c,n=r*h,i=o*c,s=o*h;t[0]=a*c,t[4]=-a*h,t[8]=l,t[1]=n+i*l,t[5]=e-s*l,t[9]=-o*a,t[2]=s-e*l,t[6]=i+n*l,t[10]=r*a}else if("YXZ"===e.order){const e=a*c,n=a*h,i=l*c,s=l*h;t[0]=e+s*o,t[4]=i*o-n,t[8]=r*l,t[1]=r*h,t[5]=r*c,t[9]=-o,t[2]=n*o-i,t[6]=s+e*o,t[10]=r*a}else if("ZXY"===e.order){const e=a*c,n=a*h,i=l*c,s=l*h;t[0]=e-s*o,t[4]=-r*h,t[8]=i+n*o,t[1]=n+i*o,t[5]=r*c,t[9]=s-e*o,t[2]=-r*l,t[6]=o,t[10]=r*a}else if("ZYX"===e.order){const e=r*c,n=r*h,i=o*c,s=o*h;t[0]=a*c,t[4]=i*l-n,t[8]=e*l+s,t[1]=a*h,t[5]=s*l+e,t[9]=n*l-i,t[2]=-l,t[6]=o*a,t[10]=r*a}else if("YZX"===e.order){const e=r*a,n=r*l,i=o*a,s=o*l;t[0]=a*c,t[4]=s-e*h,t[8]=i*h+n,t[1]=h,t[5]=r*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*h+i,t[10]=e-s*h}else if("XZY"===e.order){const e=r*a,n=r*l,i=o*a,s=o*l;t[0]=a*c,t[4]=-h,t[8]=l*c,t[1]=e*h+s,t[5]=r*c,t[9]=n*h-i,t[2]=i*h-n,t[6]=o*c,t[10]=s*h+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(l,e,c)}lookAt(e,t,n){const i=this.elements;return u.subVectors(e,t),0===u.lengthSq()&&(u.z=1),u.normalize(),h.crossVectors(n,u),0===h.lengthSq()&&(1===Math.abs(n.z)?u.x+=1e-4:u.z+=1e-4,u.normalize(),h.crossVectors(n,u)),h.normalize(),d.crossVectors(u,h),i[0]=h.x,i[4]=d.x,i[8]=u.x,i[1]=h.y,i[5]=d.y,i[9]=u.y,i[2]=h.z,i[6]=d.z,i[10]=u.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,r=n[0],o=n[4],a=n[8],l=n[12],c=n[1],h=n[5],d=n[9],u=n[13],p=n[2],f=n[6],m=n[10],g=n[14],A=n[3],v=n[7],y=n[11],b=n[15],_=i[0],x=i[4],w=i[8],E=i[12],C=i[1],S=i[5],M=i[9],I=i[13],T=i[2],P=i[6],B=i[10],R=i[14],D=i[3],L=i[7],N=i[11],k=i[15];return s[0]=r*_+o*C+a*T+l*D,s[4]=r*x+o*S+a*P+l*L,s[8]=r*w+o*M+a*B+l*N,s[12]=r*E+o*I+a*R+l*k,s[1]=c*_+h*C+d*T+u*D,s[5]=c*x+h*S+d*P+u*L,s[9]=c*w+h*M+d*B+u*N,s[13]=c*E+h*I+d*R+u*k,s[2]=p*_+f*C+m*T+g*D,s[6]=p*x+f*S+m*P+g*L,s[10]=p*w+f*M+m*B+g*N,s[14]=p*E+f*I+m*R+g*k,s[3]=A*_+v*C+y*T+b*D,s[7]=A*x+v*S+y*P+b*L,s[11]=A*w+v*M+y*B+b*N,s[15]=A*E+v*I+y*R+b*k,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],r=e[1],o=e[5],a=e[9],l=e[13],c=e[2],h=e[6],d=e[10],u=e[14];return e[3]*(+s*a*h-i*l*h-s*o*d+n*l*d+i*o*u-n*a*u)+e[7]*(+t*a*u-t*l*d+s*r*d-i*r*u+i*l*c-s*a*c)+e[11]*(+t*l*h-t*o*u-s*r*h+n*r*u+s*o*c-n*l*c)+e[15]*(-i*o*c-t*a*h+t*o*d+i*r*h-n*r*d+n*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=e[9],d=e[10],u=e[11],p=e[12],f=e[13],m=e[14],g=e[15],A=h*m*l-f*d*l+f*a*u-o*m*u-h*a*g+o*d*g,v=p*d*l-c*m*l-p*a*u+r*m*u+c*a*g-r*d*g,y=c*f*l-p*h*l+p*o*u-r*f*u-c*o*g+r*h*g,b=p*h*a-c*f*a-p*o*d+r*f*d+c*o*m-r*h*m,_=t*A+n*v+i*y+s*b;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const x=1/_;return e[0]=A*x,e[1]=(f*d*s-h*m*s-f*i*u+n*m*u+h*i*g-n*d*g)*x,e[2]=(o*m*s-f*a*s+f*i*l-n*m*l-o*i*g+n*a*g)*x,e[3]=(h*a*s-o*d*s-h*i*l+n*d*l+o*i*u-n*a*u)*x,e[4]=v*x,e[5]=(c*m*s-p*d*s+p*i*u-t*m*u-c*i*g+t*d*g)*x,e[6]=(p*a*s-r*m*s-p*i*l+t*m*l+r*i*g-t*a*g)*x,e[7]=(r*d*s-c*a*s+c*i*l-t*d*l-r*i*u+t*a*u)*x,e[8]=y*x,e[9]=(p*h*s-c*f*s-p*n*u+t*f*u+c*n*g-t*h*g)*x,e[10]=(r*f*s-p*o*s+p*n*l-t*f*l-r*n*g+t*o*g)*x,e[11]=(c*o*s-r*h*s-c*n*l+t*h*l+r*n*u-t*o*u)*x,e[12]=b*x,e[13]=(c*f*i-p*h*i+p*n*d-t*f*d-c*n*m+t*h*m)*x,e[14]=(p*o*i-r*f*i-p*n*a+t*f*a+r*n*m-t*o*m)*x,e[15]=(r*h*i-c*o*i+c*n*a-t*h*a-r*n*d+t*o*d)*x,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,r=e.x,o=e.y,a=e.z,l=s*r,c=s*o;return this.set(l*r+n,l*o-i*a,l*a+i*o,0,l*o+i*a,c*o+n,c*a-i*r,0,l*a-i*o,c*a+i*r,s*a*a+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,r){return this.set(1,n,s,0,e,1,r,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,r=t._y,o=t._z,a=t._w,l=s+s,c=r+r,h=o+o,d=s*l,u=s*c,p=s*h,f=r*c,m=r*h,g=o*h,A=a*l,v=a*c,y=a*h,b=n.x,_=n.y,x=n.z;return i[0]=(1-(f+g))*b,i[1]=(u+y)*b,i[2]=(p-v)*b,i[3]=0,i[4]=(u-y)*_,i[5]=(1-(d+g))*_,i[6]=(m+A)*_,i[7]=0,i[8]=(p+v)*x,i[9]=(m-A)*x,i[10]=(1-(d+f))*x,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=o.set(i[0],i[1],i[2]).length();const r=o.set(i[4],i[5],i[6]).length(),l=o.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],a.copy(this);const c=1/s,h=1/r,d=1/l;return a.elements[0]*=c,a.elements[1]*=c,a.elements[2]*=c,a.elements[4]*=h,a.elements[5]*=h,a.elements[6]*=h,a.elements[8]*=d,a.elements[9]*=d,a.elements[10]*=d,t.setFromRotationMatrix(a),n.x=s,n.y=r,n.z=l,this}makePerspective(e,t,n,s,r,o,a=i._RZ){const l=this.elements,c=2*r/(t-e),h=2*r/(n-s),d=(t+e)/(t-e),u=(n+s)/(n-s);let p,f;if(a===i._RZ)p=-(o+r)/(o-r),f=-2*o*r/(o-r);else{if(a!==i.JCZ)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);p=-o/(o-r),f=-o*r/(o-r)}return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=u,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=f,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,s,r,o,a=i._RZ){const l=this.elements,c=1/(t-e),h=1/(n-s),d=1/(o-r),u=(t+e)*c,p=(n+s)*h;let f,m;if(a===i._RZ)f=(o+r)*d,m=-2*d;else{if(a!==i.JCZ)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);f=r*d,m=-1*d}return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-u,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=m,l[14]=-f,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const o=new s.P,a=new r,l=new s.P(0,0,0),c=new s.P(1,1,1),h=new s.P,d=new s.P,u=new s.P},82094:(e,t,n)=>{"use strict";n.d(t,{J:()=>l});var i=n(23130),s=n(19588);const r=new s.P,o=new s.P,a=new i.V;class l{constructor(e=new s.P(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=r.subVectors(n,t).cross(o.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(r),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||a.getNormalMatrix(e),i=this.coplanarPoint(r).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}},78943:(e,t,n)=>{"use strict";n.d(t,{_:()=>s});var i=n(71050);class s{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,r,o){let a=n[i+0],l=n[i+1],c=n[i+2],h=n[i+3];const d=s[r+0],u=s[r+1],p=s[r+2],f=s[r+3];if(0===o)return e[t+0]=a,e[t+1]=l,e[t+2]=c,void(e[t+3]=h);if(1===o)return e[t+0]=d,e[t+1]=u,e[t+2]=p,void(e[t+3]=f);if(h!==f||a!==d||l!==u||c!==p){let e=1-o;const t=a*d+l*u+c*p+h*f,n=t>=0?1:-1,i=1-t*t;if(i>Number.EPSILON){const s=Math.sqrt(i),r=Math.atan2(s,t*n);e=Math.sin(e*r)/s,o=Math.sin(o*r)/s}const s=o*n;if(a=a*e+d*s,l=l*e+u*s,c=c*e+p*s,h=h*e+f*s,e===1-o){const e=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=e,l*=e,c*=e,h*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,r){const o=n[i],a=n[i+1],l=n[i+2],c=n[i+3],h=s[r],d=s[r+1],u=s[r+2],p=s[r+3];return e[t]=o*p+c*h+a*u-l*d,e[t+1]=a*p+c*d+l*h-o*u,e[t+2]=l*p+c*u+o*d-a*h,e[t+3]=c*p-o*h-a*d-l*u,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const n=e._x,i=e._y,s=e._z,r=e._order,o=Math.cos,a=Math.sin,l=o(n/2),c=o(i/2),h=o(s/2),d=a(n/2),u=a(i/2),p=a(s/2);switch(r){case"XYZ":this._x=d*c*h+l*u*p,this._y=l*u*h-d*c*p,this._z=l*c*p+d*u*h,this._w=l*c*h-d*u*p;break;case"YXZ":this._x=d*c*h+l*u*p,this._y=l*u*h-d*c*p,this._z=l*c*p-d*u*h,this._w=l*c*h+d*u*p;break;case"ZXY":this._x=d*c*h-l*u*p,this._y=l*u*h+d*c*p,this._z=l*c*p+d*u*h,this._w=l*c*h-d*u*p;break;case"ZYX":this._x=d*c*h-l*u*p,this._y=l*u*h+d*c*p,this._z=l*c*p-d*u*h,this._w=l*c*h+d*u*p;break;case"YZX":this._x=d*c*h+l*u*p,this._y=l*u*h+d*c*p,this._z=l*c*p-d*u*h,this._w=l*c*h-d*u*p;break;case"XZY":this._x=d*c*h-l*u*p,this._y=l*u*h-d*c*p,this._z=l*c*p+d*u*h,this._w=l*c*h+d*u*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],r=t[1],o=t[5],a=t[9],l=t[2],c=t[6],h=t[10],d=n+o+h;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-a)*e,this._y=(s-l)*e,this._z=(r-i)*e}else if(n>o&&n>h){const e=2*Math.sqrt(1+n-o-h);this._w=(c-a)/e,this._x=.25*e,this._y=(i+r)/e,this._z=(s+l)/e}else if(o>h){const e=2*Math.sqrt(1+o-n-h);this._w=(s-l)/e,this._x=(i+r)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+h-n-o);this._w=(r-i)/e,this._x=(s+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(i.uZ(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,r=e._w,o=t._x,a=t._y,l=t._z,c=t._w;return this._x=n*c+r*o+i*l-s*a,this._y=i*c+r*a+s*o-n*l,this._z=s*c+r*l+n*a-i*o,this._w=r*c-n*o-i*a-s*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,i=this._y,s=this._z,r=this._w;let o=r*e._w+n*e._x+i*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=r,this._x=n,this._y=i,this._z=s,this;const a=1-o*o;if(a<=Number.EPSILON){const e=1-t;return this._w=e*r+t*this._w,this._x=e*n+t*this._x,this._y=e*i+t*this._y,this._z=e*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=r*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),n*Math.sin(s),n*Math.cos(s),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}},96643:(e,t,n)=>{"use strict";n.d(t,{z:()=>d});var i=n(19588);const s=new i.P,r=new i.P,o=new i.P,a=new i.P,l=new i.P,c=new i.P,h=new i.P;class d{constructor(e=new i.P,t=new i.P(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,s)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=s.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(s.copy(this.origin).addScaledVector(this.direction,t),s.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){r.copy(e).add(t).multiplyScalar(.5),o.copy(t).sub(e).normalize(),a.copy(this.origin).sub(r);const s=.5*e.distanceTo(t),l=-this.direction.dot(o),c=a.dot(this.direction),h=-a.dot(o),d=a.lengthSq(),u=Math.abs(1-l*l);let p,f,m,g;if(u>0)if(p=l*h-c,f=l*c-h,g=s*u,p>=0)if(f>=-g)if(f<=g){const e=1/u;p*=e,f*=e,m=p*(p+l*f+2*c)+f*(l*p+f+2*h)+d}else f=s,p=Math.max(0,-(l*f+c)),m=-p*p+f*(f+2*h)+d;else f=-s,p=Math.max(0,-(l*f+c)),m=-p*p+f*(f+2*h)+d;else f<=-g?(p=Math.max(0,-(-l*s+c)),f=p>0?-s:Math.min(Math.max(-s,-h),s),m=-p*p+f*(f+2*h)+d):f<=g?(p=0,f=Math.min(Math.max(-s,-h),s),m=f*(f+2*h)+d):(p=Math.max(0,-(l*s+c)),f=p>0?s:Math.min(Math.max(-s,-h),s),m=-p*p+f*(f+2*h)+d);else f=l>0?-s:s,p=Math.max(0,-(l*f+c)),m=-p*p+f*(f+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,p),i&&i.copy(r).addScaledVector(o,f),m}intersectSphere(e,t){s.subVectors(e.center,this.origin);const n=s.dot(this.direction),i=s.dot(s)-n*n,r=e.radius*e.radius;if(i>r)return null;const o=Math.sqrt(r-i),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,r,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,i=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,i=(e.min.x-d.x)*l),c>=0?(s=(e.min.y-d.y)*c,r=(e.max.y-d.y)*c):(s=(e.max.y-d.y)*c,r=(e.min.y-d.y)*c),n>r||s>i?null:((s>n||isNaN(n))&&(n=s),(r=0?(o=(e.min.z-d.z)*h,a=(e.max.z-d.z)*h):(o=(e.max.z-d.z)*h,a=(e.min.z-d.z)*h),n>a||o>i?null:((o>n||n!=n)&&(n=o),(a=0?n:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,s)}intersectTriangle(e,t,n,i,s){l.subVectors(t,e),c.subVectors(n,e),h.crossVectors(l,c);let r,o=this.direction.dot(h);if(o>0){if(i)return null;r=1}else{if(!(o<0))return null;r=-1,o=-o}a.subVectors(this.origin,e);const d=r*this.direction.dot(c.crossVectors(a,c));if(d<0)return null;const u=r*this.direction.dot(l.cross(a));if(u<0)return null;if(d+u>o)return null;const p=-r*a.dot(h);return p<0?null:this.at(p/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}},57471:(e,t,n)=>{"use strict";n.d(t,{a:()=>l});var i=n(37840),s=n(19588);const r=new i.Z,o=new s.P,a=new s.P;class l{constructor(e=new s.P,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):r.setFromPoints(e).getCenter(n);let i=0;for(let t=0,s=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;o.subVectors(e,this.center);const t=o.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(o,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(a.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(o.copy(e.center).add(a)),this.expandByPoint(o.copy(e.center).sub(a))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}},40693:(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var i=n(71050);class s{constructor(e=0,t=0){s.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(i.uZ(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,r=this.y-e.y;return this.x=s*n-r*i+e.x,this.y=s*i+r*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}},19588:(e,t,n)=>{"use strict";n.d(t,{P:()=>r});var i=n(71050),s=n(78943);class r{constructor(e=0,t=0,n=0){r.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(a.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(a.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,r=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*r,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*r,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*r,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,r=e.y,o=e.z,a=e.w,l=2*(r*i-o*n),c=2*(o*t-s*i),h=2*(s*n-r*t);return this.x=t+a*l+r*h-o*c,this.y=n+a*c+o*l-s*h,this.z=i+a*h+s*c-r*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,r=t.x,o=t.y,a=t.z;return this.x=i*a-s*o,this.y=s*r-n*a,this.z=n*o-i*r,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return o.copy(this).projectOnVector(e),this.sub(o)}reflect(e){return this.sub(o.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(i.uZ(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const o=new r,a=new s._},84538:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});class i{constructor(e=0,t=0,n=0,s=1){i.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i+r[12]*s,this.y=r[1]*t+r[5]*n+r[9]*i+r[13]*s,this.z=r[2]*t+r[6]*n+r[10]*i+r[14]*s,this.w=r[3]*t+r[7]*n+r[11]*i+r[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s;const r=.01,o=.1,a=e.elements,l=a[0],c=a[4],h=a[8],d=a[1],u=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-d)a&&e>A?eA?a{"use strict";n.d(t,{Z:()=>s});var i=n(25499);class s extends i.T{constructor(){super(),this.isGroup=!0,this.type="Group"}}},93122:(e,t,n)=>{"use strict";n.d(t,{x:()=>g});var i=n(57471),s=n(96643),r=n(82587),o=n(25499),a=n(19588),l=n(64026),c=n(75809),h=n(35322);const d=new a.P,u=new a.P,p=new r.y,f=new s.z,m=new i.a;class g extends o.T{constructor(e=new c.u,t=new l.n){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,i=t.count;el)continue;u.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(u);re.far||t.push({distance:r,point:d.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,r.start),i=Math.min(v.count,r.start+r.count)-1;nl)continue;u.applyMatrix4(this.matrixWorld);const i=e.ray.origin.distanceTo(u);ie.far||t.push({distance:i,point:d.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e{"use strict";n.d(t,{e:()=>l});var i=n(93122),s=n(19588),r=n(35322);const o=new s.P,a=new s.P;class l extends i.x{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,i=t.count;e{"use strict";n.d(t,{K:()=>Q});var i=n(19588),s=n(40693),r=n(57471),o=n(96643),a=n(82587),l=n(25499);const c=new i.P,h=new i.P,d=new i.P,u=new i.P,p=new i.P,f=new i.P,m=new i.P,g=new i.P,A=new i.P,v=new i.P;let y=!1;class b{constructor(e=new i.P,t=new i.P,n=new i.P){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),c.subVectors(e,t),i.cross(c);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){c.subVectors(i,t),h.subVectors(n,t),d.subVectors(e,t);const r=c.dot(c),o=c.dot(h),a=c.dot(d),l=h.dot(h),u=h.dot(d),p=r*l-o*o;if(0===p)return s.set(-2,-1,-1);const f=1/p,m=(l*a-o*u)*f,g=(r*u-o*a)*f;return s.set(1-m-g,g,m)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,u),u.x>=0&&u.y>=0&&u.x+u.y<=1}static getUV(e,t,n,i,s,r,o,a){return!1===y&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),y=!0),this.getInterpolation(e,t,n,i,s,r,o,a)}static getInterpolation(e,t,n,i,s,r,o,a){return this.getBarycoord(e,t,n,i,u),a.setScalar(0),a.addScaledVector(s,u.x),a.addScaledVector(r,u.y),a.addScaledVector(o,u.z),a}static isFrontFacing(e,t,n,i){return c.subVectors(n,t),h.subVectors(e,t),c.cross(h).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return c.subVectors(this.c,this.b),h.subVectors(this.a,this.b),.5*c.cross(h).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return b.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return b.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return!1===y&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),y=!0),b.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}getInterpolation(e,t,n,i,s){return b.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return b.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return b.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let r,o;p.subVectors(i,n),f.subVectors(s,n),g.subVectors(e,n);const a=p.dot(g),l=f.dot(g);if(a<=0&&l<=0)return t.copy(n);A.subVectors(e,i);const c=p.dot(A),h=f.dot(A);if(c>=0&&h<=c)return t.copy(i);const d=a*h-c*l;if(d<=0&&a>=0&&c<=0)return r=a/(a-c),t.copy(n).addScaledVector(p,r);v.subVectors(e,s);const u=p.dot(v),y=f.dot(v);if(y>=0&&u<=y)return t.copy(s);const b=u*l-a*y;if(b<=0&&l>=0&&y<=0)return o=l/(l-y),t.copy(n).addScaledVector(f,o);const _=c*y-u*h;if(_<=0&&h-c>=0&&u-y>=0)return m.subVectors(s,i),o=(h-c)/(h-c+(u-y)),t.copy(i).addScaledVector(m,o);const x=1/(_+b+d);return r=b*x,o=d*x,t.copy(n).addScaledVector(p,r).addScaledVector(f,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}var _=n(75544),x=n(24479),w=n(75809);const E=new a.y,C=new o.z,S=new r.a,M=new i.P,I=new i.P,T=new i.P,P=new i.P,B=new i.P,R=new i.P,D=new s.F,L=new s.F,N=new s.F,k=new i.P,O=new i.P,U=new i.P,F=new i.P,V=new i.P;class Q extends l.T{constructor(e=new w.u,t=new x.v){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2)return}E.copy(s).invert(),C.copy(e.ray).applyMatrix4(E),null!==n.boundingBox&&!1===C.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,C)}}_computeIntersections(e,t,n){let i;const s=this.geometry,r=this.material,o=s.index,a=s.attributes.position,l=s.attributes.uv,c=s.attributes.uv1,h=s.attributes.normal,d=s.groups,u=s.drawRange;if(null!==o)if(Array.isArray(r))for(let s=0,a=d.length;sn.far?null:{distance:c,point:V.clone(),object:e}}(e,t,n,r,I,T,P,F);if(u){o&&(D.fromBufferAttribute(o,c),L.fromBufferAttribute(o,h),N.fromBufferAttribute(o,d),u.uv=b.getInterpolation(F,I,T,P,D,L,N,new s.F)),a&&(D.fromBufferAttribute(a,c),L.fromBufferAttribute(a,h),N.fromBufferAttribute(a,d),u.uv1=b.getInterpolation(F,I,T,P,D,L,N,new s.F),u.uv2=u.uv1),l&&(k.fromBufferAttribute(l,c),O.fromBufferAttribute(l,h),U.fromBufferAttribute(l,d),u.normal=b.getInterpolation(F,I,T,P,k,O,U,new i.P),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const e={a:c,b:h,c:d,normal:new i.P,materialIndex:0};b.getNormal(I,T,P,e.normal),u.face=e}return u}},65996:(e,t,n)=>{"use strict";n.d(t,{o:()=>u});var i=n(75544),s=n(8035),r=n(40071),o=n(44428),a=n(8173),l=n(46953),c=n(53203),h=n(48651),d=n(19564);class u extends l.d{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},s=[n,n,n,n,n,n];void 0!==t.encoding&&((0,d.O4)("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===i.knz?i.KI_:i.aCh),this.texture=new h.B(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:i.wem}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},l=new r.D(5,5,5),h=new o.j({name:"CubemapFromEquirect",uniforms:(0,a.dw)(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:i._Li,blending:i.jFi});h.uniforms.tEquirect.value=t;const d=new s.K(l,h),u=t.minFilter;t.minFilter===i.D1R&&(t.minFilter=i.wem);return new c._(1,10,this).update(e,d),t.minFilter=u,d.geometry.dispose(),d.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,n,i);e.setRenderTarget(s)}}},46953:(e,t,n)=>{"use strict";n.d(t,{d:()=>h});var i=n(19251),s=n(21364),r=n(75544),o=n(84538),a=n(37136),l=n(19564);class c extends i.p{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new o.L(0,0,e,t),this.scissorTest=!1,this.viewport=new o.L(0,0,e,t);const i={width:e,height:t,depth:1};void 0!==n.encoding&&((0,l.O4)("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===r.knz?r.KI_:r.aCh),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:r.wem,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new s.x(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new a.H(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class h extends c{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}},7177:(e,t,n)=>{"use strict";n.d(t,{C:()=>Q});var i=n(75544),s=n(93113),r=n(53763),o=n(82587),a=n(40693),l=n(19588),c=n(84538),h=n(71050),d=n(54871),u=n(34455),p=n(26067),f=n(83596),m=n(595),g=n(49917),A=n(89479),v=n(5058),y=n(39412),b=n(24297),_=n(88753),x=n(72754),w=n(31132),E=n(27153),C=n(89321),S=n(96369),M=n(15003),I=n(84153),T=n(73981),P=n(46953),B=n(74859),R=n(14933),D=n(69963),L=n(64061),N=n(9840),k=n(53288),O=n(10267),U=n(37874),F=n(19564),V=n(19748);class Q{constructor(e={}){const{canvas:t=(0,F.O5)(),context:n=null,depth:V=!0,stencil:Q=!0,alpha:z=!1,antialias:G=!1,premultipliedAlpha:j=!0,preserveDrawingBuffer:H=!1,powerPreference:$="default",failIfMajorPerformanceCaveat:W=!1}=e;let Z;this.isWebGLRenderer=!0,Z=null!==n?n.getContextAttributes().alpha:z;const q=new Uint32Array(4),K=new Int32Array(4);let Y=null,X=null;const J=[],ee=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=i.KI_,this._useLegacyLights=!1,this.toneMapping=i.uL9,this.toneMappingExposure=1;const te=this;let ne=!1,ie=0,se=0,re=null,oe=-1,ae=null;const le=new c.L,ce=new c.L;let he=null;const de=new s.I(0);let ue=0,pe=t.width,fe=t.height,me=1,ge=null,Ae=null;const ve=new c.L(0,0,pe,fe),ye=new c.L(0,0,pe,fe);let be=!1;const _e=new r.i;let xe=!1,we=!1,Ee=null;const Ce=new o.y,Se=new a.F,Me=new l.P,Ie={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Te(){return null===re?me:1}let Pe,Be,Re,De,Le,Ne,ke,Oe,Ue,Fe,Ve,Qe,ze,Ge,je,He,$e,We,Ze,qe,Ke,Ye,Xe,Je,et=n;function tt(e,n){for(let i=0;i0),u=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,f=!!n.morphAttributes.color;let m=i.uL9;s.toneMapped&&(null!==re&&!0!==re.isXRRenderTarget||(m=te.toneMapping));const g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,A=void 0!==g?g.length:0,v=Le.get(s),y=X.state.lights;if(!0===xe&&(!0===we||e!==ae)){const t=e===ae&&s.id===oe;He.setState(s,e,t)}let b=!1;s.version===v.__version?v.needsLights&&v.lightsStateVersion!==y.state.version||v.outputColorSpace!==l||r.isInstancedMesh&&!1===v.instancing?b=!0:r.isInstancedMesh||!0!==v.instancing?r.isSkinnedMesh&&!1===v.skinning?b=!0:r.isSkinnedMesh||!0!==v.skinning?r.isInstancedMesh&&!0===v.instancingColor&&null===r.instanceColor||r.isInstancedMesh&&!1===v.instancingColor&&null!==r.instanceColor||v.envMap!==c||!0===s.fog&&v.fog!==o?b=!0:void 0===v.numClippingPlanes||v.numClippingPlanes===He.numPlanes&&v.numIntersection===He.numIntersection?(v.vertexAlphas!==h||v.vertexTangents!==d||v.morphTargets!==u||v.morphNormals!==p||v.morphColors!==f||v.toneMapping!==m||!0===Be.isWebGL2&&v.morphTargetsCount!==A)&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=s.version);let _=v.currentProgram;!0===b&&(_=At(s,t,r));let x=!1,w=!1,E=!1;const C=_.getUniforms(),S=v.uniforms;Re.useProgram(_.program)&&(x=!0,w=!0,E=!0);s.id!==oe&&(oe=s.id,w=!0);if(x||ae!==e){C.setValue(et,"projectionMatrix",e.projectionMatrix),C.setValue(et,"viewMatrix",e.matrixWorldInverse);const t=C.map.cameraPosition;void 0!==t&&t.setValue(et,Me.setFromMatrixPosition(e.matrixWorld)),Be.logarithmicDepthBuffer&&C.setValue(et,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(s.isMeshPhongMaterial||s.isMeshToonMaterial||s.isMeshLambertMaterial||s.isMeshBasicMaterial||s.isMeshStandardMaterial||s.isShaderMaterial)&&C.setValue(et,"isOrthographic",!0===e.isOrthographicCamera),ae!==e&&(ae=e,w=!0,E=!0)}if(r.isSkinnedMesh){C.setOptional(et,r,"bindMatrix"),C.setOptional(et,r,"bindMatrixInverse");const e=r.skeleton;e&&(Be.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),C.setValue(et,"boneTexture",e.boneTexture,Ne),C.setValue(et,"boneTextureSize",e.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const M=n.morphAttributes;(void 0!==M.position||void 0!==M.normal||void 0!==M.color&&!0===Be.isWebGL2)&&Ze.update(r,n,_);(w||v.receiveShadow!==r.receiveShadow)&&(v.receiveShadow=r.receiveShadow,C.setValue(et,"receiveShadow",r.receiveShadow));s.isMeshGouraudMaterial&&null!==s.envMap&&(S.envMap.value=c,S.flipEnvMap.value=c.isCubeTexture&&!1===c.isRenderTargetTexture?-1:1);w&&(C.setValue(et,"toneMappingExposure",te.toneMappingExposure),v.needsLights&&(T=E,(I=S).ambientLightColor.needsUpdate=T,I.lightProbe.needsUpdate=T,I.directionalLights.needsUpdate=T,I.directionalLightShadows.needsUpdate=T,I.pointLights.needsUpdate=T,I.pointLightShadows.needsUpdate=T,I.spotLights.needsUpdate=T,I.spotLightShadows.needsUpdate=T,I.rectAreaLights.needsUpdate=T,I.hemisphereLights.needsUpdate=T),o&&!0===s.fog&&ze.refreshFogUniforms(S,o),ze.refreshMaterialUniforms(S,s,me,fe,Ee),L.y.upload(et,vt(v),S,Ne));var I,T;s.isShaderMaterial&&!0===s.uniformsNeedUpdate&&(L.y.upload(et,vt(v),S,Ne),s.uniformsNeedUpdate=!1);s.isSpriteMaterial&&C.setValue(et,"center",r.center);if(C.setValue(et,"modelViewMatrix",r.modelViewMatrix),C.setValue(et,"normalMatrix",r.normalMatrix),C.setValue(et,"modelMatrix",r.matrixWorld),s.isShaderMaterial||s.isRawShaderMaterial){const e=s.uniformsGroups;for(let t=0,n=e.length;t{function n(){i.forEach((function(e){Le.get(e).currentProgram.isReady()&&i.delete(e)})),0!==i.size?setTimeout(n,10):t(e)}null!==Pe.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let ct=null;function ht(){ut.stop()}function dt(){ut.start()}const ut=new d.C;function pt(e,t,n,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)X.pushLight(e),e.castShadow&&X.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||_e.intersectsSprite(e)){i&&Me.setFromMatrixPosition(e.matrixWorld).applyMatrix4(Ce);const t=Ve.update(e),s=e.material;s.visible&&Y.push(e,t,s,n,Me.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||_e.intersectsObject(e))){const t=Ve.update(e),s=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),Me.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),Me.copy(t.boundingSphere.center)),Me.applyMatrix4(e.matrixWorld).applyMatrix4(Ce)),Array.isArray(s)){const i=t.groups;for(let r=0,o=i.length;r0&&function(e,t,n,s){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;const r=Be.isWebGL2;null===Ee&&(Ee=new P.d(1,1,{generateMipmaps:!0,type:Pe.has("EXT_color_buffer_half_float")?i.cLu:i.ywz,minFilter:i.D1R,samples:r?4:0}));te.getDrawingBufferSize(Se),r?Ee.setSize(Se.x,Se.y):Ee.setSize((0,h.gy)(Se.x),(0,h.gy)(Se.y));const o=te.getRenderTarget();te.setRenderTarget(Ee),te.getClearColor(de),ue=te.getClearAlpha(),ue<1&&te.setClearColor(16777215,.5);te.clear();const a=te.toneMapping;te.toneMapping=i.uL9,mt(e,n,s),Ne.updateMultisampleRenderTarget(Ee),Ne.updateRenderTargetMipmap(Ee);let l=!1;for(let e=0,r=t.length;e0&&mt(r,t,n),o.length>0&&mt(o,t,n),a.length>0&&mt(a,t,n),Re.buffers.depth.setTest(!0),Re.buffers.depth.setMask(!0),Re.buffers.color.setMask(!0),Re.setPolygonOffset(!1)}function mt(e,t,n){const i=!0===t.isScene?t.overrideMaterial:null;for(let s=0,r=e.length;s0?ee[ee.length-1]:null,J.pop(),Y=J.length>0?J[J.length-1]:null},this.getActiveCubeFace=function(){return ie},this.getActiveMipmapLevel=function(){return se},this.getRenderTarget=function(){return re},this.setRenderTargetTextures=function(e,t,n){Le.get(e.texture).__webglTexture=t,Le.get(e.depthTexture).__webglTexture=n;const i=Le.get(e);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===Pe.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const n=Le.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){re=e,ie=t,se=n;let i=!0,s=null,r=!1,o=!1;if(e){const a=Le.get(e);void 0!==a.__useDefaultFramebuffer?(Re.bindFramebuffer(et.FRAMEBUFFER,null),i=!1):void 0===a.__webglFramebuffer?Ne.setupRenderTarget(e):a.__hasExternalTextures&&Ne.rebindTextures(e,Le.get(e.texture).__webglTexture,Le.get(e.depthTexture).__webglTexture);const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=Le.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(s=Array.isArray(c[t])?c[t][n]:c[t],r=!0):s=Be.isWebGL2&&e.samples>0&&!1===Ne.useMultisampledRTT(e)?Le.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,le.copy(e.viewport),ce.copy(e.scissor),he=e.scissorTest}else le.copy(ve).multiplyScalar(me).floor(),ce.copy(ye).multiplyScalar(me).floor(),he=be;if(Re.bindFramebuffer(et.FRAMEBUFFER,s)&&Be.drawBuffers&&i&&Re.drawBuffers(e,s),Re.viewport(le),Re.scissor(ce),Re.setScissorTest(he),r){const i=Le.get(e.texture);et.framebufferTexture2D(et.FRAMEBUFFER,et.COLOR_ATTACHMENT0,et.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,n)}else if(o){const i=Le.get(e.texture),s=t||0;et.framebufferTextureLayer(et.FRAMEBUFFER,et.COLOR_ATTACHMENT0,i.__webglTexture,n||0,s)}oe=-1},this.readRenderTargetPixels=function(e,t,n,s,r,o,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let l=Le.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(l=l[a]),l){Re.bindFramebuffer(et.FRAMEBUFFER,l);try{const a=e.texture,l=a.format,c=a.type;if(l!==i.wk1&&Ye.convert(l)!==et.getParameter(et.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const h=c===i.cLu&&(Pe.has("EXT_color_buffer_half_float")||Be.isWebGL2&&Pe.has("EXT_color_buffer_float"));if(!(c===i.ywz||Ye.convert(c)===et.getParameter(et.IMPLEMENTATION_COLOR_READ_TYPE)||c===i.VzW&&(Be.isWebGL2||Pe.has("OES_texture_float")||Pe.has("WEBGL_color_buffer_float"))||h))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-s&&n>=0&&n<=e.height-r&&et.readPixels(t,n,s,r,Ye.convert(l),Ye.convert(c),o)}finally{const e=null!==re?Le.get(re).__webglFramebuffer:null;Re.bindFramebuffer(et.FRAMEBUFFER,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){const i=Math.pow(2,-n),s=Math.floor(t.image.width*i),r=Math.floor(t.image.height*i);Ne.setTexture2D(t,0),et.copyTexSubImage2D(et.TEXTURE_2D,n,0,0,e.x,e.y,s,r),Re.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i=0){const s=t.image.width,r=t.image.height,o=Ye.convert(n.format),a=Ye.convert(n.type);Ne.setTexture2D(n,0),et.pixelStorei(et.UNPACK_FLIP_Y_WEBGL,n.flipY),et.pixelStorei(et.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),et.pixelStorei(et.UNPACK_ALIGNMENT,n.unpackAlignment),t.isDataTexture?et.texSubImage2D(et.TEXTURE_2D,i,e.x,e.y,s,r,o,a,t.image.data):t.isCompressedTexture?et.compressedTexSubImage2D(et.TEXTURE_2D,i,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):et.texSubImage2D(et.TEXTURE_2D,i,e.x,e.y,o,a,t.image),0===i&&n.generateMipmaps&&et.generateMipmap(et.TEXTURE_2D),Re.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,i,s=0){if(te.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const r=e.max.x-e.min.x+1,o=e.max.y-e.min.y+1,a=e.max.z-e.min.z+1,l=Ye.convert(i.format),c=Ye.convert(i.type);let h;if(i.isData3DTexture)Ne.setTexture3D(i,0),h=et.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Ne.setTexture2DArray(i,0),h=et.TEXTURE_2D_ARRAY}et.pixelStorei(et.UNPACK_FLIP_Y_WEBGL,i.flipY),et.pixelStorei(et.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),et.pixelStorei(et.UNPACK_ALIGNMENT,i.unpackAlignment);const d=et.getParameter(et.UNPACK_ROW_LENGTH),u=et.getParameter(et.UNPACK_IMAGE_HEIGHT),p=et.getParameter(et.UNPACK_SKIP_PIXELS),f=et.getParameter(et.UNPACK_SKIP_ROWS),m=et.getParameter(et.UNPACK_SKIP_IMAGES),g=n.isCompressedTexture?n.mipmaps[0]:n.image;et.pixelStorei(et.UNPACK_ROW_LENGTH,g.width),et.pixelStorei(et.UNPACK_IMAGE_HEIGHT,g.height),et.pixelStorei(et.UNPACK_SKIP_PIXELS,e.min.x),et.pixelStorei(et.UNPACK_SKIP_ROWS,e.min.y),et.pixelStorei(et.UNPACK_SKIP_IMAGES,e.min.z),n.isDataTexture||n.isData3DTexture?et.texSubImage3D(h,s,t.x,t.y,t.z,r,o,a,l,c,g.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),et.compressedTexSubImage3D(h,s,t.x,t.y,t.z,r,o,a,l,g.data)):et.texSubImage3D(h,s,t.x,t.y,t.z,r,o,a,l,c,g),et.pixelStorei(et.UNPACK_ROW_LENGTH,d),et.pixelStorei(et.UNPACK_IMAGE_HEIGHT,u),et.pixelStorei(et.UNPACK_SKIP_PIXELS,p),et.pixelStorei(et.UNPACK_SKIP_ROWS,f),et.pixelStorei(et.UNPACK_SKIP_IMAGES,m),0===s&&i.generateMipmaps&&et.generateMipmap(h),Re.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?Ne.setTextureCube(e,0):e.isData3DTexture?Ne.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?Ne.setTexture2DArray(e,0):Ne.setTexture2D(e,0),Re.unbindTexture()},this.resetState=function(){ie=0,se=0,re=null,Re.reset(),Xe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return i._RZ}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===i.ntt?"display-p3":"srgb",t.unpackColorSpace=V.ep.workingColorSpace===i.AmZ?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===i.KI_?i.knz:i.rnI}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===i.knz?i.KI_:i.GUF}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}},76944:(e,t,n)=>{"use strict";n.d(t,{W:()=>i});const i={alphahash_fragment:"\n#ifdef USE_ALPHAHASH\n\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n\n#endif\n",alphahash_pars_fragment:"\n#ifdef USE_ALPHAHASH\n\n\t/**\n\t * See: https://casual-effects.com/research/Wyman2017Hashed/index.html\n\t */\n\n\tconst float ALPHA_HASH_SCALE = 0.05; // Derived from trials only, and may be changed.\n\n\tfloat hash2D( vec2 value ) {\n\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\n\t}\n\n\tfloat hash3D( vec3 value ) {\n\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\n\t}\n\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\n\t\t// Find the discretized derivatives of our coordinates\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\n\t\t// Find two nearest log-discretized noise scales\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\n\t\t// Compute alpha thresholds at our two noise scales\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\n\t\t// Factor to interpolate lerp with\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\n\t\t// Interpolate alpha threshold from noise at two scales\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\n\t\t// Pass into CDF to compute uniformly distrib threshold\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\n\t\t// Find our final, uniformly distributed alpha threshold (ατ)\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\n\t\t// Avoids ατ == 0. Could also do ατ =1-ατ\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\n\t}\n\n#endif\n",alphamap_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n\n#endif\n",alphamap_pars_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",alphatest_fragment:"\n#ifdef USE_ALPHATEST\n\n\tif ( diffuseColor.a < alphaTest ) discard;\n\n#endif\n",alphatest_pars_fragment:"\n#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif\n",aomap_fragment:"\n#ifdef USE_AOMAP\n\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\n\t#endif\n\n#endif\n",aomap_pars_fragment:"\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n\n#endif\n",begin_vertex:"\nvec3 transformed = vec3( position );\n\n#ifdef USE_ALPHAHASH\n\n\tvPosition = vec3( position );\n\n#endif\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n\n#ifdef USE_TANGENT\n\n\tvec3 objectTangent = vec3( tangent.xyz );\n\n#endif\n",bsdfs:"\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n",iridescence_fragment:"\n\n#ifdef USE_IRIDESCENCE\n\n\t// XYZ to linear-sRGB color space\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\n\t// Assume air interface for top\n\t// Note: We don't handle the case fresnel0 == 1\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\n\t}\n\n\t// Conversion FO/IOR\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\n\t}\n\n\t// ior is a value between 1.0 and 3.0. 1.0 is air interface\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\n\t}\n\n\t// Fresnel equations for dielectric/dielectric interfaces.\n\t// Ref: https://belcour.github.io/blog/research/2017/05/01/brdf-thin-film.html\n\t// Evaluation XYZ sensitivity curves in Fourier space\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\n\t}\n\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\n\t\tvec3 I;\n\n\t\t// Force iridescenceIOR -> outsideIOR when thinFilmThickness -> 0.0\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\t// Evaluate the cosTheta on the base layer (Snell law)\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\n\t\t// Handle TIR:\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\n\t\t\treturn vec3( 1.0 );\n\n\t\t}\n\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\n\t\t// First interface\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\n\t\t// Second interface\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); // guard against 1.0\n\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\n\t\t// Phase shift\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\n\t\t// Compound terms\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\n\t\t// Reflectance term for m = 0 (DC term amplitude)\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\n\t\t// Reflectance term for m > 0 (pairs of diracs)\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\n\t\t}\n\n\t\t// Since out of gamut colors might be produced, negative color values are clamped to 0.\n\t\treturn max( I, vec3( 0.0 ) );\n\n\t}\n\n#endif\n\n",bumpmap_pars_fragment:"\n#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n\t// https://mmikk.github.io/papers3d/mm_sfgrad_bump.pdf\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\n\t\t// normalize is done to ensure that the bump map looks the same regardless of the texture's scale\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm; // normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",clipping_planes_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvec4 plane;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\n\t\tbool clipped = true;\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t\tif ( clipped ) discard;\n\n\t#endif\n\n#endif\n",clipping_planes_pars_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n\n#endif\n",clipping_planes_pars_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvarying vec3 vClipPosition;\n\n#endif\n",clipping_planes_vertex:"\n#if NUM_CLIPPING_PLANES > 0\n\n\tvClipPosition = - mvPosition.xyz;\n\n#endif\n",color_fragment:"\n#if defined( USE_COLOR_ALPHA )\n\n\tdiffuseColor *= vColor;\n\n#elif defined( USE_COLOR )\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif\n",color_pars_fragment:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvarying vec4 vColor;\n\n#elif defined( USE_COLOR )\n\n\tvarying vec3 vColor;\n\n#endif\n",color_pars_vertex:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvarying vec4 vColor;\n\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\n\tvarying vec3 vColor;\n\n#endif\n",color_vertex:"\n#if defined( USE_COLOR_ALPHA )\n\n\tvColor = vec4( 1.0 );\n\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\n\tvColor = vec3( 1.0 );\n\n#endif\n\n#ifdef USE_COLOR\n\n\tvColor *= color;\n\n#endif\n\n#ifdef USE_INSTANCING_COLOR\n\n\tvColor.xyz *= instanceColor.xyz;\n\n#endif\n",common:"\n#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n\n#ifndef saturate\n// may have defined saturate() already\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\n\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\n\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand( const in vec2 uv ) {\n\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\n\treturn fract( sin( sn ) * c );\n\n}\n\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\n\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\n\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n\n#ifdef USE_ALPHAHASH\n\n\tvarying vec3 vPosition;\n\n#endif\n\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n}\n\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t// dir can be either a direction vector or a normal vector\n\t// upper-left 3x3 of matrix is assumed to be orthogonal\n\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n\n}\n\nmat3 transposeMat3( const in mat3 m ) {\n\n\tmat3 tmp;\n\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\n\treturn tmp;\n\n}\n\nfloat luminance( const in vec3 rgb ) {\n\n\t// assumes rgb is in linear color space with sRGB primaries and D65 white point\n\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\n\treturn dot( weights, rgb );\n\n}\n\nbool isPerspectiveMatrix( mat4 m ) {\n\n\treturn m[ 2 ][ 3 ] == - 1.0;\n\n}\n\nvec2 equirectUv( in vec3 dir ) {\n\n\t// dir is assumed to be unit length\n\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\treturn vec2( u, v );\n\n}\n\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\n\t// Original approximation by Christophe Schlick '94\n\t// float fresnel = pow( 1.0 - dotVH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH '13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n\n} // validated\n\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\n\t// Original approximation by Christophe Schlick '94\n\t// float fresnel = pow( 1.0 - dotVH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH '13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n\n} // validated\n",cube_uv_reflection_fragment:"\n#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\n\t// These shader functions convert between the UV coordinates of a single face of\n\t// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n\t// sampling a textureCube (not generally normalized ).\n\n\tfloat getFace( vec3 direction ) {\n\n\t\tvec3 absDirection = abs( direction );\n\n\t\tfloat face = - 1.0;\n\n\t\tif ( absDirection.x > absDirection.z ) {\n\n\t\t\tif ( absDirection.x > absDirection.y )\n\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t} else {\n\n\t\t\tif ( absDirection.z > absDirection.y )\n\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t}\n\n\t\treturn face;\n\n\t}\n\n\t// RH coordinate system; PMREM face-indexing convention\n\tvec2 getUV( vec3 direction, float face ) {\n\n\t\tvec2 uv;\n\n\t\tif ( face == 0.0 ) {\n\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n\n\t\t} else if ( face == 1.0 ) {\n\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n\n\t\t} else if ( face == 2.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n\n\t\t} else if ( face == 3.0 ) {\n\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n\n\t\t} else if ( face == 4.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n\n\t\t} else {\n\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n\n\t\t}\n\n\t\treturn 0.5 * ( uv + 1.0 );\n\n\t}\n\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\n\t\tfloat face = getFace( direction );\n\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\n\t\tfloat faceSize = exp2( mipInt );\n\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; // #25071\n\n\t\tif ( face > 2.0 ) {\n\n\t\t\tuv.y += faceSize;\n\n\t\t\tface -= 3.0;\n\n\t\t}\n\n\t\tuv.x += face * faceSize;\n\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\n\t\t#ifdef texture2DGradEXT\n\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; // disable anisotropic filtering\n\n\t\t#else\n\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\n\t\t#endif\n\n\t}\n\n\t// These defines must match with PMREMGenerator\n\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\n\tfloat roughnessToMip( float roughness ) {\n\n\t\tfloat mip = 0.0;\n\n\t\tif ( roughness >= cubeUV_r1 ) {\n\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\n\t\t} else {\n\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness ); // 1.16 = 1.79^0.25\n\t\t}\n\n\t\treturn mip;\n\n\t}\n\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\n\t\tfloat mipF = fract( mip );\n\n\t\tfloat mipInt = floor( mip );\n\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\n\t\tif ( mipF == 0.0 ) {\n\n\t\t\treturn vec4( color0, 1.0 );\n\n\t\t} else {\n\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\n\t\t}\n\n\t}\n\n#endif\n",defaultnormal_vertex:"\nvec3 transformedNormal = objectNormal;\n\n#ifdef USE_INSTANCING\n\n\t// this is in lieu of a per-instance normal-matrix\n\t// shear transforms in the instance matrix are not supported\n\n\tmat3 m = mat3( instanceMatrix );\n\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\n\ttransformedNormal = m * transformedNormal;\n\n#endif\n\ntransformedNormal = normalMatrix * transformedNormal;\n\n#ifdef FLIP_SIDED\n\n\ttransformedNormal = - transformedNormal;\n\n#endif\n\n#ifdef USE_TANGENT\n\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#ifdef FLIP_SIDED\n\n\t\ttransformedTangent = - transformedTangent;\n\n\t#endif\n\n#endif\n",displacementmap_pars_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n",displacementmap_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n\n#endif\n",emissivemap_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n\n#endif\n",emissivemap_pars_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n",colorspace_fragment:"\ngl_FragColor = linearToOutputTexel( gl_FragColor );\n",colorspace_pars_fragment:"\n\n// http://www.russellcottrell.com/photo/matrixCalculator.htm\n\n// Linear sRGB => XYZ => Linear Display P3\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\n\n// Linear Display P3 => XYZ => Linear sRGB\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\n\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\n\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\n\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\n\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\n\n// @deprecated, r156\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\n\n// @deprecated, r156\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}\n",envmap_fragment:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvec3 cameraToFrag;\n\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\n\t\t}\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#else\n\n\t\tvec4 envColor = vec4( 0.0 );\n\n\t#endif\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",envmap_common_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif\n",envmap_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n\n#endif\n",envmap_pars_vertex:"\n#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n#endif\n",envmap_physical_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t\t#else\n\n\t\t\treturn vec3( 0.0 );\n\n\t\t#endif\n\n\t}\n\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\n\t\t\t// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t\t#else\n\n\t\t\treturn vec3( 0.0 );\n\n\t\t#endif\n\n\t}\n\n\t#ifdef USE_ANISOTROPY\n\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\n\t\t\t // https://google.github.io/filament/Filament.md.html#lighting/imagebasedlights/anisotropy\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\n\t\t\t#else\n\n\t\t\t\treturn vec3( 0.0 );\n\n\t\t\t#endif\n\n\t\t}\n\n\t#endif\n\n#endif\n",envmap_vertex:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvWorldPosition = worldPosition.xyz;\n\n\t#else\n\n\t\tvec3 cameraToVertex;\n\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t\t}\n\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\n\n\tvFogDepth = - mvPosition.z;\n\n#endif\n",fog_pars_vertex:"\n#ifdef USE_FOG\n\n\tvarying float vFogDepth;\n\n#endif\n",fog_fragment:"\n#ifdef USE_FOG\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\n\t#endif\n\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\n#endif\n",fog_pars_fragment:"\n#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\n\t#endif\n\n#endif\n",gradientmap_pars_fragment:"\n\n#ifdef USE_GRADIENTMAP\n\n\tuniform sampler2D gradientMap;\n\n#endif\n\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\n\t// dotNL will be from -1.0 to 1.0\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\n\t#ifdef USE_GRADIENTMAP\n\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\n\t#else\n\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\n\t#endif\n\n}\n",lightmap_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n\n#endif\n",lightmap_pars_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif\n",lights_lambert_fragment:"\nLambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;\n",lights_lambert_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct LambertMaterial {\n\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n\n};\n\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n",lights_pars_begin:"\nuniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n\n#if defined( USE_LIGHT_PROBES )\n\n\tuniform vec3 lightProbe[ 9 ];\n\n#endif\n\n// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\n\t// normal is assumed to have unit length\n\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\n\t// band 1\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\n\t// band 2\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\n\treturn result;\n\n}\n\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\n\treturn irradiance;\n\n}\n\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\n\tvec3 irradiance = ambientLightColor;\n\n\treturn irradiance;\n\n}\n\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n\t#if defined ( LEGACY_LIGHTS )\n\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t\t}\n\n\t\treturn 1.0;\n\n\t#else\n\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t\t// page 32, equation 26: E[window1]\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\t\tif ( cutoffDistance > 0.0 ) {\n\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t\t}\n\n\t\treturn distanceFalloff;\n\n\t#endif\n\n}\n\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n\n}\n\n#if NUM_DIR_LIGHTS > 0\n\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\n\t}\n\n#endif\n\n\n#if NUM_POINT_LIGHTS > 0\n\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\n\t// light is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\n\t\tlight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\n\t}\n\n#endif\n\n\n#if NUM_SPOT_LIGHTS > 0\n\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\n\t// light is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\n\t\tlight.direction = normalize( lVector );\n\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\n\t\tif ( spotAttenuation > 0.0 ) {\n\n\t\t\tfloat lightDistance = length( lVector );\n\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\n\t\t} else {\n\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\n\t\t}\n\n\t}\n\n#endif\n\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\n\t// BRDF approximation Texture is 64x64\n\tuniform sampler2D ltc_1; // RGBA Float\n\tuniform sampler2D ltc_2; // RGBA Float\n\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n\n#endif\n\n\n#if NUM_HEMI_LIGHTS > 0\n\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\n\t\treturn irradiance;\n\n\t}\n\n#endif\n",lights_toon_fragment:"\nToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\n",lights_toon_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct ToonMaterial {\n\n\tvec3 diffuseColor;\n\n};\n\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n",lights_phong_fragment:"\nBlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"\nvarying vec3 vViewPosition;\n\nstruct BlinnPhongMaterial {\n\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n",lights_physical_fragment:"\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\n\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\n\nmaterial.roughness = max( roughnessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.\nmaterial.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n\n#ifdef IOR\n\n\tmaterial.ior = ior;\n\n\t#ifdef USE_SPECULAR\n\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\n\t\t#endif\n\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\n\t\t#endif\n\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\n\t#else\n\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\n\t#endif\n\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n\n#endif\n\n#ifdef USE_CLEARCOAT\n\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\n\t#ifdef USE_CLEARCOATMAP\n\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\n\t#endif\n\n\tmaterial.clearcoat = saturate( material.clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n\n#endif\n\n#ifdef USE_IRIDESCENCE\n\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\n\t#ifdef USE_IRIDESCENCEMAP\n\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\n\t#endif\n\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\n\t#else\n\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\n\t#endif\n\n#endif\n\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheenColor;\n\n\t#ifdef USE_SHEEN_COLORMAP\n\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\n\t#endif\n\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\n\t#endif\n\n#endif\n\n#ifdef USE_ANISOTROPY\n\n\t#ifdef USE_ANISOTROPYMAP\n\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\n\t#else\n\n\t\tvec2 anisotropyV = anisotropyVector;\n\n\t#endif\n\n\tmaterial.anisotropy = length( anisotropyV );\n\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\n\n\t// Roughness along the anisotropy bitangent is the material roughness, while the tangent roughness increases with anisotropy.\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;\n\n#endif\n",lights_physical_pars_fragment:'\n\nstruct PhysicalMaterial {\n\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n\n};\n\n// temporary\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\n\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n// https://google.github.io/filament/Filament.md.html#materialsystem/anisotropicmodel/anisotropicspecularbrdf\n#ifdef USE_ANISOTROPY\n\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\n\t\treturn saturate(v);\n\n\t}\n\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\n\t}\n\n#endif\n\n#ifdef USE_CLEARCOAT\n\n\t// GGX Distribution, Schlick Fresnel, GGX_SmithCorrelated Visibility\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\n\t\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\t\tfloat D = D_GGX( alpha, dotNH );\n\n\t\treturn F * ( V * D );\n\n\t}\n\n#endif\n\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\n\t#ifdef USE_IRIDESCENCE\n\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\n\t#endif\n\n\t#ifdef USE_ANISOTROPY\n\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\n\t#else\n\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\t\tfloat D = D_GGX( alpha, dotNH );\n\n\t#endif\n\n\treturn F * ( V * D );\n\n}\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\n\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\n\t// project rect onto sphere\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\n\t// calculate vector form factor\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs\nfloat D_Charlie( float roughness, float dotNH ) {\n\n\tfloat alpha = pow2( roughness );\n\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 ); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n\n}\n\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\n\treturn sheenColor * ( D * V );\n\n}\n\n#endif\n\n// This is a curve-fit approxmation to the "Charlie sheen" BRDF integrated over the hemisphere from \n// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF". The analysis can be found\n// in the Sheen section of https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tfloat r2 = roughness * roughness;\n\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\n\treturn saturate( DG * RECIPROCAL_PI );\n\n}\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\n\treturn fab;\n\n}\n\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\n\treturn specularColor * fab.x + specularF90 * fab.y;\n\n}\n\n// Fdez-Agüera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\n\t#ifdef USE_IRIDESCENCE\n\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\n\t#else\n\n\t\tvec3 Fr = specularColor;\n\n\t#endif\n\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction\n\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\n\t\t// LTC Fresnel Approximation by Stephen Hill\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\n\t}\n\n#endif\n\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\n\t#endif\n\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\n}\n\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\n\t#endif\n\n\t#ifdef USE_SHEEN\n\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\n\t#endif\n\n\t// Both indirect specular and indirect diffuse light accumulate here\n\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\n\t#ifdef USE_IRIDESCENCE\n\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\n\t#else\n\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\n\t#endif\n\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n\n}\n',lights_fragment_begin:"\n/**\n * This is a template that can be used to light a material, it uses pluggable\n * RenderEquations (RE)for specific lighting scenarios.\n *\n * Instructions for use:\n * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined\n * - Create a material parameter that is to be passed as the third parameter to your lighting functions.\n *\n * TODO:\n * - Add area light support.\n * - Add sphere light support.\n * - Add diffuse light probe (irradiance cubemap) support.\n */\n\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n\n#ifdef USE_CLEARCOAT\n\n\tgeometryClearcoatNormal = clearcoatNormal;\n\n#endif\n\n#ifdef USE_IRIDESCENCE\n\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\n\tif ( material.iridescenceThickness == 0.0 ) {\n\n\t\tmaterial.iridescence = 0.0;\n\n\t} else {\n\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\n\t}\n\n\tif ( material.iridescence > 0.0 ) {\n\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\n\t\t// Iridescence F0 approximation\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\n\t}\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\n\t\t// spot lights are ordered [shadows with maps, shadows without maps, maps without shadows, none]\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\t#if defined( USE_LIGHT_PROBES )\n\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\n\t#endif\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_fragment_maps:"\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\t#ifdef USE_ANISOTROPY\n\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\n\t#else\n\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\n\t#endif\n\n#endif\n",lights_fragment_end:"\n#if defined( RE_IndirectDiffuse )\n\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\n#endif\n",logdepthbuf_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\t// Doing a strict comparison with == 1.0 can cause noise artifacts\n\t// on some platforms. See issue #17623.\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n\n#endif\n",logdepthbuf_pars_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n\n#endif\n",logdepthbuf_pars_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\n\t#else\n\n\t\tuniform float logDepthBufFC;\n\n\t#endif\n\n#endif\n",logdepthbuf_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\n\t#else\n\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\n\t\t\tgl_Position.z *= gl_Position.w;\n\n\t\t}\n\n\t#endif\n\n#endif\n",map_fragment:"\n#ifdef USE_MAP\n\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\n\t#ifdef DECODE_VIDEO_TEXTURE\n\n\t\t// use inline sRGB decode until browsers properly support SRGB8_APLHA8 with video textures\n\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\n\tdiffuseColor *= sampledDiffuseColor;\n\n#endif\n",map_pars_fragment:"\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n",map_particle_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\t#if defined( USE_POINTS_UV )\n\n\t\tvec2 uv = vUv;\n\n\t#else\n\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n\t#endif\n\n#endif\n\n#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, uv );\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n\n#endif\n",map_particle_pars_fragment:"\n#if defined( USE_POINTS_UV )\n\n\tvarying vec2 vUv;\n\n#else\n\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\t\tuniform mat3 uvTransform;\n\n\t#endif\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",metalnessmap_fragment:"\nfloat metalnessFactor = metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n",metalnessmap_pars_fragment:"\n#ifdef USE_METALNESSMAP\n\n\tuniform sampler2D metalnessMap;\n\n#endif\n",morphcolor_vertex:"\n#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tvColor *= morphTargetBaseInfluence;\n\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t#if defined( USE_COLOR_ALPHA )\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\n\t\t#elif defined( USE_COLOR )\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\n\t\t#endif\n\n\t}\n\n#endif\n",morphnormal_vertex:"\n#ifdef USE_MORPHNORMALS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tobjectNormal *= morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\n\t\t}\n\n\t#else\n\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\n\t#endif\n\n#endif\n",morphtarget_pars_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\tuniform float morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\n\t\t}\n\n\t#else\n\n\t\t#ifndef USE_MORPHNORMALS\n\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\n\t\t#else\n\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",morphtarget_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\ttransformed *= morphTargetBaseInfluence;\n\n\t#ifdef MORPHTARGETS_TEXTURE\n\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\n\t\t}\n\n\t#else\n\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\n\t\t#ifndef USE_MORPHNORMALS\n\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",normal_fragment_begin:"\nfloat faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n\n#ifdef FLAT_SHADED\n\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#else\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal *= faceDirection;\n\n\t#endif\n\n#endif\n\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\n\t#ifdef USE_TANGENT\n\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\n\t#else\n\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\n\t#endif\n\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\n\t#endif\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\t#ifdef USE_TANGENT\n\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\n\t#else\n\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\n\t#endif\n\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\n\t#endif\n\n#endif\n\n// non perturbed normal for clearcoat among others\n\nvec3 nonPerturbedNormal = normal;\n\n",normal_fragment_maps:"\n\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n\t#ifdef FLIP_SIDED\n\n\t\tnormal = - normal;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * faceDirection;\n\n\t#endif\n\n\tnormal = normalize( normalMatrix * normal );\n\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\n\tnormal = normalize( tbn * mapN );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n\n#endif\n",normal_pars_fragment:"\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n",normal_pars_vertex:"\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n",normal_vertex:"\n#ifndef FLAT_SHADED // normal is computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n",normalmap_pars_fragment:"\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n#endif\n\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\n\tuniform mat3 normalMatrix;\n\n#endif\n\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\n\t// Normal Mapping Without Precomputed Tangents\n\t// http://www.thetenthplanet.de/archives/1180\n\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\n\t\tvec3 N = surf_norm; // normalized\n\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\n\t\treturn mat3( T * scale, B * scale, N );\n\n\t}\n\n#endif\n",clearcoat_normal_fragment_begin:"\n#ifdef USE_CLEARCOAT\n\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n\n#endif\n",clearcoat_normal_fragment_maps:"\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n\n#endif\n",clearcoat_pars_fragment:"\n\n#ifdef USE_CLEARCOATMAP\n\n\tuniform sampler2D clearcoatMap;\n\n#endif\n\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n\n#endif\n\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform sampler2D clearcoatRoughnessMap;\n\n#endif\n",iridescence_pars_fragment:"\n\n#ifdef USE_IRIDESCENCEMAP\n\n\tuniform sampler2D iridescenceMap;\n\n#endif\n\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tuniform sampler2D iridescenceThicknessMap;\n\n#endif\n",opaque_fragment:"\n#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\n\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n",packing:"\nvec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\n\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\n\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\n\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\n\treturn r * PackUpscale;\n}\n\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\n\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\n\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\n\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\n\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\n\n// NOTE: viewZ, the z-coordinate in camera space, is negative for points in front of the camera\n\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\t// -near maps to 0; -far maps to 1\n\treturn ( viewZ + near ) / ( near - far );\n}\n\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\t// maps orthographic depth in [ 0, 1 ] to viewZ\n\treturn depth * ( near - far ) - near;\n}\n\n// NOTE: https://twitter.com/gonnavis/status/1377183786949959682\n\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\t// -near maps to 0; -far maps to 1\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\n\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\t// maps perspective depth in [ 0, 1 ] to viewZ\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}\n",premultiplied_alpha_fragment:"\n#ifdef PREMULTIPLIED_ALPHA\n\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\n\tgl_FragColor.rgb *= gl_FragColor.a;\n\n#endif\n",project_vertex:"\nvec4 mvPosition = vec4( transformed, 1.0 );\n\n#ifdef USE_INSTANCING\n\n\tmvPosition = instanceMatrix * mvPosition;\n\n#endif\n\nmvPosition = modelViewMatrix * mvPosition;\n\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"\n#ifdef DITHERING\n\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\n#endif\n",dithering_pars_fragment:"\n#ifdef DITHERING\n\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift according to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\n#endif\n",roughnessmap_fragment:"\nfloat roughnessFactor = roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n",roughnessmap_pars_fragment:"\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;\n\n#endif\n",shadowmap_pars_fragment:"\n#if NUM_SPOT_LIGHT_COORDS > 0\n\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n\n#endif\n\n#if NUM_SPOT_LIGHT_MAPS > 0\n\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n\n#endif\n\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): create uniforms for area light shadows\n\n\t#endif\n\t*/\n\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n\t}\n\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\n\t}\n\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n\t\tfloat occlusion = 1.0;\n\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\n\t\tfloat hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n\t\tif (hard_shadow != 1.0 ) {\n\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality\n\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n\t\t}\n\t\treturn occlusion;\n\n\t}\n\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n\t\tfloat shadow = 1.0;\n\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\n\t\tif ( frustumTest ) {\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#else // no percentage-closer filtering:\n\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#endif\n\n\t\t}\n\n\t\treturn shadow;\n\n\t}\n\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\n\t// 2D texture:\n\t//\n\t// xzXZ\n\t// y Y\n\t//\n\t// Y - Positive y direction\n\t// y - Negative y direction\n\t// X - Positive x direction\n\t// x - Negative x direction\n\t// Z - Positive z direction\n\t// z - Negative z direction\n\t//\n\t// Source and test bed:\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\t\t// Number of texels to avoid at the edge of each square\n\n\t\tvec3 absV = abs( v );\n\n\t\t// Intersect unit cube\n\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\n\t\t// Apply scale to avoid seams\n\n\t\t// two texels less per square (one texel will do for NEAREST)\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\t\t// Unwrap\n\n\t\t// space: -1 ... 1 range for each square\n\t\t//\n\t\t// #X##\t\tdim := ( 4 , 2 )\n\t\t// # #\t\tcenter := ( 1 , 1 )\n\n\t\tvec2 planar = v.xy;\n\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\tif ( absV.z >= almostOne ) {\n\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t} else if ( absV.y >= almostOne ) {\n\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\n\t\t}\n\n\t\t// Transform to UV space\n\n\t\t// scale := 0.5 / dim\n\t\t// translate := ( center + 0.5 ) / dim\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t}\n\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\n\t\t// the vector from the light to the world-space position of the fragment.\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\n\t\t// dp = normalized distance from light to fragment position\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n\t\tdp += shadowBias;\n\n\t\t// bd3D = base direction 3D\n\t\tvec3 bd3D = normalize( lightToPosition );\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#else // no percentage-closer filtering\n\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\n\t\t#endif\n\n\t}\n\n#endif\n",shadowmap_pars_vertex:"\n\n#if NUM_SPOT_LIGHT_COORDS > 0\n\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n\n#endif\n\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n",shadowmap_vertex:"\n\n#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\n\t// Offsetting the position used for querying occlusion along the world normal can be used to reduce shadow acne.\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n\n#endif\n\n#if defined( USE_SHADOWMAP )\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\n\t\t}\n\t\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n\n// spot lights can be evaluated without active shadow mapping (when SpotLight.map is used)\n\n#if NUM_SPOT_LIGHT_COORDS > 0\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\n\t}\n\t#pragma unroll_loop_end\n\n#endif\n\n\n",shadowmask_pars_fragment:"\nfloat getShadowMask() {\n\n\tfloat shadow = 1.0;\n\n\t#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\tDirectionalLightShadow directionalLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\tSpotLightShadow spotLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\tPointLightShadow pointLight;\n\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\n\t}\n\t#pragma unroll_loop_end\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update shadow for Area light\n\n\t#endif\n\t*/\n\n\t#endif\n\n\treturn shadow;\n\n}\n",skinbase_vertex:"\n#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif\n",skinning_pars_vertex:"\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\n\tmat4 getBoneMatrix( const in float i ) {\n\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\ty = dy * ( y + 0.5 );\n\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\treturn bone;\n\n\t}\n\n#endif\n",skinning_vertex:"\n#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n",skinnormal_vertex:"\n#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n",specularmap_fragment:"\nfloat specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif\n",specularmap_pars_fragment:"\n#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif\n",tonemapping_fragment:"\n#if defined( TONE_MAPPING )\n\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n\n#endif\n",tonemapping_pars_fragment:"\n#ifndef saturate\n// may have defined saturate() already\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n\nuniform float toneMappingExposure;\n\n// exposure only\nvec3 LinearToneMapping( vec3 color ) {\n\n\treturn saturate( toneMappingExposure * color );\n\n}\n\n// source: https://www.cs.utah.edu/docs/techreports/2002/pdf/UUCS-02-001.pdf\nvec3 ReinhardToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n\n}\n\n// source: http://filmicworlds.com/blog/filmic-tonemapping-operators/\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n\n}\n\n// source: https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs\nvec3 RRTAndODTFit( vec3 v ) {\n\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n\n}\n\n// this implementation of ACES is modified to accommodate a brighter viewing environment.\n// the scale factor of 1/0.6 is subjective. see discussion in #19621.\n\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\n\t// sRGB => XYZ => D65_2_D60 => AP1 => RRT_SAT\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ), // transposed from source\n\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\n\t// ODT_SAT => XYZ => D60_2_D65 => sRGB\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ), // transposed from source\n\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\n\tcolor *= toneMappingExposure / 0.6;\n\n\tcolor = ACESInputMat * color;\n\n\t// Apply RRT and ODT\n\tcolor = RRTAndODTFit( color );\n\n\tcolor = ACESOutputMat * color;\n\n\t// Clamp to [0, 1]\n\treturn saturate( color );\n\n}\n\nvec3 CustomToneMapping( vec3 color ) { return color; }\n",transmission_fragment:"\n#ifdef USE_TRANSMISSION\n\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\n\t#endif\n\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n\n#endif\n",transmission_pars_fragment:"\n#ifdef USE_TRANSMISSION\n\n\t// Transmission code is based on glTF-Sampler-Viewer\n\t// https://github.com/KhronosGroup/glTF-Sample-Viewer\n\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\n\t#ifdef USE_TRANSMISSIONMAP\n\n\t\tuniform sampler2D transmissionMap;\n\n\t#endif\n\n\t#ifdef USE_THICKNESSMAP\n\n\t\tuniform sampler2D thicknessMap;\n\n\t#endif\n\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\n\tvarying vec3 vWorldPosition;\n\n\t// Mipped Bicubic Texture Filtering by N8\n\t// https://www.shadertoy.com/view/Dl2SDW\n\n\tfloat w0( float a ) {\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\n\t}\n\n\tfloat w1( float a ) {\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\n\t}\n\n\tfloat w2( float a ){\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\n\t}\n\n\tfloat w3( float a ) {\n\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\n\t}\n\n\t// g0 and g1 are the two amplitude functions\n\tfloat g0( float a ) {\n\n\t\treturn w0( a ) + w1( a );\n\n\t}\n\n\tfloat g1( float a ) {\n\n\t\treturn w2( a ) + w3( a );\n\n\t}\n\n\t// h0 and h1 are the two offset functions\n\tfloat h0( float a ) {\n\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\n\t}\n\n\tfloat h1( float a ) {\n\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\n\t}\n\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\n\t\tuv = uv * texelSize.zw + 0.5;\n\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\n\t}\n\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\n\t}\n\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\n\t\t// Direction of refracted light.\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\n\t\t// Compute rotation-independant scaling of the model matrix.\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\n\t\t// The thickness is specified in local space.\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\n\t}\n\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\n\t\t// Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and\n\t\t// an IOR of 1.5 results in the default amount of microfacet refraction.\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\n\t}\n\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\n\t}\n\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\n\t\tif ( isinf( attenuationDistance ) ) {\n\n\t\t\t// Attenuation distance is +∞, i.e. the transmitted color is not attenuated at all.\n\t\t\treturn vec3( 1.0 );\n\n\t\t} else {\n\n\t\t\t// Compute light attenuation using Beer's law.\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); // Beer's law\n\t\t\treturn transmittance;\n\n\t\t}\n\n\t}\n\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\n\t\t// Project refracted vector on the framebuffer, while mapping to normalized device coordinates.\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\n\t\t// Sample framebuffer to get pixel the refracted ray hits.\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\n\t\t// Get the specular component.\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\n\t\t// As less light is transmitted, the opacity should be increased. This simple approximation does a decent job \n\t\t// of modulating a CSS background, and has no effect when the buffer is opaque, due to a solid object or clear color.\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\n\t}\n#endif\n",uv_pars_fragment:"\n#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\n\tvarying vec2 vUv;\n\n#endif\n#ifdef USE_MAP\n\n\tvarying vec2 vMapUv;\n\n#endif\n#ifdef USE_ALPHAMAP\n\n\tvarying vec2 vAlphaMapUv;\n\n#endif\n#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vLightMapUv;\n\n#endif\n#ifdef USE_AOMAP\n\n\tvarying vec2 vAoMapUv;\n\n#endif\n#ifdef USE_BUMPMAP\n\n\tvarying vec2 vBumpMapUv;\n\n#endif\n#ifdef USE_NORMALMAP\n\n\tvarying vec2 vNormalMapUv;\n\n#endif\n#ifdef USE_EMISSIVEMAP\n\n\tvarying vec2 vEmissiveMapUv;\n\n#endif\n#ifdef USE_METALNESSMAP\n\n\tvarying vec2 vMetalnessMapUv;\n\n#endif\n#ifdef USE_ROUGHNESSMAP\n\n\tvarying vec2 vRoughnessMapUv;\n\n#endif\n#ifdef USE_ANISOTROPYMAP\n\n\tvarying vec2 vAnisotropyMapUv;\n\n#endif\n#ifdef USE_CLEARCOATMAP\n\n\tvarying vec2 vClearcoatMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvarying vec2 vClearcoatNormalMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tvarying vec2 vClearcoatRoughnessMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\n\tvarying vec2 vIridescenceMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tvarying vec2 vIridescenceThicknessMapUv;\n\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\n\tvarying vec2 vSheenColorMapUv;\n\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\tvarying vec2 vSheenRoughnessMapUv;\n\n#endif\n#ifdef USE_SPECULARMAP\n\n\tvarying vec2 vSpecularMapUv;\n\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\n\tvarying vec2 vSpecularColorMapUv;\n\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\n\tvarying vec2 vSpecularIntensityMapUv;\n\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n\n#endif\n#ifdef USE_THICKNESSMAP\n\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n\n#endif\n",uv_pars_vertex:"\n#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\n\tvarying vec2 vUv;\n\n#endif\n#ifdef USE_MAP\n\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n\n#endif\n#ifdef USE_ALPHAMAP\n\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n\n#endif\n#ifdef USE_LIGHTMAP\n\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n\n#endif\n#ifdef USE_AOMAP\n\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n\n#endif\n#ifdef USE_BUMPMAP\n\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n\n#endif\n#ifdef USE_NORMALMAP\n\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n\n#endif\n#ifdef USE_EMISSIVEMAP\n\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n\n#endif\n#ifdef USE_METALNESSMAP\n\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n\n#endif\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n\n#endif\n#ifdef USE_ANISOTROPYMAP\n\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n\n#endif\n#ifdef USE_CLEARCOATMAP\n\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n\n#endif\n#ifdef USE_SPECULARMAP\n\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n\n#endif\n#ifdef USE_THICKNESSMAP\n\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n\n#endif\n",uv_vertex:"\n#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\n\tvUv = vec3( uv, 1 ).xy;\n\n#endif\n#ifdef USE_MAP\n\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_ALPHAMAP\n\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_LIGHTMAP\n\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_AOMAP\n\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_BUMPMAP\n\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_NORMALMAP\n\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_EMISSIVEMAP\n\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_METALNESSMAP\n\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_ROUGHNESSMAP\n\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_ANISOTROPYMAP\n\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_CLEARCOATMAP\n\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SPECULARMAP\n\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n\n#endif\n#ifdef USE_THICKNESSMAP\n\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n\n#endif\n",worldpos_vertex:"\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n\n#endif\n",background_vert:"\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n",background_frag:"\nuniform sampler2D t2D;\nuniform float backgroundIntensity;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n\tvec4 texColor = texture2D( t2D, vUv );\n\n\t#ifdef DECODE_VIDEO_TEXTURE\n\n\t\t// use inline sRGB decode until browsers properly support SRGB8_APLHA8 with video textures\n\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\n\t#endif\n\n\ttexColor.rgb *= backgroundIntensity;\n\n\tgl_FragColor = texColor;\n\n\t#include \n\t#include \n\n}\n",backgroundCube_vert:"\nvarying vec3 vWorldDirection;\n\n#include \n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include \n\t#include \n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",backgroundCube_frag:"\n\n#ifdef ENVMAP_TYPE_CUBE\n\n\tuniform samplerCube envMap;\n\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\tuniform sampler2D envMap;\n\n#endif\n\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\n\nvarying vec3 vWorldDirection;\n\n#include \n\nvoid main() {\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\n\t#else\n\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t#endif\n\n\ttexColor.rgb *= backgroundIntensity;\n\n\tgl_FragColor = texColor;\n\n\t#include \n\t#include \n\n}\n",cube_vert:"\nvarying vec3 vWorldDirection;\n\n#include \n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include \n\t#include \n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",cube_frag:"\nuniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\n\nvarying vec3 vWorldDirection;\n\nvoid main() {\n\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\n\t#include \n\t#include \n\n}\n",depth_vert:"\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n// This is used for computing an equivalent of gl_FragCoord.z that is as high precision as possible.\n// Some platforms compute gl_FragCoord at a lower precision which makes the manually computed value better for\n// depth-based postprocessing effects. Reproduced on iPad with A10 processor / iPadOS 13.3.1.\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include \n\n\t#include \n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include \n\t\t#include \n\t\t#include \n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvHighPrecisionZW = gl_Position.zw;\n\n}\n",depth_frag:"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\n\t// Higher precision equivalent of gl_FragCoord.z. This assumes depthRange has been left to its default values.\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\n\t#endif\n\n}\n",distanceRGBA_vert:"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\t#include \n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include \n\t\t#include \n\t\t#include \n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvWorldPosition = worldPosition.xyz;\n\n}\n",distanceRGBA_frag:"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main () {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n",equirect_vert:"\nvarying vec3 vWorldDirection;\n\n#include \n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include \n\t#include \n\n}\n",equirect_frag:"\nuniform sampler2D tEquirect;\n\nvarying vec3 vWorldDirection;\n\n#include \n\nvoid main() {\n\n\tvec3 direction = normalize( vWorldDirection );\n\n\tvec2 sampleUV = equirectUv( direction );\n\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t#include \n\t#include \n\n}\n",linedashed_vert:"\nuniform float scale;\nattribute float lineDistance;\n\nvarying float vLineDistance;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\tvLineDistance = scale * lineDistance;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",linedashed_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform float dashSize;\nuniform float totalSize;\n\nvarying float vLineDistance;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\n\t\tdiscard;\n\n\t}\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include \n\t#include \n\t#include \n\n\toutgoingLight = diffuseColor.rgb; // simple shader\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshbasic_vert:"\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\n}\n",meshbasic_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include \n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshlambert_vert:"\n#define LAMBERT\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshlambert_frag:"\n#define LAMBERT\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshmatcap_vert:"\n#define MATCAP\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n}\n",meshmatcap_frag:"\n#define MATCAP\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; // 0.495 to remove artifacts caused by undersized matcap disks\n\n\t#ifdef USE_MATCAP\n\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\n\t#else\n\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); // default if matcap is missing\n\n\t#endif\n\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshnormal_vert:"\n#define NORMAL\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvViewPosition = - mvPosition.xyz;\n\n#endif\n\n}\n",meshnormal_frag:"\n#define NORMAL\n\nuniform float opacity;\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\n\t#ifdef OPAQUE\n\n\t\tgl_FragColor.a = 1.0;\n\n\t#endif\n\n}\n",meshphong_vert:"\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshphong_frag:"\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshphysical_vert:"\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifdef USE_TRANSMISSION\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\n#ifdef USE_TRANSMISSION\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif\n}\n",meshphysical_frag:"\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef IOR\n\tuniform float ior;\n#endif\n\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\n\t#include \n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\n\t#ifdef USE_SHEEN\n\n\t\t// Sheen energy compensation approximation calculation can be found at the end of\n\t\t// https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",meshtoon_vert:"\n#define TOON\n\nvarying vec3 vViewPosition;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include \n\t#include \n\t#include \n\n}\n",meshtoon_frag:"\n#define TOON\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// accumulation\n\t#include \n\t#include \n\t#include \n\t#include \n\n\t// modulation\n\t#include \n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",points_vert:"\nuniform float size;\nuniform float scale;\n\n#include \n#include \n#include \n#include \n#include \n#include \n\n#ifdef USE_POINTS_UV\n\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n\n#endif\n\nvoid main() {\n\n\t#ifdef USE_POINTS_UV\n\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\tgl_PointSize = size;\n\n\t#ifdef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\n\t#endif\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",points_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\toutgoingLight = diffuseColor.rgb;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n",shadow_vert:"\n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\t#include \n\t#include \n\t#include \n\n}\n",shadow_frag:"\nuniform vec3 color;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\n\t#include \n\t#include \n\t#include \n\n}\n",sprite_vert:"\nuniform float rotation;\nuniform vec2 center;\n\n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\n\t#ifndef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\n\t#endif\n\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\n\tmvPosition.xy += rotatedPosition;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include \n\t#include \n\t#include \n\n}\n",sprite_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid main() {\n\n\t#include \n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\n\toutgoingLight = diffuseColor.rgb;\n\n\t#include \n\t#include \n\t#include \n\t#include \n\n}\n"}},17393:(e,t,n)=>{"use strict";n.d(t,{V:()=>h});var i=n(76944),s=n(8173),r=n(40693),o=n(19588),a=n(74102),l=n(93113),c=n(23130);const h={basic:{uniforms:(0,s.Rh)([a.r.common,a.r.specularmap,a.r.envmap,a.r.aomap,a.r.lightmap,a.r.fog]),vertexShader:i.W.meshbasic_vert,fragmentShader:i.W.meshbasic_frag},lambert:{uniforms:(0,s.Rh)([a.r.common,a.r.specularmap,a.r.envmap,a.r.aomap,a.r.lightmap,a.r.emissivemap,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,a.r.fog,a.r.lights,{emissive:{value:new l.I(0)}}]),vertexShader:i.W.meshlambert_vert,fragmentShader:i.W.meshlambert_frag},phong:{uniforms:(0,s.Rh)([a.r.common,a.r.specularmap,a.r.envmap,a.r.aomap,a.r.lightmap,a.r.emissivemap,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,a.r.fog,a.r.lights,{emissive:{value:new l.I(0)},specular:{value:new l.I(1118481)},shininess:{value:30}}]),vertexShader:i.W.meshphong_vert,fragmentShader:i.W.meshphong_frag},standard:{uniforms:(0,s.Rh)([a.r.common,a.r.envmap,a.r.aomap,a.r.lightmap,a.r.emissivemap,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,a.r.roughnessmap,a.r.metalnessmap,a.r.fog,a.r.lights,{emissive:{value:new l.I(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:i.W.meshphysical_vert,fragmentShader:i.W.meshphysical_frag},toon:{uniforms:(0,s.Rh)([a.r.common,a.r.aomap,a.r.lightmap,a.r.emissivemap,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,a.r.gradientmap,a.r.fog,a.r.lights,{emissive:{value:new l.I(0)}}]),vertexShader:i.W.meshtoon_vert,fragmentShader:i.W.meshtoon_frag},matcap:{uniforms:(0,s.Rh)([a.r.common,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,a.r.fog,{matcap:{value:null}}]),vertexShader:i.W.meshmatcap_vert,fragmentShader:i.W.meshmatcap_frag},points:{uniforms:(0,s.Rh)([a.r.points,a.r.fog]),vertexShader:i.W.points_vert,fragmentShader:i.W.points_frag},dashed:{uniforms:(0,s.Rh)([a.r.common,a.r.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:i.W.linedashed_vert,fragmentShader:i.W.linedashed_frag},depth:{uniforms:(0,s.Rh)([a.r.common,a.r.displacementmap]),vertexShader:i.W.depth_vert,fragmentShader:i.W.depth_frag},normal:{uniforms:(0,s.Rh)([a.r.common,a.r.bumpmap,a.r.normalmap,a.r.displacementmap,{opacity:{value:1}}]),vertexShader:i.W.meshnormal_vert,fragmentShader:i.W.meshnormal_frag},sprite:{uniforms:(0,s.Rh)([a.r.sprite,a.r.fog]),vertexShader:i.W.sprite_vert,fragmentShader:i.W.sprite_frag},background:{uniforms:{uvTransform:{value:new c.V},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:i.W.background_vert,fragmentShader:i.W.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:i.W.backgroundCube_vert,fragmentShader:i.W.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:i.W.cube_vert,fragmentShader:i.W.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:i.W.equirect_vert,fragmentShader:i.W.equirect_frag},distanceRGBA:{uniforms:(0,s.Rh)([a.r.common,a.r.displacementmap,{referencePosition:{value:new o.P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:i.W.distanceRGBA_vert,fragmentShader:i.W.distanceRGBA_frag},shadow:{uniforms:(0,s.Rh)([a.r.lights,a.r.fog,{color:{value:new l.I(0)},opacity:{value:1}}]),vertexShader:i.W.shadow_vert,fragmentShader:i.W.shadow_frag}};h.physical={uniforms:(0,s.Rh)([h.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new c.V},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new c.V},clearcoatNormalScale:{value:new r.F(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new c.V},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new c.V},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new c.V},sheen:{value:0},sheenColor:{value:new l.I(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new c.V},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new c.V},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new c.V},transmissionSamplerSize:{value:new r.F},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new c.V},attenuationDistance:{value:0},attenuationColor:{value:new l.I(0)},specularColor:{value:new l.I(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new c.V},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new c.V},anisotropyVector:{value:new r.F},anisotropyMap:{value:null},anisotropyMapTransform:{value:new c.V}}]),vertexShader:i.W.meshphysical_vert,fragmentShader:i.W.meshphysical_frag}},89260:(e,t,n)=>{"use strict";n.d(t,{D:()=>s,u:()=>i});const i="\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n",s="\nuniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n\n#include \n\nvoid main() {\n\n\tconst float samples = float( VSM_SAMPLES );\n\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\n\t\t#ifdef HORIZONTAL_PASS\n\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\n\t\t#else\n\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\n\t\t#endif\n\n\t}\n\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n\n}\n"},74102:(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var i=n(93113),s=n(40693),r=n(23130);const o={common:{diffuse:{value:new i.I(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new r.V},alphaMap:{value:null},alphaMapTransform:{value:new r.V},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new r.V}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new r.V}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new r.V}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new r.V},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new r.V},normalScale:{value:new s.F(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new r.V},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new r.V}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new r.V}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new r.V}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new i.I(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new i.I(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new r.V},alphaTest:{value:0},uvTransform:{value:new r.V}},sprite:{diffuse:{value:new i.I(16777215)},opacity:{value:1},center:{value:new s.F(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new r.V},alphaMap:{value:null},alphaMapTransform:{value:new r.V},alphaTest:{value:0}}}},8173:(e,t,n)=>{"use strict";n.d(t,{Rh:()=>r,dw:()=>s,fd:()=>o,oD:()=>a,rD:()=>l});var i=n(19748);function s(e){const t={};for(const n in e){t[n]={};for(const i in e[n]){const s=e[n][i];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][i]=null):t[n][i]=s.clone():Array.isArray(s)?t[n][i]=s.slice():t[n][i]=s}}return t}function r(e){const t={};for(let n=0;n{"use strict";function i(){let e=null,t=!1,n=null,i=null;function s(t,r){n(t,r),i=e.requestAnimationFrame(s)}return{start:function(){!0!==t&&null!==n&&(i=e.requestAnimationFrame(s),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}n.d(t,{C:()=>i})},34455:(e,t,n)=>{"use strict";function i(e,t){const n=t.isWebGL2,i=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),i.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=i.get(t);n&&(e.deleteBuffer(n.buffer),i.delete(t))},update:function(t,s){if(t.isGLBufferAttribute){const e=i.get(t);return void((!e||e.versioni})},26067:(e,t,n)=>{"use strict";n.d(t,{a:()=>p});var i=n(75544),s=n(40071),r=n(83866),o=n(44428),a=n(93113),l=n(19748),c=n(8035),h=n(17393),d=n(8173);const u={r:0,b:0,g:0};function p(e,t,n,p,f,m,g){const A=new a.I(0);let v,y,b=!0===m?0:1,_=null,x=0,w=null;function E(t,n){t.getRGB(u,(0,d.oD)(e)),p.buffers.color.setClear(u.r,u.g,u.b,n,g)}return{getClearColor:function(){return A},setClearColor:function(e,t=1){A.set(e),b=t,E(A,b)},getClearAlpha:function(){return b},setClearAlpha:function(e){b=e,E(A,b)},render:function(a,u){let m=!1,C=!0===u.isScene?u.background:null;if(C&&C.isTexture){C=(u.backgroundBlurriness>0?n:t).get(C)}null===C?E(A,b):C&&C.isColor&&(E(C,1),m=!0);const S=e.xr.getEnvironmentBlendMode();"additive"===S?p.buffers.color.setClear(0,0,0,1,g):"alpha-blend"===S&&p.buffers.color.setClear(0,0,0,0,g),(e.autoClear||m)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),C&&(C.isCubeTexture||C.mapping===i.g8_)?(void 0===y&&(y=new c.K(new s.D(1,1,1),new o.j({name:"BackgroundCubeMaterial",uniforms:(0,d.dw)(h.V.backgroundCube.uniforms),vertexShader:h.V.backgroundCube.vertexShader,fragmentShader:h.V.backgroundCube.fragmentShader,side:i._Li,depthTest:!1,depthWrite:!1,fog:!1})),y.geometry.deleteAttribute("normal"),y.geometry.deleteAttribute("uv"),y.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(y.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),f.update(y)),y.material.uniforms.envMap.value=C,y.material.uniforms.flipEnvMap.value=C.isCubeTexture&&!1===C.isRenderTargetTexture?-1:1,y.material.uniforms.backgroundBlurriness.value=u.backgroundBlurriness,y.material.uniforms.backgroundIntensity.value=u.backgroundIntensity,y.material.toneMapped=l.ep.getTransfer(C.colorSpace)!==i.j17,_===C&&x===C.version&&w===e.toneMapping||(y.material.needsUpdate=!0,_=C,x=C.version,w=e.toneMapping),y.layers.enableAll(),a.unshift(y,y.geometry,y.material,0,0,null)):C&&C.isTexture&&(void 0===v&&(v=new c.K(new r._(2,2),new o.j({name:"BackgroundMaterial",uniforms:(0,d.dw)(h.V.background.uniforms),vertexShader:h.V.background.vertexShader,fragmentShader:h.V.background.fragmentShader,side:i.Wl3,depthTest:!1,depthWrite:!1,fog:!1})),v.geometry.deleteAttribute("normal"),Object.defineProperty(v.material,"map",{get:function(){return this.uniforms.t2D.value}}),f.update(v)),v.material.uniforms.t2D.value=C,v.material.uniforms.backgroundIntensity.value=u.backgroundIntensity,v.material.toneMapped=l.ep.getTransfer(C.colorSpace)!==i.j17,!0===C.matrixAutoUpdate&&C.updateMatrix(),v.material.uniforms.uvTransform.value.copy(C.matrix),_===C&&x===C.version&&w===e.toneMapping||(v.material.needsUpdate=!0,_=C,x=C.version,w=e.toneMapping),v.layers.enableAll(),a.unshift(v,v.geometry,v.material,0,0,null))}}}},83596:(e,t,n)=>{"use strict";n.d(t,{s:()=>s});var i=n(75544);function s(e,t,n,s){const r=e.getParameter(e.MAX_VERTEX_ATTRIBS),o=s.isWebGL2?null:t.get("OES_vertex_array_object"),a=s.isWebGL2||null!==o,l={},c=f(null);let h=c,d=!1;function u(t){return s.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function p(t){return s.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function f(e){const t=[],n=[],i=[];for(let e=0;e=0){const n=s[t];let i=r[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;o++}}return h.attributesNum!==o||h.index!==i}(r,b,p,_),x&&function(e,t,n,i){const s={},r=t.attributes;let o=0;const a=n.getAttributes();for(const t in a){if(a[t].location>=0){let n=r[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),s[t]=i,o++}}h.attributes=s,h.attributesNum=o,h.index=i}(r,b,p,_)}else{const e=!0===c.wireframe;h.geometry===b.id&&h.program===p.id&&h.wireframe===e||(h.geometry=b.id,h.program=p.id,h.wireframe=e,x=!0)}null!==_&&n.update(_,e.ELEMENT_ARRAY_BUFFER),(x||d)&&(d=!1,function(r,o,a,l){if(!1===s.isWebGL2&&(r.isInstancedMesh||l.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;m();const c=l.attributes,h=a.getAttributes(),d=o.defaultAttributeValues;for(const t in h){const o=h[t];if(o.location>=0){let a=c[t];if(void 0===a&&("instanceMatrix"===t&&r.instanceMatrix&&(a=r.instanceMatrix),"instanceColor"===t&&r.instanceColor&&(a=r.instanceColor)),void 0!==a){const t=a.normalized,c=a.itemSize,h=n.get(a);if(void 0===h)continue;const d=h.buffer,u=h.type,p=h.bytesPerElement,f=!0===s.isWebGL2&&(u===e.INT||u===e.UNSIGNED_INT||a.gpuType===i.Kz5);if(a.isInterleavedBufferAttribute){const n=a.data,i=n.stride,s=a.offset;if(n.isInstancedInterleavedBuffer){for(let e=0;e{"use strict";function i(e,t,n,i){const s=i.isWebGL2;let r;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r,1)},this.renderInstances=function(i,o,a){if(0===a)return;let l,c;if(s)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](r,i,o,a),n.update(o,r,a)}}n.d(t,{w:()=>i})},49917:(e,t,n)=>{"use strict";function i(e,t,n){let i;function s(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const r="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===e.constructor.name;let o=void 0!==n.precision?n.precision:"highp";const a=s(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=r||t.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),m=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),g=e.getParameter(e.MAX_VARYING_VECTORS),A=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),v=d>0,y=r||t.has("OES_texture_float");return{isWebGL2:r,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:s,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:d,maxTextureSize:u,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:A,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:r?e.getParameter(e.MAX_SAMPLES):0}}n.d(t,{G:()=>i})},89479:(e,t,n)=>{"use strict";n.d(t,{h:()=>r});var i=n(23130),s=n(82094);function r(e){const t=this;let n=null,r=0,o=!1,a=!1;const l=new s.J,c=new i.V,h={value:null,needsUpdate:!1};function d(e,n,i,s){const r=null!==e?e.length:0;let o=null;if(0!==r){if(o=h.value,!0!==s||null===o){const t=i+4*r,s=n.matrixWorldInverse;c.getNormalMatrix(s),(null===o||o.length0);t.numPlanes=r,t.numIntersection=0}();else{const e=a?0:r,t=4*e;let i=f.clippingState||null;h.value=i,i=d(c,s,t,l);for(let e=0;e!==t;++e)i[e]=n[e];f.clippingState=i,this.numIntersection=u?this.numPlanes:0,this.numPlanes+=e}}}},5058:(e,t,n)=>{"use strict";n.d(t,{S:()=>r});var i=n(75544),s=n(65996);function r(e){let t=new WeakMap;function n(e,t){return t===i.dSO?e.mapping=i.fY$:t===i.Bf4&&(e.mapping=i.vxC),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(o){if(o&&o.isTexture&&!1===o.isRenderTargetTexture){const a=o.mapping;if(a===i.dSO||a===i.Bf4){if(t.has(o)){return n(t.get(o).texture,o.mapping)}{const i=o.image;if(i&&i.height>0){const a=new s.o(i.height/2);return a.fromEquirectangularTexture(e,o),t.set(o,a),o.addEventListener("dispose",r),n(a.texture,o.mapping)}return null}}}return o},dispose:function(){t=new WeakMap}}}},39412:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});var i=n(75544),s=n(93612);function r(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(o){if(o&&o.isTexture){const a=o.mapping,l=a===i.dSO||a===i.Bf4,c=a===i.fY$||a===i.vxC;if(l||c){if(o.isRenderTargetTexture&&!0===o.needsPMREMUpdate){o.needsPMREMUpdate=!1;let i=t.get(o);return null===n&&(n=new s.a(e)),i=l?n.fromEquirectangular(o,i):n.fromCubemap(o,i),t.set(o,i),i.texture}if(t.has(o))return t.get(o).texture;{const i=o.image;if(l&&i&&i.height>0||c&&i&&function(e){let t=0;const n=6;for(let i=0;i{"use strict";function i(e){const t={};function n(n){if(void 0!==t[n])return t[n];let i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}n.d(t,{P:()=>i})},88753:(e,t,n)=>{"use strict";n.d(t,{Y:()=>r});var i=n(35322),s=n(19564);function r(e,t,n,r){const o={},a=new WeakMap;function l(e){const i=e.target;null!==i.index&&t.remove(i.index);for(const e in i.attributes)t.remove(i.attributes[e]);for(const e in i.morphAttributes){const n=i.morphAttributes[e];for(let e=0,i=n.length;e{"use strict";function i(e,t,n,i){const s=i.isWebGL2;let r,o,a;this.setMode=function(e){r=e},this.setIndex=function(e){o=e.type,a=e.bytesPerElement},this.render=function(t,i){e.drawElements(r,i,o,t*a),n.update(i,r,1)},this.renderInstances=function(i,l,c){if(0===c)return;let h,d;if(s)h=e,d="drawElementsInstanced";else if(h=t.get("ANGLE_instanced_arrays"),d="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[d](r,l,o,i*a,c),n.update(l,r,c)}}n.d(t,{x:()=>i})},31132:(e,t,n)=>{"use strict";function i(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,i,s){switch(t.calls++,i){case e.TRIANGLES:t.triangles+=s*(n/3);break;case e.LINES:t.lines+=s*(n/2);break;case e.LINE_STRIP:t.lines+=s*(n-1);break;case e.LINE_LOOP:t.lines+=s*n;break;case e.POINTS:t.points+=s*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}n.d(t,{I:()=>i})},19836:(e,t,n)=>{"use strict";n.d(t,{h:()=>d});var i=n(93113),s=n(82587),r=n(40693),o=n(19588),a=n(74102);function l(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new o.P,color:new i.I};break;case"SpotLight":n={position:new o.P,direction:new o.P,color:new i.I,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new o.P,color:new i.I,distance:0,decay:0};break;case"HemisphereLight":n={direction:new o.P,skyColor:new i.I,groundColor:new i.I};break;case"RectAreaLight":n={color:new i.I,position:new o.P,halfWidth:new o.P,halfHeight:new o.P}}return e[t.id]=n,n}}}let c=0;function h(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function d(e,t){const n=new l,i=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new r.F};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new r.F,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),d={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)d.probe.push(new o.P);const u=new o.P,p=new s.y,f=new s.y;return{setup:function(s,r){let o=0,l=0,u=0;for(let e=0;e<9;e++)d.probe[e].set(0,0,0);let p=0,f=0,m=0,g=0,A=0,v=0,y=0,b=0,_=0,x=0,w=0;s.sort(h);const E=!0===r?Math.PI:1;for(let e=0,t=s.length;e0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(d.rectAreaLTC1=a.r.LTC_FLOAT_1,d.rectAreaLTC2=a.r.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(d.rectAreaLTC1=a.r.LTC_HALF_1,d.rectAreaLTC2=a.r.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),d.ambient[0]=o,d.ambient[1]=l,d.ambient[2]=u;const C=d.hash;C.directionalLength===p&&C.pointLength===f&&C.spotLength===m&&C.rectAreaLength===g&&C.hemiLength===A&&C.numDirectionalShadows===v&&C.numPointShadows===y&&C.numSpotShadows===b&&C.numSpotMaps===_&&C.numLightProbes===w||(d.directional.length=p,d.spot.length=m,d.rectArea.length=g,d.point.length=f,d.hemi.length=A,d.directionalShadow.length=v,d.directionalShadowMap.length=v,d.pointShadow.length=y,d.pointShadowMap.length=y,d.spotShadow.length=b,d.spotShadowMap.length=b,d.directionalShadowMatrix.length=v,d.pointShadowMatrix.length=y,d.spotLightMatrix.length=b+_-x,d.spotLightMap.length=_,d.numSpotLightShadowsWithMaps=x,d.numLightProbes=w,C.directionalLength=p,C.pointLength=f,C.spotLength=m,C.rectAreaLength=g,C.hemiLength=A,C.numDirectionalShadows=v,C.numPointShadows=y,C.numSpotShadows=b,C.numSpotMaps=_,C.numLightProbes=w,d.version=c++)},setupView:function(e,t){let n=0,i=0,s=0,r=0,o=0;const a=t.matrixWorldInverse;for(let t=0,l=e.length;t{"use strict";n.d(t,{J:()=>r});var i=n(75544),s=n(8173);function r(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(s,r){s.opacity.value=r.opacity,r.color&&s.diffuse.value.copy(r.color),r.emissive&&s.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(s.map.value=r.map,n(r.map,s.mapTransform)),r.alphaMap&&(s.alphaMap.value=r.alphaMap,n(r.alphaMap,s.alphaMapTransform)),r.bumpMap&&(s.bumpMap.value=r.bumpMap,n(r.bumpMap,s.bumpMapTransform),s.bumpScale.value=r.bumpScale,r.side===i._Li&&(s.bumpScale.value*=-1)),r.normalMap&&(s.normalMap.value=r.normalMap,n(r.normalMap,s.normalMapTransform),s.normalScale.value.copy(r.normalScale),r.side===i._Li&&s.normalScale.value.negate()),r.displacementMap&&(s.displacementMap.value=r.displacementMap,n(r.displacementMap,s.displacementMapTransform),s.displacementScale.value=r.displacementScale,s.displacementBias.value=r.displacementBias),r.emissiveMap&&(s.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,s.emissiveMapTransform)),r.specularMap&&(s.specularMap.value=r.specularMap,n(r.specularMap,s.specularMapTransform)),r.alphaTest>0&&(s.alphaTest.value=r.alphaTest);const o=t.get(r).envMap;if(o&&(s.envMap.value=o,s.flipEnvMap.value=o.isCubeTexture&&!1===o.isRenderTargetTexture?-1:1,s.reflectivity.value=r.reflectivity,s.ior.value=r.ior,s.refractionRatio.value=r.refractionRatio),r.lightMap){s.lightMap.value=r.lightMap;const t=!0===e._useLegacyLights?Math.PI:1;s.lightMapIntensity.value=r.lightMapIntensity*t,n(r.lightMap,s.lightMapTransform)}r.aoMap&&(s.aoMap.value=r.aoMap,s.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,s.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,(0,s.oD)(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,s,o,a,l){s.isMeshBasicMaterial||s.isMeshLambertMaterial?r(e,s):s.isMeshToonMaterial?(r(e,s),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,s)):s.isMeshPhongMaterial?(r(e,s),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,s)):s.isMeshStandardMaterial?(r(e,s),function(e,i){e.metalness.value=i.metalness,i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap,n(i.metalnessMap,e.metalnessMapTransform));e.roughness.value=i.roughness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap,n(i.roughnessMap,e.roughnessMapTransform));t.get(i).envMap&&(e.envMapIntensity.value=i.envMapIntensity)}(e,s),s.isMeshPhysicalMaterial&&function(e,t,s){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform)));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===i._Li&&e.clearcoatNormalScale.value.negate()));t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform)));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=s.texture,e.transmissionSamplerSize.value.set(s.width,s.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform)));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform));t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}(e,s,l)):s.isMeshMatcapMaterial?(r(e,s),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,s)):s.isMeshDepthMaterial?r(e,s):s.isMeshDistanceMaterial?(r(e,s),function(e,n){const i=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(i.matrixWorld),e.nearDistance.value=i.shadow.camera.near,e.farDistance.value=i.shadow.camera.far}(e,s)):s.isMeshNormalMaterial?r(e,s):s.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(e,s),s.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,s)):s.isPointsMaterial?function(e,t,i,s){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*i,e.scale.value=.5*s,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,s,o,a):s.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform));t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform));t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,s):s.isShadowMaterial?(e.color.value.copy(s.color),e.opacity.value=s.opacity):s.isShaderMaterial&&(s.uniformsNeedUpdate=!1)}}}},27153:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var i=n(75544),s=n(57938),r=n(84538),o=n(40693);function a(e,t){return e[0]-t[0]}function l(e,t){return Math.abs(t[1])-Math.abs(e[1])}function c(e,t,n){const c={},h=new Float32Array(8),d=new WeakMap,u=new r.L,p=[];for(let e=0;e<8;e++)p[e]=[e,0];return{update:function(r,f,m){const g=r.morphTargetInfluences;if(!0===t.isWebGL2){const A=f.morphAttributes.position||f.morphAttributes.normal||f.morphAttributes.color,v=void 0!==A?A.length:0;let y=d.get(f);if(void 0===y||y.count!==v){void 0!==y&&y.texture.dispose();const x=void 0!==f.morphAttributes.position,w=void 0!==f.morphAttributes.normal,E=void 0!==f.morphAttributes.color,C=f.morphAttributes.position||[],S=f.morphAttributes.normal||[],M=f.morphAttributes.color||[];let I=0;!0===x&&(I=1),!0===w&&(I=2),!0===E&&(I=3);let T=f.attributes.position.count*I,P=1;T>t.maxTextureSize&&(P=Math.ceil(T/t.maxTextureSize),T=t.maxTextureSize);const B=new Float32Array(T*P*4*v),R=new s.p(B,T,P,v);R.type=i.VzW,R.needsUpdate=!0;const D=4*I;for(let N=0;N{"use strict";function i(e,t,n,i){let s=new WeakMap;function r(e){const t=e.target;t.removeEventListener("dispose",r),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(o){const a=i.render.frame,l=o.geometry,c=t.get(o,l);if(s.get(c)!==a&&(t.update(c),s.set(c,a)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",r)&&o.addEventListener("dispose",r),s.get(o)!==a&&(n.update(o.instanceMatrix,e.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,e.ARRAY_BUFFER),s.set(o,a))),o.isSkinnedMesh){const e=o.skeleton;s.get(e)!==a&&(e.update(),s.set(e,a))}return c},dispose:function(){s=new WeakMap}}}n.d(t,{E:()=>i})},48580:(e,t,n)=>{"use strict";n.d(t,{d:()=>w});var i=n(64061),s=n(31685),r=n(76944),o=n(75544),a=n(19748);let l=0;function c(e,t,n){const i=e.getShaderParameter(t,e.COMPILE_STATUS),s=e.getShaderInfoLog(t).trim();if(i&&""===s)return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const i=parseInt(r[1]);return n.toUpperCase()+"\n\n"+s+"\n\n"+function(e,t){const n=e.split("\n"),i=[],s=Math.max(t-6,0),r=Math.min(t+6,n.length);for(let e=s;e":" "} ${s}: ${n[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}return s}function h(e,t){const n=function(e){const t=a.ep.getPrimaries(a.ep.workingColorSpace),n=a.ep.getPrimaries(e);let i;switch(t===n?i="":t===o.FVh&&n===o.Vtg?i="LinearDisplayP3ToLinearSRGB":t===o.Vtg&&n===o.FVh&&(i="LinearSRGBToLinearDisplayP3"),e){case o.GUF:case o.AmZ:return[i,"LinearTransferOETF"];case o.KI_:case o.ntt:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[i,"LinearTransferOETF"]}}(t);return`vec4 ${e}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function d(e,t){let n;switch(t){case o.EoG:n="Linear";break;case o.CdI:n="Reinhard";break;case o.YGz:n="OptimizedCineon";break;case o.LY2:n="ACESFilmic";break;case o.dZ3:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function u(e){return""!==e}function p(e,t){const n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function f(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const m=/^[ \t]*#include +<([\w\d./]+)>/gm;function g(e){return e.replace(m,v)}const A=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function v(e,t){let n=r.W[t];if(void 0===n){const e=A.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");n=r.W[e],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e)}return g(n)}const y=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function b(e){return e.replace(y,_)}function _(e,t,n,i){let s="";for(let e=parseInt(t);e0&&(P+="\n"),B=[M,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,I].filter(u).join("\n"),B.length>0&&(B+="\n")):(P=[x(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,I,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+E:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+_:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(u).join("\n"),B=[M,x(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,I,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+w:"",n.envMap?"#define "+E:"",n.envMap?"#define "+C:"",S?"#define CUBEUV_TEXEL_WIDTH "+S.texelWidth:"",S?"#define CUBEUV_TEXEL_HEIGHT "+S.texelHeight:"",S?"#define CUBEUV_MAX_MIP "+S.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+_:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==o.uL9?"#define TONE_MAPPING":"",n.toneMapping!==o.uL9?r.W.tonemapping_pars_fragment:"",n.toneMapping!==o.uL9?d("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",r.W.colorspace_pars_fragment,h("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(u).join("\n")),v=g(v),v=p(v,n),v=f(v,n),y=g(y),y=p(y,n),y=f(y,n),v=b(v),y=b(y),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(R="#version 300 es\n",P=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+P,B=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===o.LSk?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===o.LSk?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+B);const D=R+P+v,L=R+B+y,N=(0,s.d)(m,m.VERTEX_SHADER,D),k=(0,s.d)(m,m.FRAGMENT_SHADER,L);function O(t){if(e.debug.checkShaderErrors){const n=m.getProgramInfoLog(T).trim(),i=m.getShaderInfoLog(N).trim(),s=m.getShaderInfoLog(k).trim();let r=!0,o=!0;if(!1===m.getProgramParameter(T,m.LINK_STATUS))if(r=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(m,T,N,k);else{const e=c(m,N,"vertex"),t=c(m,k,"fragment");console.error("THREE.WebGLProgram: Shader Error "+m.getError()+" - VALIDATE_STATUS "+m.getProgramParameter(T,m.VALIDATE_STATUS)+"\n\nProgram Info Log: "+n+"\n"+e+"\n"+t)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==i&&""!==s||(o=!1);o&&(t.diagnostics={runnable:r,programLog:n,vertexShader:{log:i,prefix:P},fragmentShader:{log:s,prefix:B}})}m.deleteShader(N),m.deleteShader(k),U=new i.y(m,T),F=function(e,t){const n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let s=0;s{"use strict";n.d(t,{Z:()=>h});var i=n(75544),s=n(45787),r=n(48580),o=n(97386),a=n(17393),l=n(8173),c=n(19748);function h(e,t,n,h,d,u,p){const f=new s.S,m=new o.T,g=[],A=d.isWebGL2,v=d.logarithmicDepthBuffer,y=d.vertexTextures;let b=d.precision;const _={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function x(e){return 0===e?"uv":`uv${e}`}return{getParameters:function(s,r,o,l,u){const f=l.fog,g=u.geometry,w=s.isMeshStandardMaterial?l.environment:null,E=(s.isMeshStandardMaterial?n:t).get(s.envMap||w),C=E&&E.mapping===i.g8_?E.image.height:null,S=_[s.type];null!==s.precision&&(b=d.getMaxPrecision(s.precision),b!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",b,"instead."));const M=g.morphAttributes.position||g.morphAttributes.normal||g.morphAttributes.color,I=void 0!==M?M.length:0;let T,P,B,R,D=0;if(void 0!==g.morphAttributes.position&&(D=1),void 0!==g.morphAttributes.normal&&(D=2),void 0!==g.morphAttributes.color&&(D=3),S){const e=a.V[S];T=e.vertexShader,P=e.fragmentShader}else T=s.vertexShader,P=s.fragmentShader,m.update(s),B=m.getVertexShaderID(s),R=m.getFragmentShaderID(s);const L=e.getRenderTarget(),N=!0===u.isInstancedMesh,k=!!s.map,O=!!s.matcap,U=!!E,F=!!s.aoMap,V=!!s.lightMap,Q=!!s.bumpMap,z=!!s.normalMap,G=!!s.displacementMap,j=!!s.emissiveMap,H=!!s.metalnessMap,$=!!s.roughnessMap,W=s.anisotropy>0,Z=s.clearcoat>0,q=s.iridescence>0,K=s.sheen>0,Y=s.transmission>0,X=W&&!!s.anisotropyMap,J=Z&&!!s.clearcoatMap,ee=Z&&!!s.clearcoatNormalMap,te=Z&&!!s.clearcoatRoughnessMap,ne=q&&!!s.iridescenceMap,ie=q&&!!s.iridescenceThicknessMap,se=K&&!!s.sheenColorMap,re=K&&!!s.sheenRoughnessMap,oe=!!s.specularMap,ae=!!s.specularColorMap,le=!!s.specularIntensityMap,ce=Y&&!!s.transmissionMap,he=Y&&!!s.thicknessMap,de=!!s.gradientMap,ue=!!s.alphaMap,pe=s.alphaTest>0,fe=!!s.alphaHash,me=!!s.extensions,ge=!!g.attributes.uv1,Ae=!!g.attributes.uv2,ve=!!g.attributes.uv3;let ye=i.uL9;return s.toneMapped&&(null!==L&&!0!==L.isXRRenderTarget||(ye=e.toneMapping)),{isWebGL2:A,shaderID:S,shaderType:s.type,shaderName:s.name,vertexShader:T,fragmentShader:P,defines:s.defines,customVertexShaderID:B,customFragmentShaderID:R,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:b,instancing:N,instancingColor:N&&null!==u.instanceColor,supportsVertexTextures:y,outputColorSpace:null===L?e.outputColorSpace:!0===L.isXRRenderTarget?L.texture.colorSpace:i.GUF,map:k,matcap:O,envMap:U,envMapMode:U&&E.mapping,envMapCubeUVHeight:C,aoMap:F,lightMap:V,bumpMap:Q,normalMap:z,displacementMap:y&&G,emissiveMap:j,normalMapObjectSpace:z&&s.normalMapType===i.PA7,normalMapTangentSpace:z&&s.normalMapType===i.IOt,metalnessMap:H,roughnessMap:$,anisotropy:W,anisotropyMap:X,clearcoat:Z,clearcoatMap:J,clearcoatNormalMap:ee,clearcoatRoughnessMap:te,iridescence:q,iridescenceMap:ne,iridescenceThicknessMap:ie,sheen:K,sheenColorMap:se,sheenRoughnessMap:re,specularMap:oe,specularColorMap:ae,specularIntensityMap:le,transmission:Y,transmissionMap:ce,thicknessMap:he,gradientMap:de,opaque:!1===s.transparent&&s.blending===i.bdR,alphaMap:ue,alphaTest:pe,alphaHash:fe,combine:s.combine,mapUv:k&&x(s.map.channel),aoMapUv:F&&x(s.aoMap.channel),lightMapUv:V&&x(s.lightMap.channel),bumpMapUv:Q&&x(s.bumpMap.channel),normalMapUv:z&&x(s.normalMap.channel),displacementMapUv:G&&x(s.displacementMap.channel),emissiveMapUv:j&&x(s.emissiveMap.channel),metalnessMapUv:H&&x(s.metalnessMap.channel),roughnessMapUv:$&&x(s.roughnessMap.channel),anisotropyMapUv:X&&x(s.anisotropyMap.channel),clearcoatMapUv:J&&x(s.clearcoatMap.channel),clearcoatNormalMapUv:ee&&x(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:te&&x(s.clearcoatRoughnessMap.channel),iridescenceMapUv:ne&&x(s.iridescenceMap.channel),iridescenceThicknessMapUv:ie&&x(s.iridescenceThicknessMap.channel),sheenColorMapUv:se&&x(s.sheenColorMap.channel),sheenRoughnessMapUv:re&&x(s.sheenRoughnessMap.channel),specularMapUv:oe&&x(s.specularMap.channel),specularColorMapUv:ae&&x(s.specularColorMap.channel),specularIntensityMapUv:le&&x(s.specularIntensityMap.channel),transmissionMapUv:ce&&x(s.transmissionMap.channel),thicknessMapUv:he&&x(s.thicknessMap.channel),alphaMapUv:ue&&x(s.alphaMap.channel),vertexTangents:!!g.attributes.tangent&&(z||W),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!g.attributes.color&&4===g.attributes.color.itemSize,vertexUv1s:ge,vertexUv2s:Ae,vertexUv3s:ve,pointsUvs:!0===u.isPoints&&!!g.attributes.uv&&(k||ue),fog:!!f,useFog:!0===s.fog,fogExp2:f&&f.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:v,skinning:!0===u.isSkinnedMesh,morphTargets:void 0!==g.morphAttributes.position,morphNormals:void 0!==g.morphAttributes.normal,morphColors:void 0!==g.morphAttributes.color,morphTargetsCount:I,morphTextureStride:D,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numSpotLightMaps:r.spotLightMap.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numDirLightShadows:r.directionalShadowMap.length,numPointLightShadows:r.pointShadowMap.length,numSpotLightShadows:r.spotShadowMap.length,numSpotLightShadowsWithMaps:r.numSpotLightShadowsWithMaps,numLightProbes:r.numLightProbes,numClippingPlanes:p.numPlanes,numClipIntersection:p.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&o.length>0,shadowMapType:e.shadowMap.type,toneMapping:ye,useLegacyLights:e._useLegacyLights,decodeVideoTexture:k&&!0===s.map.isVideoTexture&&c.ep.getTransfer(s.map.colorSpace)===i.j17,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===i.ehD,flipSided:s.side===i._Li,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:me&&!0===s.extensions.derivatives,extensionFragDepth:me&&!0===s.extensions.fragDepth,extensionDrawBuffers:me&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:me&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:A||h.has("EXT_frag_depth"),rendererExtensionDrawBuffers:A||h.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:A||h.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:h.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){f.disableAll(),t.isWebGL2&&f.enable(0);t.supportsVertexTextures&&f.enable(1);t.instancing&&f.enable(2);t.instancingColor&&f.enable(3);t.matcap&&f.enable(4);t.envMap&&f.enable(5);t.normalMapObjectSpace&&f.enable(6);t.normalMapTangentSpace&&f.enable(7);t.clearcoat&&f.enable(8);t.iridescence&&f.enable(9);t.alphaTest&&f.enable(10);t.vertexColors&&f.enable(11);t.vertexAlphas&&f.enable(12);t.vertexUv1s&&f.enable(13);t.vertexUv2s&&f.enable(14);t.vertexUv3s&&f.enable(15);t.vertexTangents&&f.enable(16);t.anisotropy&&f.enable(17);t.alphaHash&&f.enable(18);e.push(f.mask),f.disableAll(),t.fog&&f.enable(0);t.useFog&&f.enable(1);t.flatShading&&f.enable(2);t.logarithmicDepthBuffer&&f.enable(3);t.skinning&&f.enable(4);t.morphTargets&&f.enable(5);t.morphNormals&&f.enable(6);t.morphColors&&f.enable(7);t.premultipliedAlpha&&f.enable(8);t.shadowMapEnabled&&f.enable(9);t.useLegacyLights&&f.enable(10);t.doubleSided&&f.enable(11);t.flipSided&&f.enable(12);t.useDepthPacking&&f.enable(13);t.dithering&&f.enable(14);t.transmission&&f.enable(15);t.sheen&&f.enable(16);t.opaque&&f.enable(17);t.pointsUvs&&f.enable(18);t.decodeVideoTexture&&f.enable(19);e.push(f.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=_[e.type];let n;if(t){const e=a.V[t];n=l.rD.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let i;for(let e=0,t=g.length;e{"use strict";function i(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}n.d(t,{Z:()=>i})},84153:(e,t,n)=>{"use strict";function i(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function s(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function r(){const e=[];let t=0;const n=[],r=[],o=[];function a(n,i,s,r,o,a){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:s,groupOrder:r,renderOrder:n.renderOrder,z:o,group:a},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=s,l.groupOrder=r,l.renderOrder=n.renderOrder,l.z=o,l.group=a),t++,l}return{opaque:n,transmissive:r,transparent:o,init:function(){t=0,n.length=0,r.length=0,o.length=0},push:function(e,t,i,s,l,c){const h=a(e,t,i,s,l,c);i.transmission>0?r.push(h):!0===i.transparent?o.push(h):n.push(h)},unshift:function(e,t,i,s,l,c){const h=a(e,t,i,s,l,c);i.transmission>0?r.unshift(h):!0===i.transparent?o.unshift(h):n.unshift(h)},finish:function(){for(let n=t,i=e.length;n1&&n.sort(e||i),r.length>1&&r.sort(t||s),o.length>1&&o.sort(t||s)}}}function o(){let e=new WeakMap;return{get:function(t,n){const i=e.get(t);let s;return void 0===i?(s=new r,e.set(t,[s])):n>=i.length?(s=new r,i.push(s)):s=i[n],s},dispose:function(){e=new WeakMap}}}n.d(t,{M:()=>o})},73981:(e,t,n)=>{"use strict";n.d(t,{Q:()=>r});var i=n(19836);function s(e,t){const n=new i.h(e,t),s=[],r=[];return{init:function(){s.length=0,r.length=0},state:{lightsArray:s,shadowsArray:r,lights:n},setupLights:function(e){n.setup(s,e)},setupLightsView:function(e){n.setupView(s,e)},pushLight:function(e){s.push(e)},pushShadow:function(e){r.push(e)}}}function r(e,t){let n=new WeakMap;return{get:function(i,r=0){const o=n.get(i);let a;return void 0===o?(a=new s(e,t),n.set(i,[a])):r>=o.length?(a=new s(e,t),o.push(a)):a=o[r],a},dispose:function(){n=new WeakMap}}}},31685:(e,t,n)=>{"use strict";function i(e,t,n){const i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}n.d(t,{d:()=>i})},97386:(e,t,n)=>{"use strict";n.d(t,{T:()=>s});let i=0;class s{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),r=this._getShaderCacheForMaterial(e);return!1===r.has(i)&&(r.add(i),i.usedTimes++),!1===r.has(s)&&(r.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new r(e),t.set(e,n)),n}}class r{constructor(e){this.id=i++,this.code=e,this.usedTimes=0}}},74859:(e,t,n)=>{"use strict";n.d(t,{c:()=>m});var i=n(75544),s=n(46953),r=n(90652),o=n(35536),a=n(44428),l=n(35322),c=n(75809),h=n(8035),d=n(84538),u=n(40693),p=n(53763),f=n(89260);function m(e,t,n){let m=new p.i;const g=new u.F,A=new u.F,v=new d.L,y=new r.l({depthPacking:i.mSO}),b=new o.L,_={},x=n.maxTextureSize,w={[i.Wl3]:i._Li,[i._Li]:i.Wl3,[i.ehD]:i.ehD},E=new a.j({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new u.F},radius:{value:4}},vertexShader:f.u,fragmentShader:f.D}),C=E.clone();C.defines.HORIZONTAL_PASS=1;const S=new c.u;S.setAttribute("position",new l.Tl(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new h.K(S,E),I=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=i._iA;let T=this.type;function P(n,i){const r=t.update(M);E.defines.VSM_SAMPLES!==n.blurSamples&&(E.defines.VSM_SAMPLES=n.blurSamples,C.defines.VSM_SAMPLES=n.blurSamples,E.needsUpdate=!0,C.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new s.d(g.x,g.y)),E.uniforms.shadow_pass.value=n.map.texture,E.uniforms.resolution.value=n.mapSize,E.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,E,M,null),C.uniforms.shadow_pass.value=n.mapPass.texture,C.uniforms.resolution.value=n.mapSize,C.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,C,M,null)}function B(t,n,s,r){let o=null;const a=!0===s.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==a)o=a;else if(o=!0===s.isPointLight?b:y,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const e=o.uuid,t=n.uuid;let i=_[e];void 0===i&&(i={},_[e]=i);let s=i[t];void 0===s&&(s=o.clone(),i[t]=s),o=s}if(o.visible=n.visible,o.wireframe=n.wireframe,r===i.dwk?o.side=null!==n.shadowSide?n.shadowSide:n.side:o.side=null!==n.shadowSide?n.shadowSide:w[n.side],o.alphaMap=n.alphaMap,o.alphaTest=n.alphaTest,o.map=n.map,o.clipShadows=n.clipShadows,o.clippingPlanes=n.clippingPlanes,o.clipIntersection=n.clipIntersection,o.displacementMap=n.displacementMap,o.displacementScale=n.displacementScale,o.displacementBias=n.displacementBias,o.wireframeLinewidth=n.wireframeLinewidth,o.linewidth=n.linewidth,!0===s.isPointLight&&!0===o.isMeshDistanceMaterial){e.properties.get(o).light=s}return o}function R(n,s,r,o,a){if(!1===n.visible)return;if(n.layers.test(s.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&a===i.dwk)&&(!n.frustumCulled||m.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,n.matrixWorld);const i=t.update(n),s=n.material;if(Array.isArray(s)){const t=i.groups;for(let l=0,c=t.length;lx||g.y>x)&&(g.x>x&&(A.x=Math.floor(x/u.x),g.x=A.x*u.x,l.mapSize.x=A.x),g.y>x&&(A.y=Math.floor(x/u.y),g.y=A.y*u.y,l.mapSize.y=A.y)),null===l.map||!0===h||!0===d){const e=this.type!==i.dwk?{minFilter:i.TyD,magFilter:i.TyD}:{};null!==l.map&&l.map.dispose(),l.map=new s.d(g.x,g.y,e),l.map.texture.name=a.name+".shadowMap",l.camera.updateProjectionMatrix()}e.setRenderTarget(l.map),e.clear();const p=l.getViewportCount();for(let e=0;e{"use strict";n.d(t,{m:()=>o});var i=n(75544),s=n(93113),r=n(84538);function o(e,t,n){const o=n.isWebGL2;const a=new function(){let t=!1;const n=new r.L;let i=null;const s=new r.L(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,r,o,a){!0===a&&(t*=o,i*=o,r*=o),n.set(t,i,r,o),!1===s.equals(n)&&(e.clearColor(t,i,r,o),s.copy(n))},reset:function(){t=!1,i=null,s.set(-1,0,0,0)}}},l=new function(){let t=!1,n=null,s=null,r=null;return{setTest:function(t){t?H(e.DEPTH_TEST):$(e.DEPTH_TEST)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(s!==t){switch(t){case i.BVF:e.depthFunc(e.NEVER);break;case i.Se2:e.depthFunc(e.ALWAYS);break;case i.Zr5:e.depthFunc(e.LESS);break;case i.vCF:e.depthFunc(e.LEQUAL);break;case i.eD:e.depthFunc(e.EQUAL);break;case i.ksN:e.depthFunc(e.GEQUAL);break;case i.w$m:e.depthFunc(e.GREATER);break;case i.M6v:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}s=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,n=null,s=null,r=null}}},c=new function(){let t=!1,n=null,i=null,s=null,r=null,o=null,a=null,l=null,c=null;return{setTest:function(n){t||(n?H(e.STENCIL_TEST):$(e.STENCIL_TEST))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,o){i===t&&s===n&&r===o||(e.stencilFunc(t,n,o),i=t,s=n,r=o)},setOp:function(t,n,i){o===t&&a===n&&l===i||(e.stencilOp(t,n,i),o=t,a=n,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,i=null,s=null,r=null,o=null,a=null,l=null,c=null}}},h=new WeakMap,d=new WeakMap;let u={},p={},f=new WeakMap,m=[],g=null,A=!1,v=null,y=null,b=null,_=null,x=null,w=null,E=null,C=new s.I(0,0,0),S=0,M=!1,I=null,T=null,P=null,B=null,R=null;const D=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let L=!1,N=0;const k=e.getParameter(e.VERSION);-1!==k.indexOf("WebGL")?(N=parseFloat(/^WebGL (\d)/.exec(k)[1]),L=N>=1):-1!==k.indexOf("OpenGL ES")&&(N=parseFloat(/^OpenGL ES (\d)/.exec(k)[1]),L=N>=2);let O=null,U={};const F=e.getParameter(e.SCISSOR_BOX),V=e.getParameter(e.VIEWPORT),Q=(new r.L).fromArray(F),z=(new r.L).fromArray(V);function G(t,n,i,s){const r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let a=0;a{"use strict";n.d(t,{w:()=>l});var i=n(75544),s=n(71050),r=n(80109),o=n(19564),a=n(19748);function l(e,t,n,l,c,h,d){const u=c.isWebGL2,p=c.maxTextures,f=c.maxCubemapSize,m=c.maxTextureSize,g=c.maxSamples,A=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,v="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),y=new WeakMap;let b;const _=new WeakMap;let x=!1;try{x="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function w(e,t){return x?new OffscreenCanvas(e,t):(0,o.c)("canvas")}function E(e,t,n,i){let r=1;if((e.width>i||e.height>i)&&(r=i/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const i=t?s.gy:Math.floor,o=i(r*e.width),a=i(r*e.height);void 0===b&&(b=w(o,a));const l=n?w(o,a):b;l.width=o,l.height=a;return l.getContext("2d").drawImage(e,0,0,o,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+a+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function C(e){return s.wt(e.width)&&s.wt(e.height)}function S(e,t){return e.generateMipmaps&&t&&e.minFilter!==i.TyD&&e.minFilter!==i.wem}function M(t){e.generateMipmap(t)}function I(n,s,r,o,l=!1){if(!1===u)return s;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let c=s;if(s===e.RED&&(r===e.FLOAT&&(c=e.R32F),r===e.HALF_FLOAT&&(c=e.R16F),r===e.UNSIGNED_BYTE&&(c=e.R8)),s===e.RED_INTEGER&&(r===e.UNSIGNED_BYTE&&(c=e.R8UI),r===e.UNSIGNED_SHORT&&(c=e.R16UI),r===e.UNSIGNED_INT&&(c=e.R32UI),r===e.BYTE&&(c=e.R8I),r===e.SHORT&&(c=e.R16I),r===e.INT&&(c=e.R32I)),s===e.RG&&(r===e.FLOAT&&(c=e.RG32F),r===e.HALF_FLOAT&&(c=e.RG16F),r===e.UNSIGNED_BYTE&&(c=e.RG8)),s===e.RGBA){const t=l?i.l6D:a.ep.getTransfer(o);r===e.FLOAT&&(c=e.RGBA32F),r===e.HALF_FLOAT&&(c=e.RGBA16F),r===e.UNSIGNED_BYTE&&(c=t===i.j17?e.SRGB8_ALPHA8:e.RGBA8),r===e.UNSIGNED_SHORT_4_4_4_4&&(c=e.RGBA4),r===e.UNSIGNED_SHORT_5_5_5_1&&(c=e.RGB5_A1)}return c!==e.R16F&&c!==e.R32F&&c!==e.RG16F&&c!==e.RG32F&&c!==e.RGBA16F&&c!==e.RGBA32F||t.get("EXT_color_buffer_float"),c}function T(e,t,n){return!0===S(e,n)||e.isFramebufferTexture&&e.minFilter!==i.TyD&&e.minFilter!==i.wem?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function P(t){return t===i.TyD||t===i.YLQ||t===i.aH4?e.NEAREST:e.LINEAR}function B(e){const t=e.target;t.removeEventListener("dispose",B),function(e){const t=l.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=_.get(n);if(i){const s=i[t.__cacheKey];s.usedTimes--,0===s.usedTimes&&D(e),0===Object.keys(i).length&&_.delete(n)}l.remove(e)}(t),t.isVideoTexture&&y.delete(t)}function R(t){const n=t.target;n.removeEventListener("dispose",R),function(t){const n=t.texture,i=l.get(t),s=l.get(n);void 0!==s.__webglTexture&&(e.deleteTexture(s.__webglTexture),d.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(i.__webglFramebuffer[t]))for(let n=0;n0&&s.__version!==t.version){const e=t.image;if(null===e)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void Q(s,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+i)}const k={[i.rpg]:e.REPEAT,[i.uWy]:e.CLAMP_TO_EDGE,[i.OoA]:e.MIRRORED_REPEAT},O={[i.TyD]:e.NEAREST,[i.YLQ]:e.NEAREST_MIPMAP_NEAREST,[i.aH4]:e.NEAREST_MIPMAP_LINEAR,[i.wem]:e.LINEAR,[i.qyh]:e.LINEAR_MIPMAP_NEAREST,[i.D1R]:e.LINEAR_MIPMAP_LINEAR},U={[i.xoQ]:e.NEVER,[i.T6w]:e.ALWAYS,[i.D67]:e.LESS,[i.M$G]:e.LEQUAL,[i.F1y]:e.EQUAL,[i.Jjb]:e.GEQUAL,[i.Zen]:e.GREATER,[i.O78]:e.NOTEQUAL};function F(n,s,r){if(r?(e.texParameteri(n,e.TEXTURE_WRAP_S,k[s.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,k[s.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,k[s.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,O[s.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,O[s.minFilter])):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE),s.wrapS===i.uWy&&s.wrapT===i.uWy||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,e.TEXTURE_MAG_FILTER,P(s.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,P(s.minFilter)),s.minFilter!==i.TyD&&s.minFilter!==i.wem&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,U[s.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){const r=t.get("EXT_texture_filter_anisotropic");if(s.magFilter===i.TyD)return;if(s.minFilter!==i.aH4&&s.minFilter!==i.D1R)return;if(s.type===i.VzW&&!1===t.has("OES_texture_float_linear"))return;if(!1===u&&s.type===i.cLu&&!1===t.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||l.get(s).__currentAnisotropy)&&(e.texParameterf(n,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,c.getMaxAnisotropy())),l.get(s).__currentAnisotropy=s.anisotropy)}}function V(t,n){let i=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",B));const s=n.source;let r=_.get(s);void 0===r&&(r={},_.set(s,r));const o=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(n);if(o!==t.__cacheKey){void 0===r[o]&&(r[o]={texture:e.createTexture(),usedTimes:0},d.memory.textures++,i=!0),r[o].usedTimes++;const s=r[t.__cacheKey];void 0!==s&&(r[t.__cacheKey].usedTimes--,0===s.usedTimes&&D(n)),t.__cacheKey=o,t.__webglTexture=r[o].texture}return i}function Q(t,s,r){let o=e.TEXTURE_2D;(s.isDataArrayTexture||s.isCompressedArrayTexture)&&(o=e.TEXTURE_2D_ARRAY),s.isData3DTexture&&(o=e.TEXTURE_3D);const c=V(t,s),d=s.source;n.bindTexture(o,t.__webglTexture,e.TEXTURE0+r);const p=l.get(d);if(d.version!==p.__version||!0===c){n.activeTexture(e.TEXTURE0+r);const t=a.ep.getPrimaries(a.ep.workingColorSpace),l=s.colorSpace===i.aCh?null:a.ep.getPrimaries(s.colorSpace),f=s.colorSpace===i.aCh||t===l?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);const g=function(e){return!u&&(e.wrapS!==i.uWy||e.wrapT!==i.uWy||e.minFilter!==i.TyD&&e.minFilter!==i.wem)}(s)&&!1===C(s.image);let A=E(s.image,g,!1,m);A=W(s,A);const v=C(A)||u,y=h.convert(s.format,s.colorSpace);let b,_=h.convert(s.type),x=I(s.internalFormat,y,_,s.colorSpace,s.isVideoTexture);F(o,s,v);const w=s.mipmaps,P=u&&!0!==s.isVideoTexture,B=void 0===p.__version||!0===c,R=T(s,A,v);if(s.isDepthTexture)x=e.DEPTH_COMPONENT,u?x=s.type===i.VzW?e.DEPTH_COMPONENT32F:s.type===i.JQ4?e.DEPTH_COMPONENT24:s.type===i.wJv?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT16:s.type===i.VzW&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),s.format===i.qkB&&x===e.DEPTH_COMPONENT&&s.type!==i.LsT&&s.type!==i.JQ4&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),s.type=i.JQ4,_=h.convert(s.type)),s.format===i.brP&&x===e.DEPTH_COMPONENT&&(x=e.DEPTH_STENCIL,s.type!==i.wJv&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),s.type=i.wJv,_=h.convert(s.type))),B&&(P?n.texStorage2D(e.TEXTURE_2D,1,x,A.width,A.height):n.texImage2D(e.TEXTURE_2D,0,x,A.width,A.height,0,y,_,null));else if(s.isDataTexture)if(w.length>0&&v){P&&B&&n.texStorage2D(e.TEXTURE_2D,R,x,w[0].width,w[0].height);for(let t=0,i=w.length;t>=1,i>>=1}}else if(w.length>0&&v){P&&B&&n.texStorage2D(e.TEXTURE_2D,R,x,w[0].width,w[0].height);for(let t=0,i=w.length;t>a),s=Math.max(1,i.height>>a);o===e.TEXTURE_3D||o===e.TEXTURE_2D_ARRAY?n.texImage3D(o,a,u,t,s,i.depth,0,c,d,null):n.texImage2D(o,a,u,t,s,0,c,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),$(i)?A.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,r,o,l.get(s).__webglTexture,0,H(i)):(o===e.TEXTURE_2D||o>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&o<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,r,o,l.get(s).__webglTexture,a),n.bindFramebuffer(e.FRAMEBUFFER,null)}function G(t,n,s){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer){let r=!0===u?e.DEPTH_COMPONENT24:e.DEPTH_COMPONENT16;if(s||$(n)){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===i.VzW?r=e.DEPTH_COMPONENT32F:t.type===i.JQ4&&(r=e.DEPTH_COMPONENT24));const s=H(n);$(n)?A.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,s,r,n.width,n.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,s,r,n.width,n.height)}else e.renderbufferStorage(e.RENDERBUFFER,r,n.width,n.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(n.depthBuffer&&n.stencilBuffer){const i=H(n);s&&!1===$(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,n.width,n.height):$(n)?A.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,i,e.DEPTH24_STENCIL8,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)}else{const t=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let i=0;i0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function W(e,n){const s=e.colorSpace,o=e.format,l=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===i.L_r||s!==i.GUF&&s!==i.aCh&&(a.ep.getTransfer(s)===i.j17?!1===u?!0===t.has("EXT_sRGB")&&o===i.wk1?(e.format=i.L_r,e.minFilter=i.wem,e.generateMipmaps=!1):n=r.P.sRGBToLinear(n):o===i.wk1&&l===i.ywz||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",s)),n}this.allocateTextureUnit=function(){const e=L;return e>=p&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+p),L+=1,e},this.resetTextureUnits=function(){L=0},this.setTexture2D=N,this.setTexture2DArray=function(t,i){const s=l.get(t);t.version>0&&s.__version!==t.version?Q(s,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,s.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const s=l.get(t);t.version>0&&s.__version!==t.version?Q(s,t,i):n.bindTexture(e.TEXTURE_3D,s.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,s){const r=l.get(t);t.version>0&&r.__version!==t.version?function(t,s,r){if(6!==s.image.length)return;const o=V(t,s),c=s.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+r);const d=l.get(c);if(c.version!==d.__version||!0===o){n.activeTexture(e.TEXTURE0+r);const t=a.ep.getPrimaries(a.ep.workingColorSpace),l=s.colorSpace===i.aCh?null:a.ep.getPrimaries(s.colorSpace),p=s.colorSpace===i.aCh||t===l?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);const m=s.isCompressedTexture||s.image[0].isCompressedTexture,g=s.image[0]&&s.image[0].isDataTexture,A=[];for(let e=0;e<6;e++)A[e]=m||g?g?s.image[e].image:s.image[e]:E(s.image[e],!1,!0,f),A[e]=W(s,A[e]);const v=A[0],y=C(v)||u,b=h.convert(s.format,s.colorSpace),_=h.convert(s.type),x=I(s.internalFormat,b,_,s.colorSpace),w=u&&!0!==s.isVideoTexture,P=void 0===d.__version||!0===o;let B,R=T(s,v,y);if(F(e.TEXTURE_CUBE_MAP,s,y),m){w&&P&&n.texStorage2D(e.TEXTURE_CUBE_MAP,R,x,v.width,v.height);for(let t=0;t<6;t++){B=A[t].mipmaps;for(let r=0;r0&&R++,n.texStorage2D(e.TEXTURE_CUBE_MAP,R,x,A[0].width,A[0].height));for(let t=0;t<6;t++)if(g){w?n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,A[t].width,A[t].height,b,_,A[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,x,A[t].width,A[t].height,0,b,_,A[t].data);for(let i=0;i0){s.__webglFramebuffer[t]=[];for(let n=0;n0){s.__webglFramebuffer=[];for(let t=0;t0&&!1===$(t)){const r=a?i:[i];s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0&&!1===$(t)){const i=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],s=t.width,r=t.height;let o=e.COLOR_BUFFER_BIT;const a=[],c=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,h=l.get(t),d=!0===t.isWebGLMultipleRenderTargets;if(d)for(let t=0;t{"use strict";n.d(t,{y:()=>he});var i=n(48651),s=n(21364),r=n(57938),o=n(85375);const a=new s.x,l=new r.p,c=new o.J,h=new i.B,d=[],u=[],p=new Float32Array(16),f=new Float32Array(9),m=new Float32Array(4);function g(e,t,n){const i=e[0];if(i<=0||i>0)return e;const s=t*n;let r=d[s];if(void 0===r&&(r=new Float32Array(s),d[s]=r),0!==t){i.toArray(r,0);for(let i=1,s=0;i!==t;++i)s+=n,e[i].toArray(r,s)}return r}function A(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n{"use strict";function i(e,t,n,i){let s={},r={},o=[];const a=n.isWebGL2?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(e,t,n){const i=e.value;if(void 0===n[t]){if("number"==typeof i)n[t]=i;else{const e=Array.isArray(i)?i:[i],s=[];for(let t=0;t0){s=n%i;const e=i-s;0!==s&&e-o.boundary<0&&(n+=i-s,r.__offset=n)}n+=o.storage}s=n%i,s>0&&(n+=i-s);e.__size=n,e.__cache={}}(n),u=function(t){const n=function(){for(let e=0;ei})},9840:(e,t,n)=>{"use strict";n.d(t,{f:()=>r});var i=n(75544),s=n(19748);function r(e,t,n){const r=n.isWebGL2;return{convert:function(n,o=i.aCh){let a;const l=s.ep.getTransfer(o);if(n===i.ywz)return e.UNSIGNED_BYTE;if(n===i.k0A)return e.UNSIGNED_SHORT_4_4_4_4;if(n===i.irR)return e.UNSIGNED_SHORT_5_5_5_1;if(n===i.T95)return e.BYTE;if(n===i.iAb)return e.SHORT;if(n===i.LsT)return e.UNSIGNED_SHORT;if(n===i.Kz5)return e.INT;if(n===i.JQ4)return e.UNSIGNED_INT;if(n===i.VzW)return e.FLOAT;if(n===i.cLu)return r?e.HALF_FLOAT:(a=t.get("OES_texture_half_float"),null!==a?a.HALF_FLOAT_OES:null);if(n===i.OTo)return e.ALPHA;if(n===i.wk1)return e.RGBA;if(n===i.Y8D)return e.LUMINANCE;if(n===i.cRx)return e.LUMINANCE_ALPHA;if(n===i.qkB)return e.DEPTH_COMPONENT;if(n===i.brP)return e.DEPTH_STENCIL;if(n===i.L_r)return a=t.get("EXT_sRGB"),null!==a?a.SRGB_ALPHA_EXT:null;if(n===i.hEm)return e.RED;if(n===i.D9w)return e.RED_INTEGER;if(n===i.av9)return e.RG;if(n===i.CtA)return e.RG_INTEGER;if(n===i.E2K)return e.RGBA_INTEGER;if(n===i.wuA||n===i.BFQ||n===i.v3W||n===i.ILR)if(l===i.j17){if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===a)return null;if(n===i.wuA)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===i.BFQ)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===i.v3W)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===i.ILR)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(a=t.get("WEBGL_compressed_texture_s3tc"),null===a)return null;if(n===i.wuA)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===i.BFQ)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===i.v3W)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===i.ILR)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===i._AM||n===i.vCx||n===i.eaV||n===i.CaW){if(a=t.get("WEBGL_compressed_texture_pvrtc"),null===a)return null;if(n===i._AM)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===i.vCx)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===i.eaV)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===i.CaW)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===i.fto)return a=t.get("WEBGL_compressed_texture_etc1"),null!==a?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===i.l0P||n===i.ekQ){if(a=t.get("WEBGL_compressed_texture_etc"),null===a)return null;if(n===i.l0P)return l===i.j17?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(n===i.ekQ)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}if(n===i.ptH||n===i.jZA||n===i.y2t||n===i.gi4||n===i.Djp||n===i.BG$||n===i.NYV||n===i.xJs||n===i.pKu||n===i.GG6||n===i.Gih||n===i.FUD||n===i.iiP||n===i.SvJ){if(a=t.get("WEBGL_compressed_texture_astc"),null===a)return null;if(n===i.ptH)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===i.jZA)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===i.y2t)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===i.gi4)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===i.Djp)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===i.BG$)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===i.NYV)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===i.xJs)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===i.pKu)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===i.GG6)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===i.Gih)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===i.FUD)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===i.iiP)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===i.SvJ)return l===i.j17?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===i.bsb||n===i.f2y||n===i.QO2){if(a=t.get("EXT_texture_compression_bptc"),null===a)return null;if(n===i.bsb)return l===i.j17?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===i.f2y)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===i.QO2)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(n===i.HdW||n===i.vuL||n===i.ZTh||n===i.lGU){if(a=t.get("EXT_texture_compression_rgtc"),null===a)return null;if(n===i.bsb)return a.COMPRESSED_RED_RGTC1_EXT;if(n===i.vuL)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===i.ZTh)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===i.lGU)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===i.wJv?r?e.UNSIGNED_INT_24_8:(a=t.get("WEBGL_depth_texture"),null!==a?a.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[n]?e[n]:null}}}},83084:(e,t,n)=>{"use strict";n.d(t,{N:()=>o});var i=n(19588),s=n(29187);const r={type:"move"};class o{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new s.Z,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new s.Z,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new i.P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new i.P),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new s.Z,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new i.P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new i.P),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(c&&e.hand){o=!0;for(const i of e.hand.values()){const e=t.getJointPose(i,n),s=this._getHandJoint(c,i);null!==e&&(s.matrix.fromArray(e.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,s.jointRadius=e.radius),s.visible=null!==e}const i=c.joints["index-finger-tip"],s=c.joints["thumb-tip"],r=i.position.distanceTo(s.position),a=.02,l=.005;c.inputState.pinching&&r>a+l?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&r<=a-l&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==l&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),null!==s&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));null!==a&&(i=t.getPose(e.targetRaySpace,n),null===i&&null!==s&&(i=s),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(r)))}return null!==a&&(a.visible=null!==i),null!==l&&(l.visible=null!==s),null!==c&&(c.visible=null!==o),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new s.Z;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}},53288:(e,t,n)=>{"use strict";n.d(t,{M:()=>f});var i=n(60531),s=n(19251),r=n(67440),o=n(19588),a=n(84538),l=n(71050),c=n(54871),h=n(46953),d=n(83084),u=n(38057),p=n(75544);class f extends s.p{constructor(e,t){super();const n=this;let s=null,f=1,m=null,g="local-floor",A=1,v=null,y=null,b=null,_=null,x=null,w=null;const E=t.getContextAttributes();let C=null,S=null;const M=[],I=[],T=new r.c;T.layers.enable(1),T.viewport=new a.L;const P=new r.c;P.layers.enable(2),P.viewport=new a.L;const B=[T,P],R=new i.H;R.layers.enable(1),R.layers.enable(2);let D=null,L=null;function N(e){const t=I.indexOf(e.inputSource);if(-1===t)return;const n=M[t];void 0!==n&&(n.update(e.inputSource,e.frame,v||m),n.dispatchEvent({type:e.type,data:e.inputSource}))}function k(){s.removeEventListener("select",N),s.removeEventListener("selectstart",N),s.removeEventListener("selectend",N),s.removeEventListener("squeeze",N),s.removeEventListener("squeezestart",N),s.removeEventListener("squeezeend",N),s.removeEventListener("end",k),s.removeEventListener("inputsourceschange",O);for(let e=0;e=0&&(I[i]=null,M[i].disconnect(n))}for(let t=0;t=I.length){I.push(n),i=e;break}if(null===I[e]){I[e]=n,i=e;break}}if(-1===i)break}const s=M[i];s&&s.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=M[e];return void 0===t&&(t=new d.N,M[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=M[e];return void 0===t&&(t=new d.N,M[e]=t),t.getGripSpace()},this.getHand=function(e){let t=M[e];return void 0===t&&(t=new d.N,M[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){f=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){g=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return v||m},this.setReferenceSpace=function(e){v=e},this.getBaseLayer=function(){return null!==_?_:x},this.getBinding=function(){return b},this.getFrame=function(){return w},this.getSession=function(){return s},this.setSession=async function(i){if(s=i,null!==s){if(C=e.getRenderTarget(),s.addEventListener("select",N),s.addEventListener("selectstart",N),s.addEventListener("selectend",N),s.addEventListener("squeeze",N),s.addEventListener("squeezestart",N),s.addEventListener("squeezeend",N),s.addEventListener("end",k),s.addEventListener("inputsourceschange",O),!0!==E.xrCompatible&&await t.makeXRCompatible(),void 0===s.renderState.layers||!1===e.capabilities.isWebGL2){const n={antialias:void 0!==s.renderState.layers||E.antialias,alpha:!0,depth:E.depth,stencil:E.stencil,framebufferScaleFactor:f};x=new XRWebGLLayer(s,t,n),s.updateRenderState({baseLayer:x}),S=new h.d(x.framebufferWidth,x.framebufferHeight,{format:p.wk1,type:p.ywz,colorSpace:e.outputColorSpace,stencilBuffer:E.stencil})}else{let n=null,i=null,r=null;E.depth&&(r=E.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=E.stencil?p.brP:p.qkB,i=E.stencil?p.wJv:p.JQ4);const o={colorFormat:t.RGBA8,depthFormat:r,scaleFactor:f};b=new XRWebGLBinding(s,t),_=b.createProjectionLayer(o),s.updateRenderState({layers:[_]}),S=new h.d(_.textureWidth,_.textureHeight,{format:p.wk1,type:p.ywz,depthTexture:new u.$(_.textureWidth,_.textureHeight,i,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:E.stencil,colorSpace:e.outputColorSpace,samples:E.antialias?4:0});e.properties.get(S).__ignoreDepthValues=_.ignoreDepthValues}S.isXRRenderTarget=!0,this.setFoveation(A),v=null,m=await s.requestReferenceSpace(g),z.setContext(s),z.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==s)return s.environmentBlendMode};const U=new o.P,F=new o.P;function V(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===s)return;R.near=P.near=T.near=e.near,R.far=P.far=T.far=e.far,D===R.near&&L===R.far||(s.updateRenderState({depthNear:R.near,depthFar:R.far}),D=R.near,L=R.far);const t=e.parent,n=R.cameras;V(R,t);for(let e=0;e{"use strict";n.d(t,{x:()=>s});var i=n(25499);class s extends i.T{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}},48651:(e,t,n)=>{"use strict";n.d(t,{B:()=>r});var i=n(21364),s=n(75544);class r extends i.x{constructor(e,t,n,i,r,o,a,l,c,h){super(e=void 0!==e?e:[],t=void 0!==t?t:s.fY$,n,i,r,o,a,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}},85375:(e,t,n)=>{"use strict";n.d(t,{J:()=>r});var i=n(21364),s=n(75544);class r extends i.x{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=s.TyD,this.minFilter=s.TyD,this.wrapR=s.uWy,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}},57938:(e,t,n)=>{"use strict";n.d(t,{p:()=>r});var i=n(21364),s=n(75544);class r extends i.x{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=s.TyD,this.minFilter=s.TyD,this.wrapR=s.uWy,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}},38057:(e,t,n)=>{"use strict";n.d(t,{$:()=>r});var i=n(21364),s=n(75544);class r extends i.x{constructor(e,t,n,i,r,o,a,l,c,h){if((h=void 0!==h?h:s.qkB)!==s.qkB&&h!==s.brP)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&h===s.qkB&&(n=s.JQ4),void 0===n&&h===s.brP&&(n=s.wJv),super(null,i,r,o,a,l,h,n,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==a?a:s.TyD,this.minFilter=void 0!==l?l:s.TyD,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}},37136:(e,t,n)=>{"use strict";n.d(t,{H:()=>o});var i=n(80109),s=n(71050);let r=0;class o{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:r++}),this.uuid=s.DO(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t{"use strict";n.d(t,{x:()=>d});var i=n(19251),s=n(75544),r=n(71050),o=n(40693),a=n(23130),l=n(37136),c=n(19564);let h=0;class d extends i.p{constructor(e=d.DEFAULT_IMAGE,t=d.DEFAULT_MAPPING,n=s.uWy,i=s.uWy,u=s.wem,p=s.D1R,f=s.wk1,m=s.ywz,g=d.DEFAULT_ANISOTROPY,A=s.aCh){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:h++}),this.uuid=r.DO(),this.name="",this.source=new l.H(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=u,this.minFilter=p,this.anisotropy=g,this.format=f,this.internalFormat=null,this.type=m,this.offset=new o.F(0,0),this.repeat=new o.F(1,1),this.center=new o.F(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new a.V,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof A?this.colorSpace=A:((0,c.O4)("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=A===s.knz?s.KI_:s.aCh),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==s.xfE)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case s.rpg:e.x=e.x-Math.floor(e.x);break;case s.uWy:e.x=e.x<0?0:1;break;case s.OoA:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case s.rpg:e.y=e.y-Math.floor(e.y);break;case s.uWy:e.y=e.y<0?0:1;break;case s.OoA:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return(0,c.O4)("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===s.KI_?s.knz:s.rnI}set encoding(e){(0,c.O4)("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===s.knz?s.KI_:s.aCh}}d.DEFAULT_IMAGE=null,d.DEFAULT_MAPPING=s.xfE,d.DEFAULT_ANISOTROPY=1},19564:(e,t,n)=>{"use strict";function i(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}n.d(t,{H7:()=>i,O4:()=>a,O5:()=>r,c:()=>s});Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function s(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function r(){const e=s("canvas");return e.style.display="block",e}const o={};function a(e){e in o||(o[e]=!0,console.warn(e))}},338:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},90360:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},47227:e=>{"use strict";e.exports=JSON.parse('{"asset":{"type":"application/si-dpo-3d.document+json","version":"1.0","copyright":"(c) Smithsonian Institution, all rights reserved","generator":"Voyager"},"scene":0,"scenes":[{"nodes":[0,1],"setup":0}],"nodes":[{"translation":[0,0,15],"camera":0},{"name":"Lights","children":[2,3,4,5]},{"translation":[0,0,2],"rotation":[0.4829741,-0.1070728,0.1880998,0.8484633],"scale":[1,1,1],"name":"Key","light":0},{"rotation":[0.3546969,0.163893,-0.3861077,0.8356136],"scale":[1,1,1],"name":"Fill #1","light":1},{"translation":[0,0,1],"rotation":[0.9374013,-0.3018693,0.0532277,0.1652891],"name":"Fill #2","light":2},{"translation":[1,0,-1],"rotation":[0.373256,0.6426073,-0.5786063,0.3360813],"scale":[1,1,1],"name":"Rim","light":3}],"setups":[{"units":"cm","interface":{"visible":true,"logo":true,"menu":true,"tools":true},"viewer":{"shader":"Default","exposure":1,"gamma":2,"annotationsVisible":false},"reader":{"enabled":false,"position":"Overlay"},"navigation":{"type":"Orbit","enabled":true,"autoZoom":true,"lightsFollowCamera":true,"autoRotation":false,"orbit":{"orbit":[-24,-26,0],"offset":[0,0,150],"minOrbit":[-90,null,null],"maxOrbit":[90,null,null],"minOffset":[null,null,0.1],"maxOffset":[null,null,10000]}},"background":{"style":"RadialGradient","color0":[0.2,0.25,0.3],"color1":[0.01,0.03,0.05]},"floor":{"visible":false,"position":[0,-25,0],"size":50,"color":[0.6,0.75,0.8],"opacity":0.5,"receiveShadow":false},"grid":{"visible":false,"color":[0.5,0.7,0.8]},"tape":{"enabled":false,"startPosition":[0,0,0],"startDirection":[0,0,0],"endPosition":[0,0,0],"endDirection":[0,0,0]},"slicer":{"enabled":false,"axis":"X","inverted":false,"position":0.5}}],"cameras":[{"type":"perspective","perspective":{"yfov":52,"znear":0.1,"zfar":100000}}],"lights":[{"color":[1,0.95,0.9],"intensity":1,"type":"directional","shadowEnabled":true},{"color":[0.9,0.95,1],"intensity":0.7,"type":"directional","shadowEnabled":true},{"color":[0.8,0.85,1],"intensity":0.5,"type":"directional"},{"color":[0.85,0.9078313,1],"intensity":0.6,"type":"directional"}]}')}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};n(94860)})();