Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- assets/EXT_lights_area-DpkQYXlQ.js +1 -0
- assets/EXT_lights_ies-Qe4ehPsC.js +1 -0
- assets/EXT_lights_image_based-CEXtWEZ3.js +1 -0
- assets/EXT_mesh_gpu_instancing-B3VxVLJg.js +1 -0
- assets/EXT_meshopt_compression-Pa499AYZ.js +1 -0
- assets/EXT_texture_avif-Nv7VBjPQ.js +1 -0
- assets/EXT_texture_webp-BDYrjNRo.js +1 -0
- assets/ExtrasAsMetadata-Cp9P1Lmx.js +1 -0
- assets/KHR_animation_pointer-DbEjDTwi.js +1 -0
- assets/KHR_draco_mesh_compression-BEx33bus.js +1 -0
- assets/KHR_interactivity-K8Kioa6L.js +2 -0
- assets/KHR_lights_punctual-CCzRzwty.js +1 -0
- assets/KHR_materials_anisotropy-DeuhwPRx.js +1 -0
- assets/KHR_materials_clearcoat-CqejipXp.js +1 -0
- assets/KHR_materials_coat-DOoUAE9E.js +1 -0
- assets/KHR_materials_diffuse_roughness-3tU76Z0C.js +1 -0
- assets/KHR_materials_diffuse_transmission-CfRoCwmd.js +1 -0
- assets/KHR_materials_dispersion-fuNIvVrP.js +1 -0
- assets/KHR_materials_emissive_strength-rOKORGq9.js +1 -0
- assets/KHR_materials_fuzz-Clhu1IVg.js +1 -0
- assets/KHR_materials_ior-B1oqd8B6.js +1 -0
- assets/KHR_materials_iridescence-acCc2TH6.js +1 -0
- assets/KHR_materials_pbrSpecularGlossiness-C3yScQoz.js +1 -0
- assets/KHR_materials_sheen-DWUKP0Pn.js +1 -0
- assets/KHR_materials_specular-z6x6B2Wk.js +1 -0
- assets/KHR_materials_transmission-BOMnlenZ.js +1 -0
- assets/KHR_materials_unlit-CTd-ysfe.js +1 -0
- assets/KHR_materials_variants-CR-weLGR.js +1 -0
- assets/KHR_materials_volume-DyryNepY.js +1 -0
- assets/KHR_materials_volume_scatter-Dilc3FVg.js +1 -0
- assets/KHR_mesh_quantization-DRY1BM2Q.js +1 -0
- assets/KHR_node_hoverability-k_keZPJw.js +1 -0
- assets/KHR_node_selectability-CWoTfyY_.js +1 -0
- assets/KHR_node_visibility-Dxpqh4YG.js +1 -0
- assets/KHR_texture_basisu-wb_QWhaW.js +1 -0
- assets/KHR_texture_transform-BDMWBq3N.js +1 -0
- assets/KHR_xmp_json_ld-kzuW6Xgd.js +1 -0
- assets/LineageSection-CRyR37ec.js +1 -0
- assets/LineageSection-D4yA5g5T.css +1 -0
- assets/MSFT_audio_emitter-Dn8xGnZi.js +2 -0
- assets/MSFT_lod-Cdx3a5qt.js +1 -0
- assets/MSFT_minecraftMesh-BBQMzJvK.js +1 -0
- assets/MSFT_sRGBFactors-UWXoGqn-.js +1 -0
- assets/abstractAudioBus-D0ySXXLP.js +1 -0
- assets/abstractEngine.cubeTexture-C895Ky-E.js +1 -0
- assets/animation-IftAdLIx.js +1 -0
- assets/animationGroup-BP7VB8mY.js +1 -0
- assets/arcRotateCamera-CpjmrbYn.js +1 -0
- assets/assetContainer-DOnbxwKX.js +1 -0
- assets/axesViewer-McvgY2Ig.js +1 -0
assets/EXT_lights_area-DpkQYXlQ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{V as a,Q as R}from"./math.vector-C1xyPDEl.js";import{Color3 as L}from"./math.color-CzLaKyb6.js";import{L as c}from"./light-DT53MGnW.js";import{L as D,_ as b,s as w}from"./bufferUtils-DTRdUD8L.js";import{N as S}from"./node-C-Iu0ALa.js";import{R as M}from"./math.scalar.functions-DkeaWAWz.js";import{R as y}from"./rawTexture-Cp8_XuDs.js";import{T as d}from"./texture-BEqhDl5Y.js";import{T as A}from"./tools-D01N7ptR.js";import{T as B}from"./mesh-Fj-9677A.js";import{A as E,G as C}from"./glTFLoader-BPeiodqB.js";import{u as U,r as z}from"./dynamic-BUKysMyT.js";import"./lightConstants-B1TSTh-k.js";import"./decorators.serialization-C7d7ykGG.js";import"./baseTexture-CgAggsey.js";import"./math.plane-Ce_75-g5.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./index-Bx1QoKVU.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./objectModelMapping-DWcnlpHl.js";async function F(){const i=new Uint16Array(16384),t=new Uint16Array(4096*4),r=await A.LoadFileAsync(A.GetAssetUrl("https://assets.babylonjs.com/core/areaLights/areaLightsLTC.bin")),e=new Uint16Array(r),n=e.length/8;for(let s=0;s<n;s++)i[s*4]=e[s*8],i[s*4+1]=e[s*8+1],i[s*4+2]=e[s*8+2],i[s*4+3]=e[s*8+3],t[s*4]=e[s*8+4],t[s*4+1]=e[s*8+5],t[s*4+2]=e[s*8+6],t[s*4+3]=e[s*8+7];return[i,t]}function P(i){const t=i.useDelayedTextureLoading;i.useDelayedTextureLoading=!1;const r=i._blockEntityCollection;i._blockEntityCollection=!1,i._ltcTextures={LTC1:y.CreateRGBATexture(null,64,64,i.getEngine(),!1,!1,2,2,0,!1,!0),LTC2:y.CreateRGBATexture(null,64,64,i.getEngine(),!1,!1,2,2,0,!1,!0)},i._blockEntityCollection=r,i._ltcTextures.LTC1.wrapU=d.CLAMP_ADDRESSMODE,i._ltcTextures.LTC1.wrapV=d.CLAMP_ADDRESSMODE,i._ltcTextures.LTC2.wrapU=d.CLAMP_ADDRESSMODE,i._ltcTextures.LTC2.wrapV=d.CLAMP_ADDRESSMODE,i.useDelayedTextureLoading=t,F().then(e=>{var n,s;i._ltcTextures&&(((n=i._ltcTextures)==null?void 0:n.LTC1).update(e[0]),((s=i._ltcTextures)==null?void 0:s.LTC2).update(e[1]),i.onDisposeObservable.addOnce(()=>{var o,l;(o=i._ltcTextures)==null||o.LTC1.dispose(),(l=i._ltcTextures)==null||l.LTC2.dispose()}))}).catch(e=>{D.Error(`Area Light fail to get LTC textures data. Error: ${e}`)})}class O extends c{constructor(t,r,e,n){super(t,e,n),this.position=r,this._scene._ltcTextures||P(this._scene)}transferTexturesToEffect(t,r){return this._scene._ltcTextures&&(t.setTexture("areaLightsLTC1Sampler",this._scene._ltcTextures.LTC1),t.setTexture("areaLightsLTC2Sampler",this._scene._ltcTextures.LTC2)),this}prepareLightSpecificDefines(t,r){t["AREALIGHT"+r]=!0,t.AREALIGHTUSED=!0}_isReady(){return this._scene._ltcTextures?this._scene._ltcTextures.LTC1.isReady()&&this._scene._ltcTextures.LTC2.isReady():!1}}S.AddNodeConstructor("Light_Type_4",(i,t)=>()=>new u(i,a.Zero(),1,1,t));class u extends O{get emissionTexture(){return this._emissionTextureTexture}set emissionTexture(t){this._emissionTextureTexture!==t&&(this._emissionTextureTexture=t,this._emissionTextureTexture&&(this._emissionTextureTexture.wrapU=0,this._emissionTextureTexture.wrapV=0),this._emissionTextureTexture&&u._IsTexture(this._emissionTextureTexture)&&this._emissionTextureTexture.onLoadObservable.addOnce(()=>{this._markMeshesAsLightDirty()}))}get width(){return this._width.x}set width(t){this._width.x=t}get height(){return this._height.y}set height(t){this._height.y=t}constructor(t,r,e,n,s,f){super(t,r,s,f),this._emissionTextureTexture=null,this._width=new a(e,0,0),this._height=new a(0,n,0),this._pointTransformedPosition=a.Zero(),this._pointTransformedWidth=a.Zero(),this._pointTransformedHeight=a.Zero()}getClassName(){return"RectAreaLight"}getTypeID(){return c.LIGHTTYPEID_RECT_AREALIGHT}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightWidth",4),this._uniformBuffer.addUniform("vLightHeight",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}_computeTransformedInformation(){return this.parent&&this.parent.getWorldMatrix?(a.TransformCoordinatesToRef(this.position,this.parent.getWorldMatrix(),this._pointTransformedPosition),a.TransformNormalToRef(this._width,this.parent.getWorldMatrix(),this._pointTransformedWidth),a.TransformNormalToRef(this._height,this.parent.getWorldMatrix(),this._pointTransformedHeight),!0):!1}static _IsTexture(t){return t.onLoadObservable!==void 0}transferToEffect(t,r){const e=this._scene.floatingOriginOffset;return this._computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this._pointTransformedPosition.x-e.x,this._pointTransformedPosition.y-e.y,this._pointTransformedPosition.z-e.z,0,r),this._uniformBuffer.updateFloat4("vLightWidth",this._pointTransformedWidth.x/2,this._pointTransformedWidth.y/2,this._pointTransformedWidth.z/2,0,r),this._uniformBuffer.updateFloat4("vLightHeight",this._pointTransformedHeight.x/2,this._pointTransformedHeight.y/2,this._pointTransformedHeight.z/2,0,r)):(this._uniformBuffer.updateFloat4("vLightData",this.position.x-e.x,this.position.y-e.y,this.position.z-e.z,0,r),this._uniformBuffer.updateFloat4("vLightWidth",this._width.x/2,this._width.y/2,this._width.z/2,0,r),this._uniformBuffer.updateFloat4("vLightHeight",this._height.x/2,this._height.y/2,this._height.z/2,0,r)),this}transferTexturesToEffect(t,r){return super.transferTexturesToEffect(t,r),this._emissionTextureTexture&&this._emissionTextureTexture.isReady()&&t.setTexture("rectAreaLightEmissionTexture"+r,this._emissionTextureTexture),this}transferToNodeMaterialEffect(t,r){const e=this._scene.floatingOriginOffset;return this._computeTransformedInformation()?t.setFloat3(r,this._pointTransformedPosition.x-e.x,this._pointTransformedPosition.y-e.y,this._pointTransformedPosition.z-e.z):t.setFloat3(r,this.position.x-e.x,this.position.y-e.y,this.position.z-e.z),this}prepareLightSpecificDefines(t,r){super.prepareLightSpecificDefines(t,r),t["RECTAREALIGHTEMISSIONTEXTURE"+r]=!!(this._emissionTextureTexture&&this._emissionTextureTexture.isReady())}}b([w()],u.prototype,"width",null);b([w()],u.prototype,"height",null);M("BABYLON.RectAreaLight",u);const m="EXT_lights_area";class v{constructor(t){this.name=m,this._loader=t,this.enabled=this._loader.isExtensionUsed(m)}dispose(){this._loader=null,delete this._lights}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const r=t[this.name];this._lights=r.lights,E.Assign(this._lights)}}loadNodeAsync(t,r,e){return C.LoadExtensionAsync(t,r,this.name,async(n,s)=>(this._loader._allMaterialsDirtyRequired=!0,await this._loader.loadNodeAsync(t,r,f=>{var x;let h;const o=E.Get(n,this._lights,s.light),l=o.name||f.name;this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer;const T=o.size!==void 0?o.size:1;switch(o.type){case"rect":{const _=((x=o.rect)==null?void 0:x.aspect)!==void 0?o.rect.aspect*T:T,g=T;h=new u(l,a.Zero(),_,g,this._loader.babylonScene);break}case"disk":{const _=Math.sqrt(T*T*.25*Math.PI);h=new u(l,a.Zero(),_,_,this._loader.babylonScene);break}default:throw this._loader.babylonScene._blockEntityCollection=!1,new Error(`${n}: Invalid area light type (${o.type})`)}h._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,o._babylonLight=h,h.falloffType=c.FALLOFF_GLTF,h.diffuse=o.color?L.FromArray(o.color):L.White(),h.intensity=o.intensity==null?1:o.intensity;const p=new B(`${l}_orientation`,this._loader.babylonScene);p.rotationQuaternion=R.RotationAxis(a.Up(),Math.PI),p.parent=f,h.parent=p,this._loader._babylonLights.push(h),C.AddPointerMetadata(h,n),e(f)})))}}U(m);z(m,!0,i=>new v(i));export{v as EXT_lights_area};
|
assets/EXT_lights_ies-Qe4ehPsC.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{V as d}from"./math.vector-C1xyPDEl.js";import{Color3 as f}from"./math.color-CzLaKyb6.js";import{c as g}from"./objectModelMapping-DWcnlpHl.js";import{L as b}from"./light-DT53MGnW.js";import{A as l,G as h}from"./glTFLoader-BPeiodqB.js";import{u as y,r as L}from"./dynamic-BUKysMyT.js";import{T as A}from"./texture-BEqhDl5Y.js";import"./math.scalar.functions-DkeaWAWz.js";import"./bufferUtils-DTRdUD8L.js";import"./node-C-Iu0ALa.js";import"./decorators.serialization-C7d7ykGG.js";import"./math.axis-Ck7JfPPj.js";import"./lightConstants-B1TSTh-k.js";import"./tools-D01N7ptR.js";import"./index-Bx1QoKVU.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./material-CrEsrP1R.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./baseTexture-CgAggsey.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";const a="EXT_lights_ies";class w{constructor(t){this.name=a,this._loader=t,this.enabled=this._loader.isExtensionUsed(a)}dispose(){this._loader=null,delete this._lights}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const o=t[this.name];this._lights=o.lights,l.Assign(this._lights)}}loadNodeAsync(t,o,_){return h.LoadExtensionAsync(t,o,this.name,async(p,s)=>{this._loader._allMaterialsDirtyRequired=!0;let i,e;const u=await this._loader.loadNodeAsync(t,o,r=>{e=l.Get(p,this._lights,s.light);const c=e.name||r.name;this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer,i=new g(c,d.Zero(),d.Backward(),0,1,this._loader.babylonScene),i.angle=Math.PI/2,i.innerAngle=0,i._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,e._babylonLight=i,i.falloffType=b.FALLOFF_GLTF,i.diffuse=s.color?f.FromArray(s.color):f.White(),i.intensity=s.multiplier||1,i.range=Number.MAX_VALUE,i.parent=r,this._loader._babylonLights.push(i),h.AddPointerMetadata(i,p),_(r)});let n;if(e.uri)n=await this._loader.loadUriAsync(t,e,e.uri);else{const r=l.Get(`${t}/bufferView`,this._loader.gltf.bufferViews,e.bufferView);n=await this._loader.loadBufferViewAsync(`/bufferViews/${r.index}`,r)}return i.iesProfileTexture=new A(name+"_iesProfile",this._loader.babylonScene,!0,!1,void 0,null,null,n,!0,void 0,void 0,void 0,void 0,".ies"),u})}}y(a);L(a,!0,m=>new w(m));export{w as EXT_lights_ies};
|
assets/EXT_lights_image_based-CEXtWEZ3.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{a as G,S as z}from"./engine-DaBDhQ20.js";import{M as c,O as D,V as S,T as M,Q as w}from"./math.vector-C1xyPDEl.js";import{S as A}from"./decorators.serialization-C7d7ykGG.js";import{_ as F}from"./environmentTextureTools-CDrTJ7w-.js";import{_ as h,s as _,a as E,v as P}from"./bufferUtils-DTRdUD8L.js";import{T as Y}from"./tools-D01N7ptR.js";import{B as $}from"./baseTexture-CgAggsey.js";import{T as B}from"./texture-BEqhDl5Y.js";import{G as V,R as H}from"./math.scalar.functions-DkeaWAWz.js";import"./abstractEngine.cubeTexture-C895Ky-E.js";import{G as j,A as C}from"./glTFLoader-BPeiodqB.js";import{u as q,r as O}from"./dynamic-BUKysMyT.js";import"./thinEngine-D5ynu8Dd.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./dataBuffer-CgoqiUzT.js";import"./index-Bx1QoKVU.js";import"./math.axis-Ck7JfPPj.js";import"./math.color-CzLaKyb6.js";import"./math.plane-Ce_75-g5.js";import"./math.path-DFucxaHn.js";import"./perfCounter-DusmGz8t.js";import"./scene-gn_hoGMy.js";import"./smartArray-CO6iJ0u5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./buffer-DqKlo1ts.js";import"./renderingManager-CiY2OUrf.js";import"./deviceInputEvents-BTza-zoR.js";import"./passPostProcess-kvX6RZRb.js";import"./effectRenderer-CSz5fi0n.js";import"./math.viewport-CgkTt1RS.js";import"./drawWrapper-CZVk0xN-.js";import"./renderTargetTexture-B0kOC1Jy.js";import"./dumpTools-phHCiahG.js";import"./baseTexture.polynomial-BRyqQovE.js";import"./cubemapToSphericalPolynomial-BhsWOHWR.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./subMesh-UWDo5wjI.js";import"./node-C-Iu0ALa.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./material-CrEsrP1R.js";import"./cameraInputsManager-WrTH9PVf.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const I=.8;class l extends ${set boundingBoxSize(e){if(this._boundingBoxSize&&this._boundingBoxSize.equals(e))return;this._boundingBoxSize=e;const t=this.getScene();t&&t.markAllMaterialsAsDirty(1)}get boundingBoxSize(){return this._boundingBoxSize}set rotationY(e){this._rotationY=e,this.setReflectionTextureMatrix(c.RotationY(this._rotationY))}get rotationY(){return this._rotationY}get noMipmap(){return this._noMipmap}get forcedExtension(){return this._forcedExtension}static CreateFromImages(e,t,i){let r="";for(const s of e)r+=s;return new l(r,t,null,i,e)}static CreateFromPrefilteredData(e,t,i=null,r=!0){const s=t.useDelayedTextureLoading;t.useDelayedTextureLoading=!1;const o=new l(e,t,null,!1,null,null,null,void 0,!0,i,r);return t.useDelayedTextureLoading=s,o}constructor(e,t,i=null,r=!1,s=null,o=null,n=null,a=5,u=!1,d=null,f=!1,x=I,p=0,y,m){var v;super(t),this.onLoadObservable=new D,this.boundingBoxPosition=S.Zero(),this._rotationY=0,this._files=null,this._forcedExtension=null,this._extensions=null,this._textureMatrixRefraction=new c,this._buffer=null,this.name=e,this.url=e,this._noMipmap=r,this.hasAlpha=!1,this.isCube=!0,this._textureMatrix=c.Identity(),this.coordinatesMode=B.CUBIC_MODE;let b,T=null;i!==null&&!Array.isArray(i)?(b=i.extensions??null,this._noMipmap=i.noMipmap??!1,s=i.files??null,T=i.buffer??null,this._format=i.format??5,u=i.prefiltered??!1,d=i.forcedExtension??null,this._createPolynomials=i.createPolynomials??!1,this._lodScale=i.lodScale??I,this._lodOffset=i.lodOffset??0,this._loaderOptions=i.loaderOptions,this._useSRGBBuffer=i.useSRGBBuffer,o=i.onLoad??null,n=i.onError??null):(this._noMipmap=r,this._format=a,this._createPolynomials=f,b=i,this._loaderOptions=y,this._useSRGBBuffer=m,this._lodScale=x,this._lodOffset=p),!(!e&&!s)&&this.updateURL(e,d,o,u,n,b,(v=this.getScene())==null?void 0:v.useDelayedTextureLoading,s,T)}getClassName(){return"CubeTexture"}updateURL(e,t=null,i=null,r=!1,s=null,o=null,n=!1,a=null,u=null){(!this.name||this.name.startsWith("data:"))&&(this.name=e),this.url=e,t&&(this._forcedExtension=t);const d=e.lastIndexOf("."),f=t||(d>-1?e.substring(d).toLowerCase():""),x=f.indexOf(".dds")===0,p=f.indexOf(".env")===0,y=f.indexOf(".basis")===0;if(p?(this.gammaSpace=!1,this._prefiltered=!1,this.anisotropicFilteringLevel=1):(this._prefiltered=r,r&&(this.gammaSpace=!1,this.anisotropicFilteringLevel=1)),a)this._files=a;else if(!y&&!p&&!x&&!o&&(o=["_px.jpg","_py.jpg","_pz.jpg","_nx.jpg","_ny.jpg","_nz.jpg"]),this._files=this._files||[],this._files.length=0,o){for(let m=0;m<o.length;m++)this._files.push(e+o[m]);this._extensions=o}this._buffer=u,n?(this.delayLoadState=4,this._delayedOnLoad=i,this._delayedOnError=s):this._loadTexture(i,s)}delayLoad(e){this.delayLoadState===4&&(e&&(this._forcedExtension=e),this.delayLoadState=1,this._loadTexture(this._delayedOnLoad,this._delayedOnError))}getReflectionTextureMatrix(){return this._textureMatrix}setReflectionTextureMatrix(e){var s,o;if(e.updateFlag===this._textureMatrix.updateFlag||(e.isIdentity()!==this._textureMatrix.isIdentity()&&((s=this.getScene())==null||s.markAllMaterialsAsDirty(1,n=>n.getActiveTextures().indexOf(this)!==-1)),this._textureMatrix=e,!((o=this.getScene())!=null&&o.useRightHandedSystem)))return;const t=M.Vector3[0],i=M.Quaternion[0],r=M.Vector3[1];this._textureMatrix.decompose(t,i,r),i.z*=-1,i.w*=-1,c.ComposeToRef(t,i,r,this._textureMatrixRefraction)}getRefractionTextureMatrix(){var e;return(e=this.getScene())!=null&&e.useRightHandedSystem?this._textureMatrixRefraction:this._textureMatrix}_loadTexture(e=null,t=null){var n;const i=this.getScene(),r=this._texture;this._texture=this._getFromCache(this.url,this._noMipmap,void 0,void 0,this._useSRGBBuffer,this.isCube);const s=()=>{var a;this.onLoadObservable.notifyObservers(this),r&&(r.dispose(),(a=this.getScene())==null||a.markAllMaterialsAsDirty(1)),e&&e()},o=(a,u)=>{this._loadingError=!0,this._errorObject={message:a,exception:u},t&&t(a,u),B.OnTextureLoadErrorObservable.notifyObservers(this)};this._texture?this._texture.isReady?Y.SetImmediate(()=>s()):this._texture.onLoadedObservable.add(()=>s()):(this._prefiltered?this._texture=this._getEngine().createPrefilteredCubeTexture(this.url,i,this._lodScale,this._lodOffset,e,o,this._format,this._forcedExtension,this._createPolynomials):this._texture=this._getEngine().createCubeTexture(this.url,i,this._files,this._noMipmap,e,o,this._format,this._forcedExtension,!1,this._lodScale,this._lodOffset,null,this._loaderOptions,!!this._useSRGBBuffer,this._buffer),(n=this._texture)==null||n.onLoadedObservable.add(()=>this.onLoadObservable.notifyObservers(this)))}static Parse(e,t,i){const r=A.Parse(()=>{let s=!1;return e.prefiltered&&(s=e.prefiltered),new l(i+(e.url??e.name),t,e.extensions,!1,e.files||null,null,null,void 0,s,e.forcedExtension)},e,t);if(e.boundingBoxPosition&&(r.boundingBoxPosition=S.FromArray(e.boundingBoxPosition)),e.boundingBoxSize&&(r.boundingBoxSize=S.FromArray(e.boundingBoxSize)),e.animations)for(let s=0;s<e.animations.length;s++){const o=e.animations[s],n=V("BABYLON.Animation");n&&r.animations.push(n.Parse(o))}return r}clone(){let e=0;const t=A.Clone(()=>{const i=new l(this.url,this.getScene()||this._getEngine(),this._extensions,this._noMipmap,this._files);return e=i.uniqueId,i},this);return t.uniqueId=e,t}}h([_()],l.prototype,"url",void 0);h([E()],l.prototype,"boundingBoxPosition",void 0);h([E()],l.prototype,"boundingBoxSize",null);h([_("rotationY")],l.prototype,"rotationY",null);h([_("files")],l.prototype,"_files",void 0);h([_("forcedExtension")],l.prototype,"_forcedExtension",void 0);h([_("extensions")],l.prototype,"_extensions",void 0);h([P("textureMatrix")],l.prototype,"_textureMatrix",void 0);h([P("textureMatrixRefraction")],l.prototype,"_textureMatrixRefraction",void 0);B._CubeTextureParser=l.Parse;H("BABYLON.CubeTexture",l);class R extends l{constructor(e,t,i,r=5,s=0,o=!1,n=!1,a=3,u=null){super("",e),this._texture=e.getEngine().createRawCubeTexture(t,i,r,s,o,n,a,u)}update(e,t,i,r,s=null){this._texture.getEngine().updateRawCubeTexture(this._texture,e,t,i,r,s)}updateRGBDAsync(e,t=null,i=.8,r=0){return F(this._texture,e,t,i,r).then(()=>{})}clone(){return A.Clone(()=>{const e=this.getScene(),t=this._texture,i=new R(e,t._bufferViewArray,t.width,t.format,t.type,t.generateMipMaps,t.invertY,t.samplingMode,t._compression);return t.source===13&&i.updateRGBDAsync(t._bufferViewArrayArray,t._sphericalPolynomial,t._lodGenerationScale,t._lodGenerationOffset),i},this)}}const g="EXT_lights_image_based";class N{constructor(e){this.name=g,this._loader=e,this.enabled=this._loader.isExtensionUsed(g)}dispose(){this._loader=null,delete this._lights}onLoading(){const e=this._loader.gltf.extensions;if(e&&e[this.name]){const t=e[this.name];this._lights=t.lights}}loadSceneAsync(e,t){return j.LoadExtensionAsync(e,t,this.name,async(i,r)=>{this._loader._allMaterialsDirtyRequired=!0;const s=new Array;s.push(this._loader.loadSceneAsync(e,t)),this._loader.logOpen(`${i}`);const o=C.Get(`${i}/light`,this._lights,r.light);return s.push(this._loadLightAsync(`/extensions/${this.name}/lights/${r.light}`,o).then(n=>{this._loader.babylonScene.environmentTexture=n})),this._loader.logClose(),await Promise.all(s).then(()=>{})})}_loadLightAsync(e,t){if(!t._loaded){const i=new Array;this._loader.logOpen(`${e}`);const r=new Array(t.specularImages.length);for(let s=0;s<t.specularImages.length;s++){const o=t.specularImages[s];r[s]=new Array(o.length);for(let n=0;n<o.length;n++){const a=`${e}/specularImages/${s}/${n}`;this._loader.logOpen(`${a}`);const u=o[n],d=C.Get(a,this._loader.gltf.images,u);i.push(this._loader.loadImageAsync(`/images/${u}`,d).then(f=>{r[s][n]=f})),this._loader.logClose()}}this._loader.logClose(),t._loaded=Promise.all(i).then(async()=>{const s=new R(this._loader.babylonScene,null,t.specularImageSize);if(s.name=t.name||"environment",t._babylonTexture=s,t.intensity!=null&&(s.level=t.intensity),t.rotation){let u=w.FromArray(t.rotation);this._loader.babylonScene.useRightHandedSystem||(u=w.Inverse(u)),c.FromQuaternionToRef(u,s.getReflectionTextureMatrix())}if(!t.irradianceCoefficients)throw new Error(`${e}: Irradiance coefficients are missing`);const o=G.FromArray(t.irradianceCoefficients);o.scaleInPlace(t.intensity),o.convertIrradianceToLambertianRadiance();const n=z.FromHarmonics(o),a=(r.length-1)/Math.log2(t.specularImageSize);return await s.updateRGBDAsync(r,n,a)})}return t._loaded.then(()=>t._babylonTexture)}}q(g);O(g,!0,L=>new N(L));export{N as EXT_lights_image_based};
|
assets/EXT_mesh_gpu_instancing-B3VxVLJg.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{T as t,V as A,Q as F,M as b}from"./math.vector-C1xyPDEl.js";import{L as g}from"./bufferUtils-DTRdUD8L.js";import{G as L,A as M}from"./glTFLoader-BPeiodqB.js";import{u as V,r as w}from"./dynamic-BUKysMyT.js";import"./thinInstanceMesh-CYnaUZKe.js";import"./math.scalar.functions-DkeaWAWz.js";import"./index-Bx1QoKVU.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const m="EXT_mesh_gpu_instancing";class B{constructor(p){this.name=m,this._loader=p,this.enabled=this._loader.isExtensionUsed(m)}dispose(){this._loader=null}loadNodeAsync(p,i,T){return L.LoadExtensionAsync(p,i,this.name,async(f,u)=>{this._loader._disableInstancedMesh++;const h=this._loader.loadNodeAsync(`/nodes/${i.index}`,i,T);if(this._loader._disableInstancedMesh--,!i._primitiveBabylonMeshes)return await h;const c=new Array;let o=0;const n=s=>{if(u.attributes[s]==null){c.push(Promise.resolve(null));return}const e=M.Get(`${f}/attributes/${s}`,this._loader.gltf.accessors,u.attributes[s]);if(c.push(this._loader._loadFloatAccessorAsync(`/accessors/${e.bufferView}`,e)),o===0)o=e.count;else if(o!==e.count)throw new Error(`${f}/attributes: Instance buffer accessors do not have the same count.`)};return n("TRANSLATION"),n("ROTATION"),n("SCALE"),n("_COLOR_0"),await h.then(async s=>{const[e,d,_,a]=await Promise.all(c),y=new Float32Array(o*16);t.Vector3[0].copyFromFloats(0,0,0),t.Quaternion[0].copyFromFloats(0,0,0,1),t.Vector3[1].copyFromFloats(1,1,1);for(let r=0;r<o;++r)e&&A.FromArrayToRef(e,r*3,t.Vector3[0]),d&&F.FromArrayToRef(d,r*4,t.Quaternion[0]),_&&A.FromArrayToRef(_,r*3,t.Vector3[1]),b.ComposeToRef(t.Vector3[1],t.Quaternion[0],t.Vector3[0],t.Matrix[0]),t.Matrix[0].copyToArray(y,r*16);for(const r of i._primitiveBabylonMeshes)r.thinInstanceSetBuffer("matrix",y,16,!0),a&&(a.length===o*3?r.thinInstanceSetBuffer("color",a,3,!0):a.length===o*4?r.thinInstanceSetBuffer("color",a,4,!0):g.Warn("Unexpected size of _COLOR_0 attribute for mesh "+r.name));return s})})}}V(m);w(m,!0,l=>new B(l));export{B as EXT_mesh_gpu_instancing};
|
assets/EXT_meshopt_compression-Pa499AYZ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as n,A as c}from"./glTFLoader-BPeiodqB.js";import{T as f}from"./tools-D01N7ptR.js";import{u as h,r as y}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./mesh-Fj-9677A.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";let p=0,m=null;class e{static get Default(){return e._Default||(e._Default=new e),e._Default}constructor(){const t=e.Configuration.decoder;this._decoderModulePromise=f.LoadBabylonScriptAsync(t.url).then(()=>MeshoptDecoder.ready)}dispose(){delete this._decoderModulePromise}async decodeGltfBufferAsync(t,i,d,r,o){await this._decoderModulePromise,p===0&&(MeshoptDecoder.useWorkers(1),p=1);const s=await MeshoptDecoder.decodeGltfBufferAsync(i,d,t,r,o);return m!==null&&clearTimeout(m),m=setTimeout(()=>{MeshoptDecoder.useWorkers(0),p=0,m=null},1e3),s}}e.Configuration={decoder:{url:`${f._DefaultCdnUrl}/meshopt_decoder.js`}};e._Default=null;const a="EXT_meshopt_compression";class _{constructor(t){this.name=a,this.enabled=t.isExtensionUsed(a),this._loader=t}dispose(){this._loader=null}loadBufferViewAsync(t,i){return n.LoadExtensionAsync(t,i,this.name,async(d,r)=>{const o=i;if(o._meshOptData)return await o._meshOptData;const s=c.Get(`${t}/buffer`,this._loader.gltf.buffers,r.buffer);return o._meshOptData=this._loader.loadBufferAsync(`/buffers/${s.index}`,s,r.byteOffset||0,r.byteLength).then(async l=>await e.Default.decodeGltfBufferAsync(l,r.count,r.byteStride,r.mode,r.filter)),await o._meshOptData})}}h(a);y(a,!0,u=>new _(u));export{_ as EXT_meshopt_compression};
|
assets/EXT_texture_avif-Nv7VBjPQ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as m,A as p}from"./glTFLoader-BPeiodqB.js";import{u,r as _}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const o="EXT_texture_avif";class c{constructor(r){this.name=o,this._loader=r,this.enabled=r.isExtensionUsed(o)}dispose(){this._loader=null}_loadTextureAsync(r,t,e){return m.LoadExtensionAsync(r,t,this.name,async(s,a)=>{const n=t.sampler==null?m.DefaultSampler:p.Get(`${r}/sampler`,this._loader.gltf.samplers,t.sampler),l=p.Get(`${s}/source`,this._loader.gltf.images,a.source);return await this._loader._createTextureAsync(r,n,l,d=>{e(d)},void 0,!t._textureInfo.nonColorData)})}}u(o);_(o,!0,i=>new c(i));export{c as EXT_texture_avif};
|
assets/EXT_texture_webp-BDYrjNRo.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as m,A as p}from"./glTFLoader-BPeiodqB.js";import{u,r as _}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const o="EXT_texture_webp";class c{constructor(r){this.name=o,this._loader=r,this.enabled=r.isExtensionUsed(o)}dispose(){this._loader=null}_loadTextureAsync(r,t,e){return m.LoadExtensionAsync(r,t,this.name,async(s,a)=>{const n=t.sampler==null?m.DefaultSampler:p.Get(`${r}/sampler`,this._loader.gltf.samplers,t.sampler),l=p.Get(`${s}/source`,this._loader.gltf.images,a.source);return await this._loader._createTextureAsync(r,n,l,d=>{e(d)},void 0,!t._textureInfo.nonColorData)})}}u(o);_(o,!0,i=>new c(i));export{c as EXT_texture_webp};
|
assets/ExtrasAsMetadata-Cp9P1Lmx.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as o,r as n}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./sceneLoader-CutT-qCn.js";import"./tools-D01N7ptR.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./math.color-CzLaKyb6.js";import"./scene-gn_hoGMy.js";import"./smartArray-CO6iJ0u5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./renderingManager-CiY2OUrf.js";import"./deviceInputEvents-BTza-zoR.js";import"./perfCounter-DusmGz8t.js";import"./sceneLoaderFlags-wywyb9ml.js";const i="ExtrasAsMetadata";class m{_assignExtras(r,t){if(t.extras&&Object.keys(t.extras).length>0){const s=r.metadata=r.metadata||{},a=s.gltf=s.gltf||{};a.extras=t.extras}}constructor(r){this.name=i,this.enabled=!0,this._loader=r}dispose(){this._loader=null}loadNodeAsync(r,t,s){return this._loader.loadNodeAsync(r,t,a=>{this._assignExtras(a,t),s(a)})}loadCameraAsync(r,t,s){return this._loader.loadCameraAsync(r,t,a=>{this._assignExtras(a,t),s(a)})}createMaterial(r,t,s){const a=this._loader.createMaterial(r,t,s);return this._assignExtras(a,t),a}loadAnimationAsync(r,t){return this._loader.loadAnimationAsync(r,t).then(s=>(this._assignExtras(s,t),s))}}o(i);n(i,!1,e=>new m(e));export{m as ExtrasAsMetadata};
|
assets/KHR_animation_pointer-DbEjDTwi.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{L as K}from"./bufferUtils-DTRdUD8L.js";import{u as B,r as Z}from"./dynamic-BUKysMyT.js";import{S as e,a as G}from"./objectModelMapping-DWcnlpHl.js";import{A as t}from"./animation-IftAdLIx.js";import{AnimationPropertyInfo as p}from"./glTFLoaderAnimation-QPpM8WOy.js";import{Color3 as V}from"./math.color-CzLaKyb6.js";import"./index-Bx1QoKVU.js";import"./sceneLoader-CutT-qCn.js";import"./tools-D01N7ptR.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./decorators.serialization-C7d7ykGG.js";import"./scene-gn_hoGMy.js";import"./smartArray-CO6iJ0u5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./renderingManager-CiY2OUrf.js";import"./deviceInputEvents-BTza-zoR.js";import"./perfCounter-DusmGz8t.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./node-C-Iu0ALa.js";import"./light-DT53MGnW.js";import"./math.axis-Ck7JfPPj.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";function u(l,r,a,i){return V.FromArray(r,a).scale(i)}function W(l,r,a,i){return r[a+3]*i}function s(l,r,a,i){return r[a]*i}function O(l,r,a,i){return-r[a]*i}function A(l,r,a,i){return r[a+1]*i}function z(l,r,a,i){return r[a]*i*2}function o(l){return{scale:[new n(t.ANIMATIONTYPE_FLOAT,`${l}.uScale`,s,()=>2),new n(t.ANIMATIONTYPE_FLOAT,`${l}.vScale`,A,()=>2)],offset:[new n(t.ANIMATIONTYPE_FLOAT,`${l}.uOffset`,s,()=>2),new n(t.ANIMATIONTYPE_FLOAT,`${l}.vOffset`,A,()=>2)],rotation:[new n(t.ANIMATIONTYPE_FLOAT,`${l}.wAng`,O,()=>1)]}}class c extends p{buildAnimations(r,a,i,m){return[{babylonAnimatable:r._babylonCamera,babylonAnimation:this._buildAnimation(a,i,m)}]}}class n extends p{buildAnimations(r,a,i,m){const x=[];for(const T in r._data)x.push({babylonAnimatable:r._data[T].babylonMaterial,babylonAnimation:this._buildAnimation(a,i,m)});return x}}class _ extends p{buildAnimations(r,a,i,m){return[{babylonAnimatable:r._babylonLight,babylonAnimation:this._buildAnimation(a,i,m)}]}}class D extends p{buildAnimations(r,a,i,m){return r._primitiveBabylonMeshes?r._primitiveBabylonMeshes.map(x=>({babylonAnimatable:x,babylonAnimation:this._buildAnimation(a,i,m)})):[]}}e("/cameras/{}/orthographic/xmag",[new c(t.ANIMATIONTYPE_FLOAT,"orthoLeft",O,()=>1),new c(t.ANIMATIONTYPE_FLOAT,"orthoRight",A,()=>1)]);e("/cameras/{}/orthographic/ymag",[new c(t.ANIMATIONTYPE_FLOAT,"orthoBottom",O,()=>1),new c(t.ANIMATIONTYPE_FLOAT,"orthoTop",A,()=>1)]);e("/cameras/{}/orthographic/zfar",[new c(t.ANIMATIONTYPE_FLOAT,"maxZ",s,()=>1)]);e("/cameras/{}/orthographic/znear",[new c(t.ANIMATIONTYPE_FLOAT,"minZ",s,()=>1)]);e("/cameras/{}/perspective/yfov",[new c(t.ANIMATIONTYPE_FLOAT,"fov",s,()=>1)]);e("/cameras/{}/perspective/zfar",[new c(t.ANIMATIONTYPE_FLOAT,"maxZ",s,()=>1)]);e("/cameras/{}/perspective/znear",[new c(t.ANIMATIONTYPE_FLOAT,"minZ",s,()=>1)]);e("/materials/{}/pbrMetallicRoughness/baseColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"albedoColor",u,()=>4),new n(t.ANIMATIONTYPE_FLOAT,"alpha",W,()=>4)]);e("/materials/{}/pbrMetallicRoughness/metallicFactor",[new n(t.ANIMATIONTYPE_FLOAT,"metallic",s,()=>1)]);e("/materials/{}/pbrMetallicRoughness/metallicFactor",[new n(t.ANIMATIONTYPE_FLOAT,"roughness",s,()=>1)]);const H=o("albedoTexture");e("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale",H.scale);e("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset",H.offset);e("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/rotation",H.rotation);const N=o("metallicTexture");e("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/scale",N.scale);e("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/offset",N.offset);e("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/rotation",N.rotation);e("/materials/{}/emissiveFactor",[new n(t.ANIMATIONTYPE_COLOR3,"emissiveColor",u,()=>3)]);const g=o("bumpTexture");e("/materials/{}/normalTexture/scale",[new n(t.ANIMATIONTYPE_FLOAT,"bumpTexture.level",s,()=>1)]);e("/materials/{}/normalTexture/extensions/KHR_texture_transform/scale",g.scale);e("/materials/{}/normalTexture/extensions/KHR_texture_transform/offset",g.offset);e("/materials/{}/normalTexture/extensions/KHR_texture_transform/rotation",g.rotation);e("/materials/{}/occlusionTexture/strength",[new n(t.ANIMATIONTYPE_FLOAT,"ambientTextureStrength",s,()=>1)]);const d=o("ambientTexture");e("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/scale",d.scale);e("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/offset",d.offset);e("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/rotation",d.rotation);const b=o("emissiveTexture");e("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/scale",b.scale);e("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/offset",b.offset);e("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/rotation",b.rotation);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyStrength",[new n(t.ANIMATIONTYPE_FLOAT,"anisotropy.intensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyRotation",[new n(t.ANIMATIONTYPE_FLOAT,"anisotropy.angle",s,()=>1)]);const M=o("anisotropy.texture");e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/scale",M.scale);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/offset",M.offset);e("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/rotation",M.rotation);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatFactor",[new n(t.ANIMATIONTYPE_FLOAT,"clearCoat.intensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor",[new n(t.ANIMATIONTYPE_FLOAT,"clearCoat.roughness",s,()=>1)]);const F=o("clearCoat.texture");e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/scale",F.scale);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/offset",F.offset);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/rotation",F.rotation);const E=o("clearCoat.bumpTexture");e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/scale",[new n(t.ANIMATIONTYPE_FLOAT,"clearCoat.bumpTexture.level",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/scale",E.scale);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/offset",E.offset);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/rotation",E.rotation);const w=o("clearCoat.textureRoughness");e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/scale",w.scale);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/offset",w.offset);e("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/rotation",w.rotation);e("/materials/{}/extensions/KHR_materials_dispersion/dispersionFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.dispersion",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_emissive_strength/emissiveStrength",[new n(t.ANIMATIONTYPE_FLOAT,"emissiveIntensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_ior/ior",[new n(t.ANIMATIONTYPE_FLOAT,"indexOfRefraction",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceFactor",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.intensity",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceIor",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.indexOfRefraction",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMinimum",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.minimumThickness",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMaximum",[new n(t.ANIMATIONTYPE_FLOAT,"iridescence.maximumThickness",s,()=>1)]);const L=o("iridescence.texture");e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/scale",L.scale);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/offset",L.offset);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/rotation",L.rotation);const P=o("iridescence.thicknessTexture");e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/scale",P.scale);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/offset",P.offset);e("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/rotation",P.rotation);e("/materials/{}/extensions/KHR_materials_sheen/sheenColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"sheen.color",u,()=>3)]);e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessFactor",[new n(t.ANIMATIONTYPE_FLOAT,"sheen.roughness",s,()=>1)]);const y=o("sheen.texture");e("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/scale",y.scale);e("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/offset",y.offset);e("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/rotation",y.rotation);const C=o("sheen.textureRoughness");e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/scale",C.scale);e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/offset",C.offset);e("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/rotation",C.rotation);e("/materials/{}/extensions/KHR_materials_specular/specularFactor",[new n(t.ANIMATIONTYPE_FLOAT,"metallicF0Factor",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_specular/specularColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"metallicReflectanceColor",u,()=>3)]);const Y=o("metallicReflectanceTexture");e("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/scale",Y.scale);e("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/offset",Y.offset);e("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/rotation",Y.rotation);const v=o("reflectanceTexture");e("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/scale",v.scale);e("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/offset",v.offset);e("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/rotation",v.rotation);e("/materials/{}/extensions/KHR_materials_transmission/transmissionFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.refractionIntensity",s,()=>1)]);const S=o("subSurface.refractionIntensityTexture");e("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/scale",S.scale);e("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/offset",S.offset);e("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/rotation",S.rotation);e("/materials/{}/extensions/KHR_materials_volume/attenuationColor",[new n(t.ANIMATIONTYPE_COLOR3,"subSurface.tintColor",u,()=>3)]);e("/materials/{}/extensions/KHR_materials_volume/attenuationDistance",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.tintColorAtDistance",s,()=>1)]);e("/materials/{}/extensions/KHR_materials_volume/thicknessFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.maximumThickness",s,()=>1)]);const $=o("subSurface.thicknessTexture");e("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/scale",$.scale);e("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/offset",$.offset);e("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/rotation",$.rotation);e("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionFactor",[new n(t.ANIMATIONTYPE_FLOAT,"subSurface.translucencyIntensity",s,()=>1)]);const k=o("subSurface.translucencyIntensityTexture");e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/scale",k.scale);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/offset",k.offset);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/rotation",k.rotation);e("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorFactor",[new n(t.ANIMATIONTYPE_COLOR3,"subSurface.translucencyColor",u,()=>3)]);const j=o("subSurface.translucencyColorTexture");e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/scale",j.scale);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/offset",j.offset);e("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/rotation",j.rotation);e("/extensions/KHR_lights_punctual/lights/{}/color",[new _(t.ANIMATIONTYPE_COLOR3,"diffuse",u,()=>3)]);e("/extensions/KHR_lights_punctual/lights/{}/intensity",[new _(t.ANIMATIONTYPE_FLOAT,"intensity",s,()=>1)]);e("/extensions/KHR_lights_punctual/lights/{}/range",[new _(t.ANIMATIONTYPE_FLOAT,"range",s,()=>1)]);e("/extensions/KHR_lights_punctual/lights/{}/spot/innerConeAngle",[new _(t.ANIMATIONTYPE_FLOAT,"innerAngle",z,()=>1)]);e("/extensions/KHR_lights_punctual/lights/{}/spot/outerConeAngle",[new _(t.ANIMATIONTYPE_FLOAT,"angle",z,()=>1)]);e("/extensions/EXT_lights_area/lights/{}/color",[new _(t.ANIMATIONTYPE_COLOR3,"diffuse",u,()=>3)]);e("/extensions/EXT_lights_area/lights/{}/intensity",[new _(t.ANIMATIONTYPE_FLOAT,"intensity",s,()=>1)]);e("/extensions/EXT_lights_area/lights/{}/size",[new _(t.ANIMATIONTYPE_FLOAT,"radius",s,()=>1)]);e("/extensions/EXT_lights_area/lights/{}/rect/aspect",[new _(t.ANIMATIONTYPE_FLOAT,"radius",s,()=>1)]);e("/nodes/{}/extensions/EXT_lights_ies/color",[new _(t.ANIMATIONTYPE_COLOR3,"diffuse",u,()=>3)]);e("/nodes/{}/extensions/EXT_lights_ies/multiplier",[new _(t.ANIMATIONTYPE_FLOAT,"intensity",s,()=>1)]);e("/nodes/{}/extensions/KHR_node_visibility/visible",[new D(t.ANIMATIONTYPE_FLOAT,"isVisible",s,()=>1)]);const R="KHR_animation_pointer";class U{constructor(r){this.name=R,this._loader=r,this._pathToObjectConverter=G(this._loader.gltf)}get enabled(){return this._loader.isExtensionUsed(R)}dispose(){this._loader=null,delete this._pathToObjectConverter}_loadAnimationChannelAsync(r,a,i,m,x){var X;const T=(X=m.target.extensions)==null?void 0:X.KHR_animation_pointer;if(!T||!this._pathToObjectConverter)return null;m.target.path!=="pointer"&&K.Warn(`${r}/target/path: Value (${m.target.path}) must be (pointer) when using the ${this.name} extension`),m.target.node!=null&&K.Warn(`${r}/target/node: Value (${m.target.node}) must not be present when using the ${this.name} extension`);const I=`${r}/extensions/${this.name}`,h=T.pointer;if(!h)throw new Error(`${I}: Pointer is missing`);try{const f=this._pathToObjectConverter.convert(h);if(!f.info.interpolation)throw new Error(`${I}/pointer: Interpolation is missing`);return this._loader._loadAnimationChannelFromTargetInfoAsync(r,a,i,m,{object:f.object,info:f.info.interpolation},x)}catch{return K.Warn(`${I}/pointer: Invalid pointer (${h}) skipped`),null}}}B(R);Z(R,!0,l=>new U(l));export{U as KHR_animation_pointer};
|
assets/KHR_draco_mesh_compression-BEx33bus.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{T as A}from"./tools-D01N7ptR.js";import{A as v}from"./workerPool-CfMXSLnf.js";import{G as C}from"./mesh-Fj-9677A.js";import{V as _}from"./buffer-DqKlo1ts.js";import{L as V}from"./bufferUtils-DTRdUD8L.js";import{G as k,A as g,L as R}from"./glTFLoader-BPeiodqB.js";import{u as F,r as N}from"./dynamic-BUKysMyT.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./decorators.serialization-C7d7ykGG.js";import"./math.color-CzLaKyb6.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./index-Bx1QoKVU.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./dataBuffer-CgoqiUzT.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";function U(c,t,n,a,m){const e=c;let r=null,o=null,s=null;try{r=new e.Decoder,o=new e.DecoderBuffer,o.Init(t,t.byteLength);let i;const l=r.GetEncodedGeometryType(o);switch(l){case e.TRIANGULAR_MESH:{const d=new e.Mesh;if(i=r.DecodeBufferToMesh(o,d),!i.ok()||d.ptr===0)throw new Error(i.error_msg());const y=d.num_faces()*3,p=y*4,u=e._malloc(p);try{r.GetTrianglesUInt32Array(d,p,u);const P=new Uint32Array(y);P.set(new Uint32Array(e.HEAPF32.buffer,u,y)),a(P)}finally{e._free(u)}s=d;break}case e.POINT_CLOUD:{const d=new e.PointCloud;if(i=r.DecodeBufferToPointCloud(o,d),!i.ok()||!d.ptr)throw new Error(i.error_msg());s=d;break}default:throw new Error(`Draco: Cannot decode invalid geometry type ${l}`)}const h=s.num_points(),b=(d,f,y,p)=>{const u=p.data_type(),P=p.num_components(),M=p.normalized(),B=p.byte_stride(),O=p.byte_offset(),T={[e.DT_FLOAT32]:{typedArrayConstructor:Float32Array,heap:e.HEAPF32},[e.DT_INT8]:{typedArrayConstructor:Int8Array,heap:e.HEAP8},[e.DT_INT16]:{typedArrayConstructor:Int16Array,heap:e.HEAP16},[e.DT_INT32]:{typedArrayConstructor:Int32Array,heap:e.HEAP32},[e.DT_UINT8]:{typedArrayConstructor:Uint8Array,heap:e.HEAPU8},[e.DT_UINT16]:{typedArrayConstructor:Uint16Array,heap:e.HEAPU16},[e.DT_UINT32]:{typedArrayConstructor:Uint32Array,heap:e.HEAPU32}}[u];if(!T)throw new Error(`Draco: Cannot decode invalid data type ${u}`);const I=h*P,L=I*T.typedArrayConstructor.BYTES_PER_ELEMENT,D=e._malloc(L);try{d.GetAttributeDataArrayForAllPoints(f,p,u,L,D);const G=new T.typedArrayConstructor(T.heap.buffer,D,I);m(y,G.slice(),P,O,B,M)}finally{e._free(D)}};if(n)for(const d in n){const f=n[d],y=r.GetAttributeByUniqueId(s,f);b(r,s,d,y)}else{const d={position:e.POSITION,normal:e.NORMAL,color:e.COLOR,uv:e.TEX_COORD};for(const f in d){const y=r.GetAttributeId(s,d[f]);if(y!==-1){const p=r.GetAttribute(s,y);b(r,s,f,p)}}}return h}finally{s&&e.destroy(s),o&&e.destroy(o),r&&e.destroy(r)}}function S(){let c;onmessage=t=>{const n=t.data;switch(n.id){case"init":{n.url&&importScripts(n.url);const a=n.wasmBinary?{wasmBinary:n.wasmBinary}:{};c=DracoDecoderModule(a),postMessage({id:"initDone"});break}case"decodeMesh":{if(!c)throw new Error("Draco: Decoder module is not available");c.then(a=>{const m=U(a,n.dataView,n.attributes,e=>{postMessage({id:"indices",data:e},[e.buffer])},(e,r,o,s,i,l)=>{postMessage({id:"attribute",kind:e,data:r,size:o,byteOffset:s,byteStride:i,normalized:l},[r.buffer])});postMessage({id:"decodeMeshDone",totalVertices:m})});break}}}}async function W(c,t,n){return await new Promise((a,m)=>{const e=o=>{c.removeEventListener("error",e),c.removeEventListener("message",r),m(o)},r=o=>{o.data.id==="initDone"&&(c.removeEventListener("error",e),c.removeEventListener("message",r),a(c))};if(c.addEventListener("error",e),c.addEventListener("message",r),!t)c.postMessage({id:"init",url:n});else{const o=t.slice(0);c.postMessage({id:"init",url:n,wasmBinary:o},[o])}})}function K(){return typeof navigator!="object"||!navigator.hardwareConcurrency?1:Math.min(Math.floor(navigator.hardwareConcurrency*.5),4)}function $(c){return!!(c.wasmUrl&&(c.wasmBinary||c.wasmBinaryUrl)&&typeof WebAssembly=="object"||c.fallbackUrl)}class z{constructor(t){if(t.workerPool){this._workerPoolPromise=Promise.resolve(t.workerPool);return}const n=t.wasmBinary,a=t.numWorkers??K(),m=a&&typeof Worker=="function"&&typeof URL=="function",e=m||!t.jsModule,r=t.wasmUrl&&t.wasmBinaryUrl&&typeof WebAssembly=="object"?{url:e?A.GetBabylonScriptURL(t.wasmUrl,!0):"",wasmBinaryPromise:n?Promise.resolve(n):A.LoadFileAsync(A.GetBabylonScriptURL(t.wasmBinaryUrl,!0))}:{url:e?A.GetBabylonScriptURL(t.fallbackUrl):"",wasmBinaryPromise:Promise.resolve(void 0)};m?this._workerPoolPromise=r.wasmBinaryPromise.then(o=>{const s=this._getWorkerContent(),i=URL.createObjectURL(new Blob([s],{type:"application/javascript"}));return new v(a,()=>{const l=new Worker(i);return W(l,o,r.url)})}):this._modulePromise=r.wasmBinaryPromise.then(async o=>{if(!this._isModuleAvailable()&&!t.jsModule){if(!r.url)throw new Error("Draco codec module is not available");await A.LoadBabylonScriptAsync(r.url)}return await this._createModuleAsync(o,t.jsModule)})}async whenReadyAsync(){if(this._workerPoolPromise){await this._workerPoolPromise;return}if(this._modulePromise){await this._modulePromise;return}}dispose(){this._workerPoolPromise&&this._workerPoolPromise.then(t=>{t.dispose()}),delete this._workerPoolPromise,delete this._modulePromise}}class w extends z{static get DefaultAvailable(){return $(w.DefaultConfiguration)}static get Default(){return w._Default??(w._Default=new w),w._Default}static ResetDefault(t){w._Default&&(t||w._Default.dispose(),w._Default=null)}_isModuleAvailable(){return typeof DracoDecoderModule<"u"}async _createModuleAsync(t,n){return{module:await(n||DracoDecoderModule)({wasmBinary:t})}}_getWorkerContent(){return`${U}(${S})()`}constructor(t=w.DefaultConfiguration){super(t)}decodeMeshToMeshDataAsync(t,n,a){const m=t instanceof ArrayBuffer?new Int8Array(t):new Int8Array(t.buffer,t.byteOffset,t.byteLength),e=(r,o)=>a&&a[r]!==void 0?(o!==a[r]&&V.Warn(`Normalized flag from Draco data (${o}) does not match normalized flag from glTF accessor (${a[r]}). Using flag from glTF accessor.`),a[r]):o;if(this._workerPoolPromise)return this._workerPoolPromise.then(async r=>await new Promise((o,s)=>{r.push((i,l)=>{let h=null;const b=[],d=p=>{i.removeEventListener("error",d),i.removeEventListener("message",f),s(p),l()},f=p=>{const u=p.data;switch(u.id){case"indices":{h=u.data;break}case"attribute":{b.push({kind:u.kind,data:u.data,size:u.size,byteOffset:u.byteOffset,byteStride:u.byteStride,normalized:e(u.kind,u.normalized)});break}case"decodeMeshDone":{i.removeEventListener("error",d),i.removeEventListener("message",f),o({indices:h,attributes:b,totalVertices:u.totalVertices}),l();break}}};i.addEventListener("error",d),i.addEventListener("message",f);const y=m.slice();i.postMessage({id:"decodeMesh",dataView:y,attributes:n},[y.buffer])})}));if(this._modulePromise)return this._modulePromise.then(r=>{let o=null;const s=[],i=U(r.module,m,n,l=>{o=l},(l,h,b,d,f,y)=>{s.push({kind:l,data:h,size:b,byteOffset:d,byteStride:f,normalized:y})});return{indices:o,attributes:s,totalVertices:i}});throw new Error("Draco: Decoder module is not available")}async decodeMeshToGeometryAsync(t,n,a,m){const e=await this.decodeMeshToMeshDataAsync(a,m),r=new C(t,n);e.indices&&r.setIndices(e.indices);for(const o of e.attributes)r.setVerticesBuffer(new _(n.getEngine(),o.data,o.kind,!1,void 0,o.byteStride,void 0,o.byteOffset,o.size,void 0,o.normalized,!0),e.totalVertices);return r}async _decodeMeshToGeometryForGltfAsync(t,n,a,m,e,r){const o=await this.decodeMeshToMeshDataAsync(a,m,e),s=new C(t,n);r&&(s._boundingInfo=r,s.useBoundingInfoFromGeometry=!0),o.indices&&s.setIndices(o.indices);for(const i of o.attributes)s.setVerticesBuffer(new _(n.getEngine(),i.data,i.kind,!1,void 0,i.byteStride,void 0,i.byteOffset,i.size,void 0,i.normalized,!0),o.totalVertices);return s}}w.DefaultConfiguration={wasmUrl:`${A._DefaultCdnUrl}/draco_wasm_wrapper_gltf.js`,wasmBinaryUrl:`${A._DefaultCdnUrl}/draco_decoder_gltf.wasm`,fallbackUrl:`${A._DefaultCdnUrl}/draco_decoder_gltf.js`};w._Default=null;const E="KHR_draco_mesh_compression";class H{constructor(t){this.name=E,this.useNormalizedFlagFromAccessor=!0,this._loader=t,this.enabled=w.DefaultAvailable&&this._loader.isExtensionUsed(E)}dispose(){delete this.dracoDecoder,this._loader=null}_loadVertexDataAsync(t,n,a){return k.LoadExtensionAsync(t,n,this.name,async(m,e)=>{if(n.mode!=null&&n.mode!==4&&n.mode!==5)throw new Error(`${t}: Unsupported mode ${n.mode}`);const r={},o={},s=(l,h)=>{const b=e.attributes[l];if(b!=null&&(a._delayInfo=a._delayInfo||[],a._delayInfo.indexOf(h)===-1&&a._delayInfo.push(h),r[h]=b,this.useNormalizedFlagFromAccessor)){const d=g.TryGet(this._loader.gltf.accessors,n.attributes[l]);d&&(o[h]=d.normalized||!1)}};s("POSITION",_.PositionKind),s("NORMAL",_.NormalKind),s("TANGENT",_.TangentKind),s("TEXCOORD_0",_.UVKind),s("TEXCOORD_1",_.UV2Kind),s("TEXCOORD_2",_.UV3Kind),s("TEXCOORD_3",_.UV4Kind),s("TEXCOORD_4",_.UV5Kind),s("TEXCOORD_5",_.UV6Kind),s("JOINTS_0",_.MatricesIndicesKind),s("WEIGHTS_0",_.MatricesWeightsKind),s("COLOR_0",_.ColorKind);const i=g.Get(m,this._loader.gltf.bufferViews,e.bufferView);return i._dracoBabylonGeometry||(i._dracoBabylonGeometry=this._loader.loadBufferViewAsync(`/bufferViews/${i.index}`,i).then(async l=>{const h=this.dracoDecoder||w.Default,b=g.TryGet(this._loader.gltf.accessors,n.attributes.POSITION),d=!this._loader.parent.alwaysComputeBoundingBox&&!a.skeleton&&b?R(b):null;return await h._decodeMeshToGeometryForGltfAsync(a.name,this._loader.babylonScene,l,r,o,d).catch(f=>{throw new Error(`${t}: ${f.message}`)})})),await i._dracoBabylonGeometry})}}F(E);N(E,!0,c=>new H(c));export{H as KHR_draco_mesh_compression};
|
assets/KHR_interactivity-K8Kioa6L.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/flowGraphPlayAnimationBlock-B9FP0RfS.js","assets/declarationMapper-oEUQrCmY.js","assets/bufferUtils-DTRdUD8L.js","assets/math.vector-C1xyPDEl.js","assets/math.scalar.functions-DkeaWAWz.js","assets/math.color-CzLaKyb6.js","assets/animationGroup-BP7VB8mY.js","assets/animation-IftAdLIx.js","assets/node-C-Iu0ALa.js","assets/decorators.serialization-C7d7ykGG.js","assets/baseTexture-CgAggsey.js","assets/bone-B35odufe.js","assets/scene-gn_hoGMy.js","assets/tools-D01N7ptR.js","assets/smartArray-CO6iJ0u5.js","assets/lightConstants-B1TSTh-k.js","assets/sceneComponent-Dflhczui.js","assets/math.plane-Ce_75-g5.js","assets/buffer-DqKlo1ts.js","assets/dataBuffer-CgoqiUzT.js","assets/renderingManager-CiY2OUrf.js","assets/deviceInputEvents-BTza-zoR.js","assets/perfCounter-DusmGz8t.js","assets/index-Bx1QoKVU.js","assets/index-BfQ3YfM4.css","assets/dynamic-BUKysMyT.js","assets/sceneLoader-CutT-qCn.js","assets/sceneLoaderFlags-wywyb9ml.js","assets/objectModelMapping-DWcnlpHl.js","assets/light-DT53MGnW.js","assets/math.axis-Ck7JfPPj.js","assets/texture-BEqhDl5Y.js","assets/flowGraphStopAnimationBlock-ChXcK4cb.js","assets/flowGraphPauseAnimationBlock-DAoY0eJc.js","assets/flowGraphInterpolationBlock-CYcMKCGO.js","assets/flowGraphSceneReadyEventBlock-Crn-rAIL.js","assets/flowGraphSceneTickEventBlock-gf3YDJRe.js","assets/flowGraphSendCustomEventBlock-Ba8XUM8G.js","assets/flowGraphReceiveCustomEventBlock-CId8KX4K.js","assets/flowGraphMeshPickEventBlock-WsLHiXtY.js","assets/flowGraphMathBlocks-HeZhspxf.js","assets/flowGraphBinaryOperationBlock-CNTF2Ejc.js","assets/flowGraphCachedOperationBlock-cxKp5Gdq.js","assets/flowGraphUnaryOperationBlock-CI7NJ04I.js","assets/flowGraphVectorMathBlocks-BGV5dKz9.js","assets/flowGraphMatrixMathBlocks-Dg7VLPFP.js","assets/flowGraphBranchBlock-CPQ1Lj8X.js","assets/flowGraphSetDelayBlock-BA13Fleb.js","assets/flowGraphCancelDelayBlock-CiPuCgGz.js","assets/flowGraphCounterBlock-OjaFZjW5.js","assets/flowGraphDebounceBlock-fxe8WoxT.js","assets/flowGraphThrottleBlock-B-yO7rgE.js","assets/flowGraphDoNBlock-C4vVyovK.js","assets/flowGraphFlipFlopBlock-BSjrwcqq.js","assets/flowGraphForLoopBlock-jI9z_K5X.js","assets/flowGraphMultiGateBlock-Cy-tdSZ3.js","assets/flowGraphSequenceBlock-Bcye5mDB.js","assets/flowGraphSwitchBlock-CfuObCnO.js","assets/flowGraphWaitAllBlock-VXxeVnO_.js","assets/flowGraphWhileLoopBlock-BYmEfSWz.js","assets/flowGraphConsoleLogBlock-Cz7IRQyV.js","assets/flowGraphConditionalDataBlock-Btzamqcx.js","assets/flowGraphConstantBlock-BV1ij11S.js","assets/flowGraphTransformCoordinatesSystemBlock-D3zEJ4A-.js","assets/flowGraphGetAssetBlock-BeMIiO3t.js","assets/flowGraphGetPropertyBlock-CAOmAIk8.js","assets/flowGraphSetPropertyBlock-DxJBj-a9.js","assets/flowGraphGetVariableBlock-BaRkHNJ_.js","assets/flowGraphSetVariableBlock-BG0Kfa6g.js","assets/flowGraphJsonPointerParserBlock-CZ93bSRG.js","assets/flowGraphMathCombineExtractBlocks-Dg02KNQM.js","assets/flowGraphTypeToTypeBlocks-DdLy9OXZ.js","assets/flowGraphEasingBlock-C_-3ZhLh.js","assets/easing-Wc0jPSIm.js","assets/math.path-DFucxaHn.js","assets/flowGraphBezierCurveEasingBlock--1XIKCm2.js","assets/flowGraphPointerOverEventBlock-wKWlgMPO.js","assets/flowGraphPointerOutEventBlock-BpW1yJKn.js","assets/flowGraphContextBlock-DeEwvFEY.js","assets/flowGraphArrayIndexBlock-3XRt4h8L.js","assets/flowGraphCodeExecutionBlock-BpjYYwgf.js","assets/flowGraphIndexOfBlock-D1XW4kc4.js","assets/flowGraphFunctionReferenceBlock-CLhl7P_Q.js","assets/flowGraphDataSwitchBlock-BUqG5JEg.js","assets/flowGraphGLTFDataProvider-By82y__G.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{_ as r}from"./index-Bx1QoKVU.js";import{M as kt,a as Gt,V as ut,b as Bt,Q as X,O as U}from"./math.vector-C1xyPDEl.js";import{L as w,_ as Ft,s as Et}from"./bufferUtils-DTRdUD8L.js";import{R as D}from"./decorators.serialization-C7d7ykGG.js";import{Color3 as vt,Color4 as It}from"./math.color-CzLaKyb6.js";import{F as Tt,a as Vt,b as Ct,g as Pt,c as bt,d as at}from"./declarationMapper-oEUQrCmY.js";import{R as ht}from"./math.scalar.functions-DkeaWAWz.js";import{P as rt}from"./deviceInputEvents-BTza-zoR.js";import{u as Ot,r as xt}from"./dynamic-BUKysMyT.js";import{a as Dt,A as O}from"./objectModelMapping-DWcnlpHl.js";function At(a){return a==="Mesh"||a==="AbstractMesh"||a==="GroundMesh"||a==="InstanceMesh"||a==="LinesMesh"||a==="GoldbergMesh"||a==="GreasedLineMesh"||a==="TrailMesh"}function pt(a){return a==="Vector2"||a==="Vector3"||a==="Vector4"||a==="Quaternion"||a==="Color3"||a==="Color4"}function Rt(a){return a==="Matrix"||a==="Matrix2D"||a==="Matrix3D"}function Lt(a){return a==="AnimationGroup"}function St(a,t,e=!1){if(a==="Vector2")return Gt.FromArray(t);if(a==="Vector3")return e&&(t[2]*=-1),ut.FromArray(t);if(a==="Vector4")return Bt.FromArray(t);if(a==="Quaternion")return e&&(t[2]*=-1,t[3]*=-1),X.FromArray(t);if(a==="Color3")return new vt(t[0],t[1],t[2]);if(a==="Color4")return new It(t[0],t[1],t[2],t[3]);throw new Error(`Unknown vector class name ${a}`)}function tt(a,t,e){var n;const o=((n=t==null?void 0:t.getClassName)==null?void 0:n.call(t))??"";if(pt(o)||Rt(o))e[a]={value:t.asArray(),className:o};else if(o==="FlowGraphInteger")e[a]={value:t.value,className:o};else if(o&&(t.id||t.name))e[a]={id:t.id,name:t.name,className:o};else if(typeof t!="object")e[a]=t;else throw new Error(`Could not serialize value ${t}`)}function H(a,t,e,o){const n=t[a];let s;const i=(n==null?void 0:n.type)??(n==null?void 0:n.className);if(At(i)){let c=o.meshes.filter(l=>n.id?l.id===n.id:l.name===n.name);c.length===0&&(c=o.transformNodes.filter(l=>n.id?l.id===n.id:l.name===n.name)),s=n.uniqueId?c.find(l=>l.uniqueId===n.uniqueId):c[0]}else if(pt(i))s=St(i,n.value);else if(Lt(i)){const c=o.animationGroups.filter(l=>l.name===n.name);s=c.length===1?c[0]:c.find(l=>l.uniqueId===n.uniqueId)}else i==="Matrix"?s=kt.FromArray(n.value):i==="Matrix2D"?s=new Tt(n.value):i==="Matrix3D"?s=new Vt(n.value):i==="FlowGraphInteger"?s=Ct.FromValue(n.value):i==="number"||i==="string"||i==="boolean"?s=n.value[0]:n&&n.value!==void 0?s=n.value:Array.isArray(n)?s=n.reduce((c,l)=>(l.eventData&&(c[l.id]={type:Pt(l.type)},typeof l.value<"u"&&(c[l.id].value=H("value",l,e,o))),c),{}):s=n;return s}function Nt(a){return a==="FlowGraphJsonPointerParserBlock"}var st;(function(a){a.Animation="Animation",a.AnimationGroup="AnimationGroup",a.Mesh="Mesh",a.Material="Material",a.Camera="Camera",a.Light="Light"})(st||(st={}));function Mt(a,t,e,o){switch(t){case"Animation":return o?a.animations.find(n=>n.uniqueId===e)??null:a.animations[e]??null;case"AnimationGroup":return o?a.animationGroups.find(n=>n.uniqueId===e)??null:a.animationGroups[e]??null;case"Mesh":return o?a.meshes.find(n=>n.uniqueId===e)??null:a.meshes[e]??null;case"Material":return o?a.materials.find(n=>n.uniqueId===e)??null:a.materials[e]??null;case"Camera":return o?a.cameras.find(n=>n.uniqueId===e)??null:a.cameras[e]??null;case"Light":return o?a.lights.find(n=>n.uniqueId===e)??null:a.lights[e]??null;default:return null}}var it;(function(a){a.ExecuteBlock="ExecuteBlock",a.ExecuteEvent="ExecuteEvent",a.TriggerConnection="TriggerConnection",a.ContextVariableSet="ContextVariableSet",a.GlobalVariableSet="GlobalVariableSet",a.GlobalVariableDelete="GlobalVariableDelete",a.GlobalVariableGet="GlobalVariableGet",a.AddConnection="AddConnection",a.GetConnectionValue="GetConnectionValue",a.SetConnectionValue="SetConnectionValue",a.ActivateSignal="ActivateSignal",a.ContextVariableGet="ContextVariableGet"})(it||(it={}));class qt{constructor(){this.logToConsole=!1,this.log=[]}addLogItem(t){var e;if(t.time||(t.time=Date.now()),this.log.push(t),this.logToConsole){const o=(e=t.payload)==null?void 0:e.value;typeof o=="object"&&o.getClassName?w.Log(`[FGLog] ${t.className}:${t.uniqueId.split("-")[0]} ${t.action} - ${JSON.stringify(o.getClassName())}: ${o.toString()}`):w.Log(`[FGLog] ${t.className}:${t.uniqueId.split("-")[0]} ${t.action} - ${JSON.stringify(t.payload)}`)}}getItemsOfType(t){return this.log.filter(e=>e.action===t)}}class _t{get enableLogging(){return this._enableLogging}set enableLogging(t){this._enableLogging!==t&&(this._enableLogging=t,this._enableLogging?(this.logger=new qt,this.logger.logToConsole=!0):this.logger=null)}constructor(t){this.uniqueId=D(),this._userVariables={},this._executionVariables={},this._globalContextVariables={},this._connectionValues={},this._pendingBlocks=[],this._executionId=0,this.onNodeExecutedObservable=new U,this.treatDataAsRightHanded=!1,this._enableLogging=!1,this._configuration=t,this.assetsContext=t.assetsContext??t.scene}hasVariable(t){return t in this._userVariables}setVariable(t,e){var o;this._userVariables[t]=e,(o=this.logger)==null||o.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"ContextVariableSet",payload:{name:t,value:e}})}getAsset(t,e){return Mt(this.assetsContext,t,e)}getVariable(t){var e;return(e=this.logger)==null||e.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"ContextVariableGet",payload:{name:t,value:this._userVariables[t]}}),this._userVariables[t]}get userVariables(){return this._userVariables}getScene(){return this._configuration.scene}_getUniqueIdPrefixedName(t,e){return`${t.uniqueId}_${e}`}_getGlobalContextVariable(t,e){var o;return(o=this.logger)==null||o.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableGet",payload:{name:t,defaultValue:e,possibleValue:this._globalContextVariables[t]}}),this._hasGlobalContextVariable(t)?this._globalContextVariables[t]:e}_setGlobalContextVariable(t,e){var o;(o=this.logger)==null||o.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableSet",payload:{name:t,value:e}}),this._globalContextVariables[t]=e}_deleteGlobalContextVariable(t){var e;(e=this.logger)==null||e.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GlobalVariableDelete",payload:{name:t}}),delete this._globalContextVariables[t]}_hasGlobalContextVariable(t){return t in this._globalContextVariables}_setExecutionVariable(t,e,o){this._executionVariables[this._getUniqueIdPrefixedName(t,e)]=o}_getExecutionVariable(t,e,o){return this._hasExecutionVariable(t,e)?this._executionVariables[this._getUniqueIdPrefixedName(t,e)]:o}_deleteExecutionVariable(t,e){delete this._executionVariables[this._getUniqueIdPrefixedName(t,e)]}_hasExecutionVariable(t,e){return this._getUniqueIdPrefixedName(t,e)in this._executionVariables}_hasConnectionValue(t){return t.uniqueId in this._connectionValues}_setConnectionValue(t,e){var o;this._connectionValues[t.uniqueId]=e,(o=this.logger)==null||o.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"SetConnectionValue",payload:{connectionPointId:t.uniqueId,value:e}})}_setConnectionValueByKey(t,e){this._connectionValues[t]=e}_getConnectionValue(t){var e;return(e=this.logger)==null||e.addLogItem({time:Date.now(),className:this.getClassName(),uniqueId:this.uniqueId,action:"GetConnectionValue",payload:{connectionPointId:t.uniqueId,value:this._connectionValues[t.uniqueId]}}),this._connectionValues[t.uniqueId]}get configuration(){return this._configuration}get hasPendingBlocks(){return this._pendingBlocks.length>0}_addPendingBlock(t){this._pendingBlocks.includes(t)||(this._pendingBlocks.push(t),this._pendingBlocks.sort((e,o)=>e.priority-o.priority))}_removePendingBlock(t){const e=this._pendingBlocks.indexOf(t);e!==-1&&this._pendingBlocks.splice(e,1)}_clearPendingBlocks(){for(const t of this._pendingBlocks)t._cancelPendingTasks(this);this._pendingBlocks.length=0}_notifyExecuteNode(t){var e;this.onNodeExecutedObservable.notifyObservers(t),(e=this.logger)==null||e.addLogItem({time:Date.now(),className:t.getClassName(),uniqueId:t.uniqueId,action:"ExecuteBlock"})}_notifyOnTick(t){var e;this._setGlobalContextVariable("timeSinceStart",t.timeSinceStart),this._setGlobalContextVariable("deltaTime",t.deltaTime);for(const o of this._pendingBlocks)(e=o._executeOnTick)==null||e.call(o,this)}_increaseExecutionId(){this._executionId++}get executionId(){return this._executionId}serialize(t={},e=tt){var o;t.uniqueId=this.uniqueId,t._userVariables={};for(const n in this._userVariables)e(n,this._userVariables[n],t._userVariables);t._connectionValues={};for(const n in this._connectionValues)e(n,this._connectionValues[n],t._connectionValues);this.assetsContext!==this.getScene()&&(t._assetsContext={meshes:this.assetsContext.meshes.map(n=>n.id),materials:this.assetsContext.materials.map(n=>n.id),textures:this.assetsContext.textures.map(n=>n.name),animations:this.assetsContext.animations.map(n=>n.name),lights:this.assetsContext.lights.map(n=>n.id),cameras:this.assetsContext.cameras.map(n=>n.id),sounds:(o=this.assetsContext.sounds)==null?void 0:o.map(n=>n.name),skeletons:this.assetsContext.skeletons.map(n=>n.id),particleSystems:this.assetsContext.particleSystems.map(n=>n.name),geometries:this.assetsContext.geometries.map(n=>n.id),multiMaterials:this.assetsContext.multiMaterials.map(n=>n.id),transformNodes:this.assetsContext.transformNodes.map(n=>n.id)})}getClassName(){return"FlowGraphContext"}}Ft([Et()],_t.prototype,"uniqueId",void 0);var ct;(function(a){a[a.Input=0]="Input",a[a.Output=1]="Output"})(ct||(ct={}));class wt{constructor(t,e,o){this._ownerBlock=o,this._connectedPoint=[],this.uniqueId=D(),this.connectedPointIds=[],this.name=t,this._connectionType=e}get connectionType(){return this._connectionType}_isSingularConnection(){return!0}isConnected(){return this._connectedPoint.length>0}connectTo(t){if(this._connectionType===t._connectionType)throw new Error(`Cannot connect two points of type ${this.connectionType}`);if(this._isSingularConnection()&&this._connectedPoint.length>0||t._isSingularConnection()&&t._connectedPoint.length>0)throw new Error("Max number of connections for point reached");this._connectedPoint.push(t),t._connectedPoint.push(this)}disconnectFrom(t,e=!0){const o=this._connectedPoint.indexOf(t),n=t._connectedPoint.indexOf(this);o===-1||n===-1||(e&&this._connectedPoint.splice(o,1),t._connectedPoint.splice(n,1))}disconnectFromAll(){for(const t of this._connectedPoint)this.disconnectFrom(t,!1);this._connectedPoint.length=0}dispose(){for(const t of this._connectedPoint)this.disconnectFrom(t)}serialize(t={}){t.uniqueId=this.uniqueId,t.name=this.name,t._connectionType=this._connectionType,t.connectedPointIds=[],t.className=this.getClassName();for(const e of this._connectedPoint)t.connectedPointIds.push(e.uniqueId)}getClassName(){return"FGConnection"}deserialize(t){this.uniqueId=t.uniqueId,this.name=t.name,this._connectionType=t._connectionType,this.connectedPointIds=t.connectedPointIds}}class Y extends wt{constructor(t,e,o,n,s=n.defaultValue,i=!1){super(t,e,o),this.richType=n,this._defaultValue=s,this._optional=i,this._isDisabled=!1,this._lastValue=null,this.dataTransformer=null,this.onValueChangedObservable=new U}get optional(){return this._optional}get isDisabled(){return this._isDisabled}set isDisabled(t){this._isDisabled!==t&&(this._isDisabled=t,this._isDisabled&&this.disconnectFromAll())}_isSingularConnection(){return this.connectionType===0}setValue(t,e){e._getConnectionValue(this)!==t&&(e._setConnectionValue(this,t),this.onValueChangedObservable.notifyObservers(t))}resetToDefaultValue(t){t._setConnectionValue(this,this._defaultValue)}connectTo(t){this._isDisabled||super.connectTo(t)}_getValueOrDefault(t){const e=t._getConnectionValue(this)??this._defaultValue;return this.dataTransformer?this.dataTransformer(e):e}getValue(t){if(this.connectionType===1){t._notifyExecuteNode(this._ownerBlock),this._ownerBlock._updateOutputs(t);const o=this._getValueOrDefault(t);return this._lastValue=o,this.richType.typeTransformer?this.richType.typeTransformer(o):o}const e=this.isConnected()?this._connectedPoint[0].getValue(t):this._getValueOrDefault(t);return this._lastValue=e,this.richType.typeTransformer?this.richType.typeTransformer(e):e}_getLastValue(){return this._lastValue}getClassName(){return"FlowGraphDataConnection"}serialize(t={}){super.serialize(t),t.richType={},this.richType.serialize(t.richType),t.optional=this._optional,tt("defaultValue",this._defaultValue,t)}}ht("FlowGraphDataConnection",Y);class $t{constructor(t){var e;this.config=t,this.uniqueId=D(),this.name=((e=this.config)==null?void 0:e.name)??this.getClassName(),this.dataInputs=[],this.dataOutputs=[]}_updateOutputs(t){}registerDataInput(t,e,o){const n=new Y(t,0,this,e,o);return this.dataInputs.push(n),n}registerDataOutput(t,e,o){const n=new Y(t,1,this,e,o);return this.dataOutputs.push(n),n}getDataInput(t){return this.dataInputs.find(e=>e.name===t)}getDataOutput(t){return this.dataOutputs.find(e=>e.name===t)}serialize(t={},e=tt){if(t.uniqueId=this.uniqueId,t.config={},this.config){const o=this.config,n=Object.keys(o);for(const s of n)e(s,o[s],t.config)}t.dataInputs=[],t.dataOutputs=[],t.className=this.getClassName();for(const o of this.dataInputs){const n={};o.serialize(n),t.dataInputs.push(n)}for(const o of this.dataOutputs){const n={};o.serialize(n),t.dataOutputs.push(n)}}deserialize(t){}_log(t,e,o){var n;(n=t.logger)==null||n.addLogItem({action:e,payload:o,className:this.getClassName(),uniqueId:this.uniqueId})}getClassName(){return"FlowGraphBlock"}}class z extends wt{constructor(){super(...arguments),this.priority=0}_isSingularConnection(){return!1}connectTo(t){super.connectTo(t),this._connectedPoint.sort((e,o)=>o.priority-e.priority)}_activateSignal(t){var e;if((e=t.logger)==null||e.addLogItem({action:"ActivateSignal",className:this._ownerBlock.getClassName(),uniqueId:this._ownerBlock.uniqueId,payload:{connectionType:this.connectionType,name:this.name}}),this.connectionType===0)t._notifyExecuteNode(this._ownerBlock),this._ownerBlock._execute(t,this),t._increaseExecutionId();else for(const o of this._connectedPoint)o._activateSignal(t)}}ht("FlowGraphSignalConnection",z);class J extends $t{constructor(t){super(t),this.priority=0,this.signalInputs=[],this.signalOutputs=[],this.in=this._registerSignalInput("in"),this.error=this._registerSignalOutput("error")}_registerSignalInput(t){const e=new z(t,0,this);return this.signalInputs.push(e),e}_registerSignalOutput(t){const e=new z(t,1,this);return this.signalOutputs.push(e),e}_unregisterSignalInput(t){const e=this.signalInputs.findIndex(o=>o.name===t);e!==-1&&(this.signalInputs[e].dispose(),this.signalInputs.splice(e,1))}_unregisterSignalOutput(t){const e=this.signalOutputs.findIndex(o=>o.name===t);e!==-1&&(this.signalOutputs[e].dispose(),this.signalOutputs.splice(e,1))}_reportError(t,e){this.error.payload=typeof e=="string"?new Error(e):e,this.error._activateSignal(t)}getSignalInput(t){return this.signalInputs.find(e=>e.name===t)}getSignalOutput(t){return this.signalOutputs.find(e=>e.name===t)}serialize(t={}){super.serialize(t),t.signalInputs=[],t.signalOutputs=[];for(const e of this.signalInputs){const o={};e.serialize(o),t.signalInputs.push(o)}for(const e of this.signalOutputs){const o={};e.serialize(o),t.signalOutputs.push(o)}}deserialize(t){for(let e=0;e<t.signalInputs.length;e++){const o=this.getSignalInput(t.signalInputs[e].name);if(o)o.deserialize(t.signalInputs[e]);else throw new Error("Could not find signal input with name "+t.signalInputs[e].name+" in block "+t.className)}for(let e=0;e<t.signalOutputs.length;e++){const o=this.getSignalOutput(t.signalOutputs[e].name);if(o)o.deserialize(t.signalOutputs[e]);else throw new Error("Could not find signal output with name "+t.signalOutputs[e].name+" in block "+t.className)}}getClassName(){return"FlowGraphExecutionBlock"}}class Kt{constructor(t){this.onEventTriggeredObservable=new U,this.sceneReadyTriggered=!1,this._pointerUnderMeshState={},this._startingTime=0,this._scene=t,this._initialize()}_initialize(){this._sceneReadyObserver=this._scene.onReadyObservable.add(()=>{this.sceneReadyTriggered||(this.onEventTriggeredObservable.notifyObservers({type:"SceneReady"}),this.sceneReadyTriggered=!0)}),this._sceneDisposeObserver=this._scene.onDisposeObservable.add(()=>{this.onEventTriggeredObservable.notifyObservers({type:"SceneDispose"})}),this._sceneOnBeforeRenderObserver=this._scene.onBeforeRenderObservable.add(()=>{const t=this._scene.getEngine().getDeltaTime()/1e3;this.onEventTriggeredObservable.notifyObservers({type:"SceneBeforeRender",payload:{timeSinceStart:this._startingTime,deltaTime:t}}),this._startingTime+=t}),this._meshPickedObserver=this._scene.onPointerObservable.add(t=>{this.onEventTriggeredObservable.notifyObservers({type:"MeshPick",payload:t})},rt.POINTERPICK),this._meshUnderPointerObserver=this._scene.onMeshUnderPointerUpdatedObservable.add(t=>{const e=t.pointerId,o=t.mesh,n=this._pointerUnderMeshState[e];!n&&o?this.onEventTriggeredObservable.notifyObservers({type:"PointerOver",payload:{pointerId:e,mesh:o}}):n&&!o?this.onEventTriggeredObservable.notifyObservers({type:"PointerOut",payload:{pointerId:e,mesh:n}}):n&&o&&n!==o&&(this.onEventTriggeredObservable.notifyObservers({type:"PointerOut",payload:{pointerId:e,mesh:n,over:o}}),this.onEventTriggeredObservable.notifyObservers({type:"PointerOver",payload:{pointerId:e,mesh:o,out:n}})),this._pointerUnderMeshState[e]=o},rt.POINTERMOVE)}dispose(){var t,e,o,n,s;(t=this._sceneDisposeObserver)==null||t.remove(),(e=this._sceneReadyObserver)==null||e.remove(),(o=this._sceneOnBeforeRenderObserver)==null||o.remove(),(n=this._meshPickedObserver)==null||n.remove(),(s=this._meshUnderPointerObserver)==null||s.remove(),this.onEventTriggeredObservable.clear()}}function dt(a,t){return!!(a.parent&&(a.parent===t||dt(a.parent,t)))}function de(a){if(a.getClassName)return a.getClassName()}function fe(a,t){return a===t&&(a==="Vector2"||a==="Vector3"||a==="Vector4"||a==="Quaternion")}function ye(a,t){return a===t&&(a==="Matrix"||a==="Matrix2D"||a==="Matrix3D")}function ge(a,t){return a==="FlowGraphInteger"&&t==="FlowGraphInteger"}function me(a,t){const e=typeof a=="number"||typeof(a==null?void 0:a.value)=="number";return e&&!t?!isNaN(Wt(a)):e}function Wt(a){return typeof a=="number"?a:a.value}var lt;(function(a){a[a.Stopped=0]="Stopped",a[a.Started=1]="Started"})(lt||(lt={}));class Ut{get state(){return this._state}set state(t){this._state=t,this.onStateChangedObservable.notifyObservers(t)}constructor(t){this.onStateChangedObservable=new U,this._eventBlocks={SceneReady:[],SceneDispose:[],SceneBeforeRender:[],MeshPick:[],PointerDown:[],PointerUp:[],PointerMove:[],PointerOver:[],PointerOut:[],SceneAfterRender:[],NoTrigger:[]},this._executionContexts=[],this._state=0,this._scene=t.scene,this._sceneEventCoordinator=new Kt(this._scene),this._coordinator=t.coordinator,this._eventObserver=this._sceneEventCoordinator.onEventTriggeredObservable.add(e=>{for(const o of this._executionContexts){const n=this._getContextualOrder(e.type,o);for(const s of n)if(!s._executeEvent(o,e.payload))break}switch(e.type){case"SceneReady":this._sceneEventCoordinator.sceneReadyTriggered=!0;break;case"SceneBeforeRender":for(const o of this._executionContexts)o._notifyOnTick(e.payload);break;case"SceneDispose":this.dispose();break}})}createContext(){const t=new _t({scene:this._scene,coordinator:this._coordinator});return this._executionContexts.push(t),t}getContext(t){return this._executionContexts[t]}addEventBlock(t){if((t.type==="PointerOver"||t.type==="PointerOut")&&(this._scene.constantlyUpdateMeshUnderPointer=!0),t.type!=="NoTrigger"&&this._eventBlocks[t.type].push(t),this.state===1)for(const e of this._executionContexts)t._startPendingTasks(e);else this.onStateChangedObservable.addOnce(e=>{if(e===1)for(const o of this._executionContexts)t._startPendingTasks(o)})}start(){this.state!==1&&(this._executionContexts.length===0&&this.createContext(),this.onStateChangedObservable.add(t=>{t===1&&(this._startPendingEvents(),this._scene.isReady(!0)&&this._sceneEventCoordinator.onEventTriggeredObservable.notifyObservers({type:"SceneReady"}))}),this.state=1)}_startPendingEvents(){for(const t of this._executionContexts)for(const e in this._eventBlocks){const o=this._getContextualOrder(e,t);for(const n of o)n._startPendingTasks(t)}}_getContextualOrder(t,e){const o=this._eventBlocks[t].sort((n,s)=>s.initPriority-n.initPriority);if(t==="MeshPick"){const n=[];for(const s of o){const i=s.asset.getValue(e);let c=0;for(;c<o.length;c++){const u=o[c].asset.getValue(e);if(i&&u&&dt(i,u))break}n.splice(c,0,s)}return n}return o}dispose(){var t;if(this.state!==0){this.state=0;for(const e of this._executionContexts)e._clearPendingBlocks();this._executionContexts.length=0;for(const e in this._eventBlocks)this._eventBlocks[e].length=0;(t=this._eventObserver)==null||t.remove(),this._sceneEventCoordinator.dispose()}}visitAllBlocks(t){const e=[],o=new Set;for(const n in this._eventBlocks)for(const s of this._eventBlocks[n])e.push(s),o.add(s.uniqueId);for(;e.length>0;){const n=e.pop();t(n);for(const s of n.dataInputs)for(const i of s._connectedPoint)o.has(i._ownerBlock.uniqueId)||(e.push(i._ownerBlock),o.add(i._ownerBlock.uniqueId));if(n instanceof J)for(const s of n.signalOutputs)for(const i of s._connectedPoint)o.has(i._ownerBlock.uniqueId)||(e.push(i._ownerBlock),o.add(i._ownerBlock.uniqueId))}}serialize(t={},e){t.allBlocks=[],this.visitAllBlocks(o=>{const n={};o.serialize(n),t.allBlocks.push(n)}),t.executionContexts=[];for(const o of this._executionContexts){const n={};o.serialize(n,e),t.executionContexts.push(n)}}}class E{constructor(t){this.config=t,this.dispatchEventsSynchronously=!0,this._flowGraphs=[],this._customEventsMap=new Map,this._eventExecutionCounter=new Map,this._executeOnNextFrame=[],this._eventUniqueId=0,this._disposeObserver=this.config.scene.onDisposeObservable.add(()=>{this.dispose()}),this._onBeforeRenderObserver=this.config.scene.onBeforeRenderObservable.add(()=>{this._eventExecutionCounter.clear();const o=this._executeOnNextFrame.slice(0);if(o.length)for(const n of o){this.notifyCustomEvent(n.id,n.data,!1);const s=this._executeOnNextFrame.findIndex(i=>i.uniqueId===n.uniqueId);s!==-1&&this._executeOnNextFrame.splice(s,1)}});let e=E.SceneCoordinators.get(this.config.scene);e||(e=[],E.SceneCoordinators.set(this.config.scene,e)),e.push(this)}createGraph(){const t=new Ut({scene:this.config.scene,coordinator:this});return this._flowGraphs.push(t),t}removeGraph(t){const e=this._flowGraphs.indexOf(t);e!==-1&&(t.dispose(),this._flowGraphs.splice(e,1))}start(){for(const t of this._flowGraphs)t.start()}dispose(){var o,n;for(const s of this._flowGraphs)s.dispose();this._flowGraphs.length=0,(o=this._disposeObserver)==null||o.remove(),(n=this._onBeforeRenderObserver)==null||n.remove();const t=E.SceneCoordinators.get(this.config.scene)??[],e=t.indexOf(this);e!==-1&&t.splice(e,1)}serialize(t,e){t._flowGraphs=[];for(const o of this._flowGraphs){const n={};o.serialize(n,e),t._flowGraphs.push(n)}t.dispatchEventsSynchronously=this.dispatchEventsSynchronously}get flowGraphs(){return this._flowGraphs}getCustomEventObservable(t){let e=this._customEventsMap.get(t);return e||(e=new U,this._customEventsMap.set(t,e)),e}notifyCustomEvent(t,e,o=!this.dispatchEventsSynchronously){if(o){this._executeOnNextFrame.push({id:t,data:e,uniqueId:this._eventUniqueId++});return}if(this._eventExecutionCounter.has(t)){const s=this._eventExecutionCounter.get(t);if(this._eventExecutionCounter.set(t,s+1),s>=E.MaxEventTypeExecutionPerFrame){s===E.MaxEventTypeExecutionPerFrame&&w.Warn(`FlowGraphCoordinator: Too many executions of event "${t}".`);return}}else this._eventExecutionCounter.set(t,1);const n=this._customEventsMap.get(t);n&&n.notifyObservers(e)}}E.MaxEventsPerType=30;E.MaxEventTypeExecutionPerFrame=30;E.SceneCoordinators=new Map;const j={};function Qt(a,t,e){j[`${a}/${t}`]=e}function Ht(a){switch(a){case"FlowGraphPlayAnimationBlock":return async()=>(await r(async()=>{const{FlowGraphPlayAnimationBlock:t}=await import("./flowGraphPlayAnimationBlock-B9FP0RfS.js");return{FlowGraphPlayAnimationBlock:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]))).FlowGraphPlayAnimationBlock;case"FlowGraphStopAnimationBlock":return async()=>(await r(async()=>{const{FlowGraphStopAnimationBlock:t}=await import("./flowGraphStopAnimationBlock-ChXcK4cb.js");return{FlowGraphStopAnimationBlock:t}},__vite__mapDeps([32,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphStopAnimationBlock;case"FlowGraphPauseAnimationBlock":return async()=>(await r(async()=>{const{FlowGraphPauseAnimationBlock:t}=await import("./flowGraphPauseAnimationBlock-DAoY0eJc.js");return{FlowGraphPauseAnimationBlock:t}},__vite__mapDeps([33,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphPauseAnimationBlock;case"FlowGraphInterpolationBlock":return async()=>(await r(async()=>{const{FlowGraphInterpolationBlock:t}=await import("./flowGraphInterpolationBlock-CYcMKCGO.js");return{FlowGraphInterpolationBlock:t}},__vite__mapDeps([34,1,2,3,4,5,7,8,9,10,23,24,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,29,30,31]))).FlowGraphInterpolationBlock;case"FlowGraphSceneReadyEventBlock":return async()=>(await r(async()=>{const{FlowGraphSceneReadyEventBlock:t}=await import("./flowGraphSceneReadyEventBlock-Crn-rAIL.js");return{FlowGraphSceneReadyEventBlock:t}},__vite__mapDeps([35,4,23,24,3,2,9,5,1,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSceneReadyEventBlock;case"FlowGraphSceneTickEventBlock":return async()=>(await r(async()=>{const{FlowGraphSceneTickEventBlock:t}=await import("./flowGraphSceneTickEventBlock-gf3YDJRe.js");return{FlowGraphSceneTickEventBlock:t}},__vite__mapDeps([36,4,1,2,3,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSceneTickEventBlock;case"FlowGraphSendCustomEventBlock":return async()=>(await r(async()=>{const{FlowGraphSendCustomEventBlock:t}=await import("./flowGraphSendCustomEventBlock-Ba8XUM8G.js");return{FlowGraphSendCustomEventBlock:t}},__vite__mapDeps([37,4,23,24,3,2,9,5,1,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSendCustomEventBlock;case"FlowGraphReceiveCustomEventBlock":return async()=>(await r(async()=>{const{FlowGraphReceiveCustomEventBlock:t}=await import("./flowGraphReceiveCustomEventBlock-CId8KX4K.js");return{FlowGraphReceiveCustomEventBlock:t}},__vite__mapDeps([38,13,3,4,9,2,5,23,24,1,21,25,26,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphReceiveCustomEventBlock;case"FlowGraphMeshPickEventBlock":return async()=>(await r(async()=>{const{FlowGraphMeshPickEventBlock:t}=await import("./flowGraphMeshPickEventBlock-WsLHiXtY.js");return{FlowGraphMeshPickEventBlock:t}},__vite__mapDeps([39,21,3,4,1,2,5,23,24,9,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphMeshPickEventBlock;case"FlowGraphEBlock":return async()=>(await r(async()=>{const{FlowGraphEBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphEBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphEBlock;case"FlowGraphPIBlock":return async()=>(await r(async()=>{const{FlowGraphPiBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphPiBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphPiBlock;case"FlowGraphInfBlock":return async()=>(await r(async()=>{const{FlowGraphInfBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphInfBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphInfBlock;case"FlowGraphNaNBlock":return async()=>(await r(async()=>{const{FlowGraphNaNBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphNaNBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphNaNBlock;case"FlowGraphRandomBlock":return async()=>(await r(async()=>{const{FlowGraphRandomBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphRandomBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphRandomBlock;case"FlowGraphAddBlock":return async()=>(await r(async()=>{const{FlowGraphAddBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphAddBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAddBlock;case"FlowGraphSubtractBlock":return async()=>(await r(async()=>{const{FlowGraphSubtractBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphSubtractBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSubtractBlock;case"FlowGraphMultiplyBlock":return async()=>(await r(async()=>{const{FlowGraphMultiplyBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphMultiplyBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphMultiplyBlock;case"FlowGraphDivideBlock":return async()=>(await r(async()=>{const{FlowGraphDivideBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphDivideBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphDivideBlock;case"FlowGraphAbsBlock":return async()=>(await r(async()=>{const{FlowGraphAbsBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphAbsBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAbsBlock;case"FlowGraphSignBlock":return async()=>(await r(async()=>{const{FlowGraphSignBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphSignBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSignBlock;case"FlowGraphTruncBlock":return async()=>(await r(async()=>{const{FlowGraphTruncBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphTruncBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphTruncBlock;case"FlowGraphFloorBlock":return async()=>(await r(async()=>{const{FlowGraphFloorBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphFloorBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphFloorBlock;case"FlowGraphCeilBlock":return async()=>(await r(async()=>{const{FlowGraphCeilBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphCeilBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCeilBlock;case"FlowGraphRoundBlock":return async()=>(await r(async()=>{const{FlowGraphRoundBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphRoundBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphRoundBlock;case"FlowGraphFractBlock":return async()=>(await r(async()=>{const{FlowGraphFractionBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphFractionBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphFractionBlock;case"FlowGraphNegationBlock":return async()=>(await r(async()=>{const{FlowGraphNegationBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphNegationBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphNegationBlock;case"FlowGraphModuloBlock":return async()=>(await r(async()=>{const{FlowGraphModuloBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphModuloBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphModuloBlock;case"FlowGraphMinBlock":return async()=>(await r(async()=>{const{FlowGraphMinBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphMinBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphMinBlock;case"FlowGraphMaxBlock":return async()=>(await r(async()=>{const{FlowGraphMaxBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphMaxBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphMaxBlock;case"FlowGraphClampBlock":return async()=>(await r(async()=>{const{FlowGraphClampBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphClampBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphClampBlock;case"FlowGraphSaturateBlock":return async()=>(await r(async()=>{const{FlowGraphSaturateBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphSaturateBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSaturateBlock;case"FlowGraphMathInterpolationBlock":return async()=>(await r(async()=>{const{FlowGraphMathInterpolationBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphMathInterpolationBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphMathInterpolationBlock;case"FlowGraphEqualityBlock":return async()=>(await r(async()=>{const{FlowGraphEqualityBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphEqualityBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphEqualityBlock;case"FlowGraphLessThanBlock":return async()=>(await r(async()=>{const{FlowGraphLessThanBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphLessThanBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphLessThanBlock;case"FlowGraphLessThanOrEqualBlock":return async()=>(await r(async()=>{const{FlowGraphLessThanOrEqualBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphLessThanOrEqualBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphLessThanOrEqualBlock;case"FlowGraphGreaterThanBlock":return async()=>(await r(async()=>{const{FlowGraphGreaterThanBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphGreaterThanBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphGreaterThanBlock;case"FlowGraphGreaterThanOrEqualBlock":return async()=>(await r(async()=>{const{FlowGraphGreaterThanOrEqualBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphGreaterThanOrEqualBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphGreaterThanOrEqualBlock;case"FlowGraphIsNaNBlock":return async()=>(await r(async()=>{const{FlowGraphIsNanBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphIsNanBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphIsNanBlock;case"FlowGraphIsInfBlock":return async()=>(await r(async()=>{const{FlowGraphIsInfinityBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphIsInfinityBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphIsInfinityBlock;case"FlowGraphDegToRadBlock":return async()=>(await r(async()=>{const{FlowGraphDegToRadBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphDegToRadBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphDegToRadBlock;case"FlowGraphRadToDegBlock":return async()=>(await r(async()=>{const{FlowGraphRadToDegBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphRadToDegBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphRadToDegBlock;case"FlowGraphSinBlock":return async()=>(await r(async()=>{const{FlowGraphSinBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphSinBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSinBlock;case"FlowGraphCosBlock":return async()=>(await r(async()=>{const{FlowGraphCosBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphCosBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCosBlock;case"FlowGraphTanBlock":return async()=>(await r(async()=>{const{FlowGraphTanBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphTanBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphTanBlock;case"FlowGraphASinBlock":return async()=>(await r(async()=>{const{FlowGraphAsinBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphAsinBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAsinBlock;case"FlowGraphACosBlock":return async()=>(await r(async()=>{const{FlowGraphAcosBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphAcosBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAcosBlock;case"FlowGraphATanBlock":return async()=>(await r(async()=>{const{FlowGraphAtanBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphAtanBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAtanBlock;case"FlowGraphATan2Block":return async()=>(await r(async()=>{const{FlowGraphAtan2Block:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphAtan2Block:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAtan2Block;case"FlowGraphSinhBlock":return async()=>(await r(async()=>{const{FlowGraphSinhBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphSinhBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSinhBlock;case"FlowGraphCoshBlock":return async()=>(await r(async()=>{const{FlowGraphCoshBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphCoshBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCoshBlock;case"FlowGraphTanhBlock":return async()=>(await r(async()=>{const{FlowGraphTanhBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphTanhBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphTanhBlock;case"FlowGraphASinhBlock":return async()=>(await r(async()=>{const{FlowGraphAsinhBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphAsinhBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAsinhBlock;case"FlowGraphACoshBlock":return async()=>(await r(async()=>{const{FlowGraphAcoshBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphAcoshBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAcoshBlock;case"FlowGraphATanhBlock":return async()=>(await r(async()=>{const{FlowGraphAtanhBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphAtanhBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAtanhBlock;case"FlowGraphExponentialBlock":return async()=>(await r(async()=>{const{FlowGraphExpBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphExpBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphExpBlock;case"FlowGraphLogBlock":return async()=>(await r(async()=>{const{FlowGraphLogBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphLogBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphLogBlock;case"FlowGraphLog2Block":return async()=>(await r(async()=>{const{FlowGraphLog2Block:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphLog2Block:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphLog2Block;case"FlowGraphLog10Block":return async()=>(await r(async()=>{const{FlowGraphLog10Block:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphLog10Block:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphLog10Block;case"FlowGraphSquareRootBlock":return async()=>(await r(async()=>{const{FlowGraphSquareRootBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphSquareRootBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSquareRootBlock;case"FlowGraphPowerBlock":return async()=>(await r(async()=>{const{FlowGraphPowerBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphPowerBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphPowerBlock;case"FlowGraphCubeRootBlock":return async()=>(await r(async()=>{const{FlowGraphCubeRootBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphCubeRootBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCubeRootBlock;case"FlowGraphBitwiseAndBlock":return async()=>(await r(async()=>{const{FlowGraphBitwiseAndBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphBitwiseAndBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphBitwiseAndBlock;case"FlowGraphBitwiseOrBlock":return async()=>(await r(async()=>{const{FlowGraphBitwiseOrBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphBitwiseOrBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphBitwiseOrBlock;case"FlowGraphBitwiseNotBlock":return async()=>(await r(async()=>{const{FlowGraphBitwiseNotBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphBitwiseNotBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphBitwiseNotBlock;case"FlowGraphBitwiseXorBlock":return async()=>(await r(async()=>{const{FlowGraphBitwiseXorBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphBitwiseXorBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphBitwiseXorBlock;case"FlowGraphBitwiseLeftShiftBlock":return async()=>(await r(async()=>{const{FlowGraphBitwiseLeftShiftBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphBitwiseLeftShiftBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphBitwiseLeftShiftBlock;case"FlowGraphBitwiseRightShiftBlock":return async()=>(await r(async()=>{const{FlowGraphBitwiseRightShiftBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphBitwiseRightShiftBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphBitwiseRightShiftBlock;case"FlowGraphLengthBlock":return async()=>(await r(async()=>{const{FlowGraphLengthBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphLengthBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphLengthBlock;case"FlowGraphNormalizeBlock":return async()=>(await r(async()=>{const{FlowGraphNormalizeBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphNormalizeBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphNormalizeBlock;case"FlowGraphDotBlock":return async()=>(await r(async()=>{const{FlowGraphDotBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphDotBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphDotBlock;case"FlowGraphCrossBlock":return async()=>(await r(async()=>{const{FlowGraphCrossBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphCrossBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCrossBlock;case"FlowGraphRotate2DBlock":return async()=>(await r(async()=>{const{FlowGraphRotate2DBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphRotate2DBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphRotate2DBlock;case"FlowGraphRotate3DBlock":return async()=>(await r(async()=>{const{FlowGraphRotate3DBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphRotate3DBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphRotate3DBlock;case"FlowGraphTransposeBlock":return async()=>(await r(async()=>{const{FlowGraphTransposeBlock:t}=await import("./flowGraphMatrixMathBlocks-Dg7VLPFP.js");return{FlowGraphTransposeBlock:t}},__vite__mapDeps([45,1,2,3,4,5,43,42,41,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphTransposeBlock;case"FlowGraphDeterminantBlock":return async()=>(await r(async()=>{const{FlowGraphDeterminantBlock:t}=await import("./flowGraphMatrixMathBlocks-Dg7VLPFP.js");return{FlowGraphDeterminantBlock:t}},__vite__mapDeps([45,1,2,3,4,5,43,42,41,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphDeterminantBlock;case"FlowGraphInvertMatrixBlock":return async()=>(await r(async()=>{const{FlowGraphInvertMatrixBlock:t}=await import("./flowGraphMatrixMathBlocks-Dg7VLPFP.js");return{FlowGraphInvertMatrixBlock:t}},__vite__mapDeps([45,1,2,3,4,5,43,42,41,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphInvertMatrixBlock;case"FlowGraphMatrixMultiplicationBlock":return async()=>(await r(async()=>{const{FlowGraphMatrixMultiplicationBlock:t}=await import("./flowGraphMatrixMathBlocks-Dg7VLPFP.js");return{FlowGraphMatrixMultiplicationBlock:t}},__vite__mapDeps([45,1,2,3,4,5,43,42,41,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphMatrixMultiplicationBlock;case"FlowGraphBranchBlock":return async()=>(await r(async()=>{const{FlowGraphBranchBlock:t}=await import("./flowGraphBranchBlock-CPQ1Lj8X.js");return{FlowGraphBranchBlock:t}},__vite__mapDeps([46,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphBranchBlock;case"FlowGraphSetDelayBlock":return async()=>(await r(async()=>{const{FlowGraphSetDelayBlock:t}=await import("./flowGraphSetDelayBlock-BA13Fleb.js");return{FlowGraphSetDelayBlock:t}},__vite__mapDeps([47,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSetDelayBlock;case"FlowGraphCancelDelayBlock":return async()=>(await r(async()=>{const{FlowGraphCancelDelayBlock:t}=await import("./flowGraphCancelDelayBlock-CiPuCgGz.js");return{FlowGraphCancelDelayBlock:t}},__vite__mapDeps([48,4,1,2,3,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCancelDelayBlock;case"FlowGraphCallCounterBlock":return async()=>(await r(async()=>{const{FlowGraphCallCounterBlock:t}=await import("./flowGraphCounterBlock-OjaFZjW5.js");return{FlowGraphCallCounterBlock:t}},__vite__mapDeps([49,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCallCounterBlock;case"FlowGraphDebounceBlock":return async()=>(await r(async()=>{const{FlowGraphDebounceBlock:t}=await import("./flowGraphDebounceBlock-fxe8WoxT.js");return{FlowGraphDebounceBlock:t}},__vite__mapDeps([50,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphDebounceBlock;case"FlowGraphThrottleBlock":return async()=>(await r(async()=>{const{FlowGraphThrottleBlock:t}=await import("./flowGraphThrottleBlock-B-yO7rgE.js");return{FlowGraphThrottleBlock:t}},__vite__mapDeps([51,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphThrottleBlock;case"FlowGraphDoNBlock":return async()=>(await r(async()=>{const{FlowGraphDoNBlock:t}=await import("./flowGraphDoNBlock-C4vVyovK.js");return{FlowGraphDoNBlock:t}},__vite__mapDeps([52,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphDoNBlock;case"FlowGraphFlipFlopBlock":return async()=>(await r(async()=>{const{FlowGraphFlipFlopBlock:t}=await import("./flowGraphFlipFlopBlock-BSjrwcqq.js");return{FlowGraphFlipFlopBlock:t}},__vite__mapDeps([53,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphFlipFlopBlock;case"FlowGraphForLoopBlock":return async()=>(await r(async()=>{const{FlowGraphForLoopBlock:t}=await import("./flowGraphForLoopBlock-jI9z_K5X.js");return{FlowGraphForLoopBlock:t}},__vite__mapDeps([54,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphForLoopBlock;case"FlowGraphMultiGateBlock":return async()=>(await r(async()=>{const{FlowGraphMultiGateBlock:t}=await import("./flowGraphMultiGateBlock-Cy-tdSZ3.js");return{FlowGraphMultiGateBlock:t}},__vite__mapDeps([55,4,1,2,3,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphMultiGateBlock;case"FlowGraphSequenceBlock":return async()=>(await r(async()=>{const{FlowGraphSequenceBlock:t}=await import("./flowGraphSequenceBlock-Bcye5mDB.js");return{FlowGraphSequenceBlock:t}},__vite__mapDeps([56,4,23,24,3,2,9,5,1,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSequenceBlock;case"FlowGraphSwitchBlock":return async()=>(await r(async()=>{const{FlowGraphSwitchBlock:t}=await import("./flowGraphSwitchBlock-CfuObCnO.js");return{FlowGraphSwitchBlock:t}},__vite__mapDeps([57,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSwitchBlock;case"FlowGraphWaitAllBlock":return async()=>(await r(async()=>{const{FlowGraphWaitAllBlock:t}=await import("./flowGraphWaitAllBlock-VXxeVnO_.js");return{FlowGraphWaitAllBlock:t}},__vite__mapDeps([58,4,1,2,3,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphWaitAllBlock;case"FlowGraphWhileLoopBlock":return async()=>(await r(async()=>{const{FlowGraphWhileLoopBlock:t}=await import("./flowGraphWhileLoopBlock-BYmEfSWz.js");return{FlowGraphWhileLoopBlock:t}},__vite__mapDeps([59,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphWhileLoopBlock;case"FlowGraphConsoleLogBlock":return async()=>(await r(async()=>{const{FlowGraphConsoleLogBlock:t}=await import("./flowGraphConsoleLogBlock-Cz7IRQyV.js");return{FlowGraphConsoleLogBlock:t}},__vite__mapDeps([60,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphConsoleLogBlock;case"FlowGraphConditionalBlock":return async()=>(await r(async()=>{const{FlowGraphConditionalDataBlock:t}=await import("./flowGraphConditionalDataBlock-Btzamqcx.js");return{FlowGraphConditionalDataBlock:t}},__vite__mapDeps([61,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphConditionalDataBlock;case"FlowGraphConstantBlock":return async()=>(await r(async()=>{const{FlowGraphConstantBlock:t}=await import("./flowGraphConstantBlock-BV1ij11S.js");return{FlowGraphConstantBlock:t}},__vite__mapDeps([62,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphConstantBlock;case"FlowGraphTransformCoordinatesSystemBlock":return async()=>(await r(async()=>{const{FlowGraphTransformCoordinatesSystemBlock:t}=await import("./flowGraphTransformCoordinatesSystemBlock-D3zEJ4A-.js");return{FlowGraphTransformCoordinatesSystemBlock:t}},__vite__mapDeps([63,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphTransformCoordinatesSystemBlock;case"FlowGraphGetAssetBlock":return async()=>(await r(async()=>{const{FlowGraphGetAssetBlock:t}=await import("./flowGraphGetAssetBlock-BeMIiO3t.js");return{FlowGraphGetAssetBlock:t}},__vite__mapDeps([64,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphGetAssetBlock;case"FlowGraphGetPropertyBlock":return async()=>(await r(async()=>{const{FlowGraphGetPropertyBlock:t}=await import("./flowGraphGetPropertyBlock-CAOmAIk8.js");return{FlowGraphGetPropertyBlock:t}},__vite__mapDeps([65,1,2,3,4,5,42,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphGetPropertyBlock;case"FlowGraphSetPropertyBlock":return async()=>(await r(async()=>{const{FlowGraphSetPropertyBlock:t}=await import("./flowGraphSetPropertyBlock-DxJBj-a9.js");return{FlowGraphSetPropertyBlock:t}},__vite__mapDeps([66,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSetPropertyBlock;case"FlowGraphGetVariableBlock":return async()=>(await r(async()=>{const{FlowGraphGetVariableBlock:t}=await import("./flowGraphGetVariableBlock-BaRkHNJ_.js");return{FlowGraphGetVariableBlock:t}},__vite__mapDeps([67,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphGetVariableBlock;case"FlowGraphSetVariableBlock":return async()=>(await r(async()=>{const{FlowGraphSetVariableBlock:t}=await import("./flowGraphSetVariableBlock-BG0Kfa6g.js");return{FlowGraphSetVariableBlock:t}},__vite__mapDeps([68,4,1,2,3,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphSetVariableBlock;case"FlowGraphJsonPointerParserBlock":return async()=>(await r(async()=>{const{FlowGraphJsonPointerParserBlock:t}=await import("./flowGraphJsonPointerParserBlock-CZ93bSRG.js");return{FlowGraphJsonPointerParserBlock:t}},__vite__mapDeps([69,1,2,3,4,5,42,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphJsonPointerParserBlock;case"FlowGraphLeadingZerosBlock":return async()=>(await r(async()=>{const{FlowGraphLeadingZerosBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphLeadingZerosBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphLeadingZerosBlock;case"FlowGraphTrailingZerosBlock":return async()=>(await r(async()=>{const{FlowGraphTrailingZerosBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphTrailingZerosBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphTrailingZerosBlock;case"FlowGraphOneBitsCounterBlock":return async()=>(await r(async()=>{const{FlowGraphOneBitsCounterBlock:t}=await import("./flowGraphMathBlocks-HeZhspxf.js");return{FlowGraphOneBitsCounterBlock:t}},__vite__mapDeps([40,4,1,2,3,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphOneBitsCounterBlock;case"FlowGraphCombineVector2Block":return async()=>(await r(async()=>{const{FlowGraphCombineVector2Block:t}=await import("./flowGraphMathCombineExtractBlocks-Dg02KNQM.js");return{FlowGraphCombineVector2Block:t}},__vite__mapDeps([70,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCombineVector2Block;case"FlowGraphCombineVector3Block":return async()=>(await r(async()=>{const{FlowGraphCombineVector3Block:t}=await import("./flowGraphMathCombineExtractBlocks-Dg02KNQM.js");return{FlowGraphCombineVector3Block:t}},__vite__mapDeps([70,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCombineVector3Block;case"FlowGraphCombineVector4Block":return async()=>(await r(async()=>{const{FlowGraphCombineVector4Block:t}=await import("./flowGraphMathCombineExtractBlocks-Dg02KNQM.js");return{FlowGraphCombineVector4Block:t}},__vite__mapDeps([70,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCombineVector4Block;case"FlowGraphCombineMatrixBlock":return async()=>(await r(async()=>{const{FlowGraphCombineMatrixBlock:t}=await import("./flowGraphMathCombineExtractBlocks-Dg02KNQM.js");return{FlowGraphCombineMatrixBlock:t}},__vite__mapDeps([70,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCombineMatrixBlock;case"FlowGraphExtractVector2Block":return async()=>(await r(async()=>{const{FlowGraphExtractVector2Block:t}=await import("./flowGraphMathCombineExtractBlocks-Dg02KNQM.js");return{FlowGraphExtractVector2Block:t}},__vite__mapDeps([70,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphExtractVector2Block;case"FlowGraphExtractVector3Block":return async()=>(await r(async()=>{const{FlowGraphExtractVector3Block:t}=await import("./flowGraphMathCombineExtractBlocks-Dg02KNQM.js");return{FlowGraphExtractVector3Block:t}},__vite__mapDeps([70,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphExtractVector3Block;case"FlowGraphExtractVector4Block":return async()=>(await r(async()=>{const{FlowGraphExtractVector4Block:t}=await import("./flowGraphMathCombineExtractBlocks-Dg02KNQM.js");return{FlowGraphExtractVector4Block:t}},__vite__mapDeps([70,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphExtractVector4Block;case"FlowGraphExtractMatrixBlock":return async()=>(await r(async()=>{const{FlowGraphExtractMatrixBlock:t}=await import("./flowGraphMathCombineExtractBlocks-Dg02KNQM.js");return{FlowGraphExtractMatrixBlock:t}},__vite__mapDeps([70,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphExtractMatrixBlock;case"FlowGraphTransformVectorBlock":return async()=>(await r(async()=>{const{FlowGraphTransformBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphTransformBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphTransformBlock;case"FlowGraphTransformCoordinatesBlock":return async()=>(await r(async()=>{const{FlowGraphTransformCoordinatesBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphTransformCoordinatesBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphTransformCoordinatesBlock;case"FlowGraphConjugateBlock":return async()=>(await r(async()=>{const{FlowGraphConjugateBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphConjugateBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphConjugateBlock;case"FlowGraphAngleBetweenBlock":return async()=>(await r(async()=>{const{FlowGraphAngleBetweenBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphAngleBetweenBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAngleBetweenBlock;case"FlowGraphQuaternionFromAxisAngleBlock":return async()=>(await r(async()=>{const{FlowGraphQuaternionFromAxisAngleBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphQuaternionFromAxisAngleBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphQuaternionFromAxisAngleBlock;case"FlowGraphAxisAngleFromQuaternionBlock":return async()=>(await r(async()=>{const{FlowGraphAxisAngleFromQuaternionBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphAxisAngleFromQuaternionBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphAxisAngleFromQuaternionBlock;case"FlowGraphQuaternionFromDirectionsBlock":return async()=>(await r(async()=>{const{FlowGraphQuaternionFromDirectionsBlock:t}=await import("./flowGraphVectorMathBlocks-BGV5dKz9.js");return{FlowGraphQuaternionFromDirectionsBlock:t}},__vite__mapDeps([44,1,2,3,4,5,41,42,43,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphQuaternionFromDirectionsBlock;case"FlowGraphMatrixDecompose":return async()=>(await r(async()=>{const{FlowGraphMatrixDecomposeBlock:t}=await import("./flowGraphMatrixMathBlocks-Dg7VLPFP.js");return{FlowGraphMatrixDecomposeBlock:t}},__vite__mapDeps([45,1,2,3,4,5,43,42,41,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphMatrixDecomposeBlock;case"FlowGraphMatrixCompose":return async()=>(await r(async()=>{const{FlowGraphMatrixComposeBlock:t}=await import("./flowGraphMatrixMathBlocks-Dg7VLPFP.js");return{FlowGraphMatrixComposeBlock:t}},__vite__mapDeps([45,1,2,3,4,5,43,42,41,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphMatrixComposeBlock;case"FlowGraphBooleanToFloat":return async()=>(await r(async()=>{const{FlowGraphBooleanToFloat:t}=await import("./flowGraphTypeToTypeBlocks-DdLy9OXZ.js");return{FlowGraphBooleanToFloat:t}},__vite__mapDeps([71,43,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphBooleanToFloat;case"FlowGraphBooleanToInt":return async()=>(await r(async()=>{const{FlowGraphBooleanToInt:t}=await import("./flowGraphTypeToTypeBlocks-DdLy9OXZ.js");return{FlowGraphBooleanToInt:t}},__vite__mapDeps([71,43,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphBooleanToInt;case"FlowGraphFloatToBoolean":return async()=>(await r(async()=>{const{FlowGraphFloatToBoolean:t}=await import("./flowGraphTypeToTypeBlocks-DdLy9OXZ.js");return{FlowGraphFloatToBoolean:t}},__vite__mapDeps([71,43,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphFloatToBoolean;case"FlowGraphIntToBoolean":return async()=>(await r(async()=>{const{FlowGraphIntToBoolean:t}=await import("./flowGraphTypeToTypeBlocks-DdLy9OXZ.js");return{FlowGraphIntToBoolean:t}},__vite__mapDeps([71,43,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphIntToBoolean;case"FlowGraphIntToFloat":return async()=>(await r(async()=>{const{FlowGraphIntToFloat:t}=await import("./flowGraphTypeToTypeBlocks-DdLy9OXZ.js");return{FlowGraphIntToFloat:t}},__vite__mapDeps([71,43,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphIntToFloat;case"FlowGraphFloatToInt":return async()=>(await r(async()=>{const{FlowGraphFloatToInt:t}=await import("./flowGraphTypeToTypeBlocks-DdLy9OXZ.js");return{FlowGraphFloatToInt:t}},__vite__mapDeps([71,43,42,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphFloatToInt;case"FlowGraphEasingBlock":return async()=>(await r(async()=>{const{FlowGraphEasingBlock:t}=await import("./flowGraphEasingBlock-C_-3ZhLh.js");return{FlowGraphEasingBlock:t}},__vite__mapDeps([72,73,74,4,3,1,2,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphEasingBlock;case"FlowGraphBezierCurveEasing":return async()=>(await r(async()=>{const{FlowGraphBezierCurveEasingBlock:t}=await import("./flowGraphBezierCurveEasingBlock--1XIKCm2.js");return{FlowGraphBezierCurveEasingBlock:t}},__vite__mapDeps([75,73,74,4,3,1,2,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphBezierCurveEasingBlock;case"FlowGraphPointerOverEventBlock":return async()=>(await r(async()=>{const{FlowGraphPointerOverEventBlock:t}=await import("./flowGraphPointerOverEventBlock-wKWlgMPO.js");return{FlowGraphPointerOverEventBlock:t}},__vite__mapDeps([76,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphPointerOverEventBlock;case"FlowGraphPointerOutEventBlock":return async()=>(await r(async()=>{const{FlowGraphPointerOutEventBlock:t}=await import("./flowGraphPointerOutEventBlock-BpW1yJKn.js");return{FlowGraphPointerOutEventBlock:t}},__vite__mapDeps([77,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphPointerOutEventBlock;case"FlowGraphContextBlock":return async()=>(await r(async()=>{const{FlowGraphContextBlock:t}=await import("./flowGraphContextBlock-DeEwvFEY.js");return{FlowGraphContextBlock:t}},__vite__mapDeps([78,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphContextBlock;case"FlowGraphArrayIndexBlock":return async()=>(await r(async()=>{const{FlowGraphArrayIndexBlock:t}=await import("./flowGraphArrayIndexBlock-3XRt4h8L.js");return{FlowGraphArrayIndexBlock:t}},__vite__mapDeps([79,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphArrayIndexBlock;case"FlowGraphCodeExecutionBlock":return async()=>(await r(async()=>{const{FlowGraphCodeExecutionBlock:t}=await import("./flowGraphCodeExecutionBlock-BpjYYwgf.js");return{FlowGraphCodeExecutionBlock:t}},__vite__mapDeps([80,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphCodeExecutionBlock;case"FlowGraphIndexOfBlock":return async()=>(await r(async()=>{const{FlowGraphIndexOfBlock:t}=await import("./flowGraphIndexOfBlock-D1XW4kc4.js");return{FlowGraphIndexOfBlock:t}},__vite__mapDeps([81,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphIndexOfBlock;case"FlowGraphFunctionReference":return async()=>(await r(async()=>{const{FlowGraphFunctionReferenceBlock:t}=await import("./flowGraphFunctionReferenceBlock-CLhl7P_Q.js");return{FlowGraphFunctionReferenceBlock:t}},__vite__mapDeps([82,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphFunctionReferenceBlock;case"FlowGraphDataSwitchBlock":return async()=>(await r(async()=>{const{FlowGraphDataSwitchBlock:t}=await import("./flowGraphDataSwitchBlock-BUqG5JEg.js");return{FlowGraphDataSwitchBlock:t}},__vite__mapDeps([83,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphDataSwitchBlock;default:if(j[a])return j[a];throw new Error(`Unknown block name ${a}`)}}class Jt extends J{constructor(t){super(t),this.out=this._registerSignalOutput("out")}}class Zt extends Jt{constructor(t,e){if(super(t),this._eventsSignalOutputs={},this.done=this._registerSignalOutput("done"),e)for(const o of e)this._eventsSignalOutputs[o]=this._registerSignalOutput(o+"Event")}_executeOnTick(t){}_startPendingTasks(t){t._getExecutionVariable(this,"_initialized",!1)&&(this._cancelPendingTasks(t),this._resetAfterCanceled(t)),this._preparePendingTasks(t),t._addPendingBlock(this),this.out._activateSignal(t),t._setExecutionVariable(this,"_initialized",!0)}_resetAfterCanceled(t){t._deleteExecutionVariable(this,"_initialized"),t._removePendingBlock(this)}}class Xt extends Zt{constructor(){super(...arguments),this.initPriority=0,this.type="NoTrigger"}_execute(t){t._notifyExecuteNode(this),this.done._activateSignal(t)}}function Yt(a,t){for(const e of a)for(const o of e.dataOutputs)if(o.uniqueId===t)return o;throw new Error("Could not find data out connection with unique id "+t)}function zt(a,t){for(const e of a)if(e instanceof J){for(const o of e.signalInputs)if(o.uniqueId===t)return o}throw new Error("Could not find signal in connection with unique id "+t)}async function jt(a,t){const e=await Promise.all(a.allBlocks.map(async o=>await Ht(o.className)()));return te(a,t,e)}function te(a,t,e){const o=t.coordinator.createGraph(),n=[],s=t.valueParseFunction??H;for(let i=0;i<a.allBlocks.length;i++){const c=a.allBlocks[i],l=oe(c,{scene:t.coordinator.config.scene,pathConverter:t.pathConverter,assetsContainer:t.coordinator.config.scene,valueParseFunction:s},e[i]);n.push(l),l instanceof Xt&&o.addEventBlock(l)}for(const i of n){for(const c of i.dataInputs)for(const l of c.connectedPointIds){const u=Yt(n,l);c.connectTo(u)}if(i instanceof J)for(const c of i.signalOutputs)for(const l of c.connectedPointIds){const u=zt(n,l);c.connectTo(u)}}for(const i of a.executionContexts)ee(i,{graph:o,valueParseFunction:s},a.rightHanded);return o}function ee(a,t,e){var i,c,l,u,m,f,A,R,L,S;const o=t.graph.createContext();a.enableLogging&&(o.enableLogging=!0),o.treatDataAsRightHanded=e||!1;const n=t.valueParseFunction??H;o.uniqueId=a.uniqueId;const s=o.getScene();if(a._assetsContext){const p=a._assetsContext,v={meshes:(i=p.meshes)==null?void 0:i.map(h=>s.getMeshById(h)),lights:(c=p.lights)==null?void 0:c.map(h=>s.getLightByName(h)),cameras:(l=p.cameras)==null?void 0:l.map(h=>s.getCameraByName(h)),materials:(u=p.materials)==null?void 0:u.map(h=>s.getMaterialById(h)),textures:(m=p.textures)==null?void 0:m.map(h=>s.getTextureByName(h)),animations:(f=p.animations)==null?void 0:f.map(h=>s.animations.find(Q=>Q.name===h)),skeletons:(A=p.skeletons)==null?void 0:A.map(h=>s.getSkeletonByName(h)),particleSystems:(R=p.particleSystems)==null?void 0:R.map(h=>s.getParticleSystemById(h)),animationGroups:(L=p.animationGroups)==null?void 0:L.map(h=>s.getAnimationGroupByName(h)),transformNodes:(S=p.transformNodes)==null?void 0:S.map(h=>s.getTransformNodeById(h)),rootNodes:[],multiMaterials:[],morphTargetManagers:[],geometries:[],actionManagers:[],environmentTexture:null,postProcesses:[],sounds:null,effectLayers:[],layers:[],reflectionProbes:[],lensFlareSystems:[],proceduralTextures:[],getNodes:function(){throw new Error("Function not implemented.")}};o.assetsContext=v}for(const p in a._userVariables){const v=n(p,a._userVariables,o.assetsContext,s);o.userVariables[p]=v}for(const p in a._connectionValues){const v=n(p,a._connectionValues,o.assetsContext,s);o._setConnectionValueByKey(p,v)}return o}function oe(a,t,e){const o={},n=t.valueParseFunction??H;if(a.config)for(const i in a.config)o[i]=n(i,a.config,t.assetsContainer||t.scene,t.scene);if(Nt(a.className)){if(!t.pathConverter)throw new Error("Path converter is required for this block");o.pathConverter=t.pathConverter}const s=new e(o);s.uniqueId=a.uniqueId;for(let i=0;i<a.dataInputs.length;i++){const c=s.getDataInput(a.dataInputs[i].name);if(c)c.deserialize(a.dataInputs[i]);else throw new Error("Could not find data input with name "+a.dataInputs[i].name+" in block "+a.className)}for(let i=0;i<a.dataOutputs.length;i++){const c=s.getDataOutput(a.dataOutputs[i].name);if(c)c.deserialize(a.dataOutputs[i]);else throw new Error("Could not find data output with name "+a.dataOutputs[i].name+" in block "+a.className)}return s.metadata=a.metadata,s.deserialize&&s.deserialize(a),s}const ne={float:{length:1,flowGraphType:"number",elementType:"number"},bool:{length:1,flowGraphType:"boolean",elementType:"boolean"},float2:{length:2,flowGraphType:"Vector2",elementType:"number"},float3:{length:3,flowGraphType:"Vector3",elementType:"number"},float4:{length:4,flowGraphType:"Vector4",elementType:"number"},float4x4:{length:16,flowGraphType:"Matrix",elementType:"number"},float2x2:{length:4,flowGraphType:"Matrix2D",elementType:"number"},float3x3:{length:9,flowGraphType:"Matrix3D",elementType:"number"},int:{length:1,flowGraphType:"FlowGraphInteger",elementType:"number"}};class ae{constructor(t,e,o=60){this._interactivityGraph=t,this._gltf=e,this._animationTargetFps=o,this._types=[],this._mappings=[],this._staticVariables=[],this._events=[],this._internalEventsCounter=0,this._nodes=[],this._parseTypes(),this._parseDeclarations(),this._parseVariables(),this._parseEvents(),this._parseNodes()}get arrays(){return{types:this._types,mappings:this._mappings,staticVariables:this._staticVariables,events:this._events,nodes:this._nodes}}_parseTypes(){if(this._interactivityGraph.types)for(const t of this._interactivityGraph.types)this._types.push(ne[t.signature])}_parseDeclarations(){if(this._interactivityGraph.declarations)for(const t of this._interactivityGraph.declarations){const e=bt(t);if(!e)throw w.Error(["No mapping found for declaration",t]),new Error("Error parsing declarations");this._mappings.push({flowGraphMapping:e,fullOperationName:t.extension?t.op+":"+t.extension:t.op})}}_parseVariables(){if(this._interactivityGraph.variables)for(const t of this._interactivityGraph.variables){const e=this._parseVariable(t);this._staticVariables.push(e)}}_parseVariable(t,e){const o=this._types[t.type];if(!o)throw w.Error(["No type found for variable",t]),new Error("Error parsing variables");if(t.value&&t.value.length!==o.length)throw w.Error(["Invalid value length for variable",t,o]),new Error("Error parsing variables");const n=t.value||[];if(!n.length)switch(o.flowGraphType){case"boolean":n.push(!1);break;case"FlowGraphInteger":n.push(0);break;case"number":n.push(NaN);break;case"Vector2":n.push(NaN,NaN);break;case"Vector3":n.push(NaN,NaN,NaN);break;case"Vector4":case"Matrix2D":case"Quaternion":n.fill(NaN,0,4);break;case"Matrix":n.fill(NaN,0,16);break;case"Matrix3D":n.fill(NaN,0,9);break}return o.elementType==="number"&&typeof n[0]=="string"&&(n[0]=parseFloat(n[0])),{type:o.flowGraphType,value:e?e(n,this):n}}_parseEvents(){if(this._interactivityGraph.events)for(const t of this._interactivityGraph.events){const e={eventId:t.id||"internalEvent_"+this._internalEventsCounter++};t.values&&(e.eventData=Object.keys(t.values).map(o=>{var c;const n=(c=t.values)==null?void 0:c[o];if(!n)throw w.Error(["No value found for event key",o]),new Error("Error parsing events");const s=this._types[n.type];if(!s)throw w.Error(["No type found for event value",n]),new Error("Error parsing events");const i=typeof n.value<"u"?this._parseVariable(n):void 0;return{id:o,type:s.flowGraphType,eventData:!0,value:i}})),this._events.push(e)}}_parseNodes(){var t;if(this._interactivityGraph.nodes)for(const e of this._interactivityGraph.nodes){if(typeof e.declaration!="number")throw w.Error(["No declaration found for node",e]),new Error("Error parsing nodes");const o=this._mappings[e.declaration];if(!o)throw w.Error(["No mapping found for node",e]),new Error("Error parsing nodes");if(o.flowGraphMapping.validation){const s=o.flowGraphMapping.validation(e,this._interactivityGraph,this._gltf);if(!s.valid)throw new Error(`Error validating interactivity node ${(t=this._interactivityGraph.declarations)==null?void 0:t[e.declaration].op} - ${s.error}`)}const n=[];for(const s of o.flowGraphMapping.blocks){const i=this._getEmptyBlock(s,o.fullOperationName);this._parseNodeConfiguration(e,i,o.flowGraphMapping,s),n.push(i)}this._nodes.push({blocks:n,fullOperationName:o.fullOperationName})}}_getEmptyBlock(t,e){return{uniqueId:D(),className:t,dataInputs:[],dataOutputs:[],signalInputs:[],signalOutputs:[],config:{},type:e,metadata:{}}}_parseNodeConfiguration(t,e,o,n){var i;const s=t.configuration;if(s)for(const c in s){const l=s[c];if(!l)throw new Error("Error parsing node configuration");const u=(i=o.configuration)==null?void 0:i[c];if(u&&u.toBlock?u.toBlock===n:o.blocks.indexOf(n)===0){let f=u==null?void 0:u.defaultValue;l!=null&&l.value&&(f=l.value),u!=null&&u.isArray||(f.length!==1&&w.Warn(`Invalid non-array value length: ${f.length}`),f=f[0]),u!=null&&u.dataTransformer&&(f=u.dataTransformer(f,this)),f!==void 0&&(e.config[(u==null?void 0:u.name)||c]={value:f})}}}_parseNodeConnections(t){var e,o,n,s,i,c,l,u,m,f,A,R,L,S,p,v,h,Q,et;for(let N=0;N<this._nodes.length;N++){const I=(e=this._interactivityGraph.nodes)==null?void 0:e[N];if(!I)throw w.Error(["No node found for interactivity node",this._nodes[N]]),new Error("Error parsing node connections");const T=this._nodes[N],F=this._mappings[I.declaration];if(!F)throw w.Error(["No mapping found for node",I]),new Error("Error parsing node connections");const ot=I.flows||{},gt=Object.keys(ot).sort();for(const d of gt){const y=ot[d],_=(n=(o=F.flowGraphMapping.outputs)==null?void 0:o.flows)==null?void 0:n[d],x=(_==null?void 0:_.name)||d,M=this._createNewSocketConnection(x,!0);(_&&_.toBlock&&T.blocks.find(B=>B.className===_.toBlock)||T.blocks[0]).signalOutputs.push(M);const Z=y.node,g=this._nodes[Z];if(!g)throw w.Error(["No node found for input node id",Z]),new Error("Error parsing node connections");const V=at(g.fullOperationName);if(!V)throw w.Error(["No mapping found for input node",g]),new Error("Error parsing node connections");let k=(i=(s=V.inputs)==null?void 0:s.flows)==null?void 0:i[y.socket||"in"],P=!1;if(!k)for(const B in(c=V.inputs)==null?void 0:c.flows)B.startsWith("[")&&B.endsWith("]")&&(P=!0,k=(u=(l=V.inputs)==null?void 0:l.flows)==null?void 0:u[B]);const G=k?P?k.name.replace("$1",y.socket||""):k.name:y.socket||"in",$=k&&k.toBlock&&g.blocks.find(B=>B.className===k.toBlock)||g.blocks[0];let C=$.signalInputs.find(B=>B.name===G);C||(C=this._createNewSocketConnection(G),$.signalInputs.push(C)),C.connectedPointIds.push(M.uniqueId),M.connectedPointIds.push(C.uniqueId)}const nt=I.values||{},mt=Object.keys(nt);for(const d of mt){const y=nt[d];let _=(f=(m=F.flowGraphMapping.inputs)==null?void 0:m.values)==null?void 0:f[d],x=!1;if(!_)for(const g in(A=F.flowGraphMapping.inputs)==null?void 0:A.values)g.startsWith("[")&&g.endsWith("]")&&(x=!0,_=(L=(R=F.flowGraphMapping.inputs)==null?void 0:R.values)==null?void 0:L[g]);const M=_?x?_.name.replace("$1",d):_.name:d,q=this._createNewSocketConnection(M);if((_&&_.toBlock&&T.blocks.find(g=>g.className===_.toBlock)||T.blocks[0]).dataInputs.push(q),y.value!==void 0){const g=this._parseVariable(y,_&&_.dataTransformer);t._connectionValues[q.uniqueId]=g}else if(typeof y.node<"u"){const g=y.node,V=y.socket||"value",k=this._nodes[g];if(!k)throw w.Error(["No node found for output socket reference",y]),new Error("Error parsing node connections");const P=at(k.fullOperationName);if(!P)throw w.Error(["No mapping found for output socket reference",y]),new Error("Error parsing node connections");let G=(p=(S=P.outputs)==null?void 0:S.values)==null?void 0:p[V],$=!1;if(!G)for(const b in(v=P.outputs)==null?void 0:v.values)b.startsWith("[")&&b.endsWith("]")&&($=!0,G=(Q=(h=P.outputs)==null?void 0:h.values)==null?void 0:Q[b]);const C=G?$?G.name.replace("$1",V):G==null?void 0:G.name:V,B=G&&G.toBlock&&k.blocks.find(b=>b.className===G.toBlock)||k.blocks[0];let K=B.dataOutputs.find(b=>b.name===C);K||(K=this._createNewSocketConnection(C,!0),B.dataOutputs.push(K)),q.connectedPointIds.push(K.uniqueId),K.connectedPointIds.push(q.uniqueId)}else throw w.Error(["Invalid value for value connection",y]),new Error("Error parsing node connections")}if(F.flowGraphMapping.interBlockConnectors)for(const d of F.flowGraphMapping.interBlockConnectors){const y=d.input,_=d.output,x=d.isVariable;this._connectFlowGraphNodes(y,_,T.blocks[d.inputBlockIndex],T.blocks[d.outputBlockIndex],x)}if(F.flowGraphMapping.extraProcessor){const d=(et=this._interactivityGraph.declarations)==null?void 0:et[I.declaration];if(!d)throw w.Error(["No declaration found for extra processor",I]),new Error("Error parsing node connections");T.blocks=F.flowGraphMapping.extraProcessor(I,d,F.flowGraphMapping,this,T.blocks,t,this._gltf)}}}_createNewSocketConnection(t,e){return{uniqueId:D(),name:t,_connectionType:e?1:0,connectedPointIds:[]}}_connectFlowGraphNodes(t,e,o,n,s){const i=s?o.dataInputs:o.signalInputs,c=s?n.dataOutputs:n.signalOutputs,l=i.find(m=>m.name===t)||this._createNewSocketConnection(t),u=c.find(m=>m.name===e)||this._createNewSocketConnection(e,!0);i.find(m=>m.name===t)||i.push(l),c.find(m=>m.name===e)||c.push(u),l.connectedPointIds.push(u.uniqueId),u.connectedPointIds.push(l.uniqueId)}getVariableName(t){return"staticVariable_"+t}serializeToFlowGraph(){const t={uniqueId:D(),_userVariables:{},_connectionValues:{}};this._parseNodeConnections(t);for(let o=0;o<this._staticVariables.length;o++){const n=this._staticVariables[o];t._userVariables[this.getVariableName(o)]=n}return{rightHanded:!0,allBlocks:this._nodes.reduce((o,n)=>o.concat(n.blocks),[]),executionContexts:[t]}}}const W="KHR_interactivity";class ft{constructor(t){this._loader=t,this.name=W,this.enabled=this._loader.isExtensionUsed(W),this._pathConverter=Dt(this._loader.gltf),t._skipStartAnimationStep=!0;const e=t.babylonScene;e&&yt(e)}dispose(){this._loader=null,delete this._pathConverter}async onReady(){var s;if(!this._loader.babylonScene||!this._pathConverter)return;const t=this._loader.babylonScene,e=(s=this._loader.gltf.extensions)==null?void 0:s.KHR_interactivity;if(!e)return;const o=new E({scene:t});o.dispatchEventsSynchronously=!1;const n=e.graphs.map(i=>new ae(i,this._loader.gltf,this._loader.parent.targetFps).serializeToFlowGraph());await Promise.all(n.map(async i=>await jt(i,{coordinator:o,pathConverter:this._pathConverter}))),o.start()}}function yt(a){O("/extensions/KHR_interactivity/?/activeCamera/rotation",{get:()=>{if(!a.activeCamera)return new X(NaN,NaN,NaN,NaN);const t=X.FromRotationMatrix(a.activeCamera.getWorldMatrix()).normalize();return a.useRightHandedSystem||(t.w*=-1,t.x*=-1),t},type:"Quaternion",getTarget:()=>a.activeCamera}),O("/extensions/KHR_interactivity/?/activeCamera/position",{get:()=>{if(!a.activeCamera)return new ut(NaN,NaN,NaN);const t=a.activeCamera.getWorldMatrix().getTranslation();return a.useRightHandedSystem||(t.x*=-1),t},type:"Vector3",getTarget:()=>a.activeCamera}),O("/animations/{}/extensions/KHR_interactivity/isPlaying",{get:t=>{var e;return((e=t._babylonAnimationGroup)==null?void 0:e.isPlaying)??!1},type:"boolean",getTarget:t=>t._babylonAnimationGroup}),O("/animations/{}/extensions/KHR_interactivity/minTime",{get:t=>{var e;return(((e=t._babylonAnimationGroup)==null?void 0:e.from)??0)/60},type:"number",getTarget:t=>t._babylonAnimationGroup}),O("/animations/{}/extensions/KHR_interactivity/maxTime",{get:t=>{var e;return(((e=t._babylonAnimationGroup)==null?void 0:e.to)??0)/60},type:"number",getTarget:t=>t._babylonAnimationGroup}),O("/animations/{}/extensions/KHR_interactivity/playhead",{get:t=>{var e;return(((e=t._babylonAnimationGroup)==null?void 0:e.getCurrentFrame())??0)/60},type:"number",getTarget:t=>t._babylonAnimationGroup}),O("/animations/{}/extensions/KHR_interactivity/virtualPlayhead",{get:t=>{var e;return(((e=t._babylonAnimationGroup)==null?void 0:e.getCurrentFrame())??0)/60},type:"number",getTarget:t=>t._babylonAnimationGroup})}Qt(W,"FlowGraphGLTFDataProvider",async()=>(await r(async()=>{const{FlowGraphGLTFDataProvider:a}=await import("./flowGraphGLTFDataProvider-By82y__G.js");return{FlowGraphGLTFDataProvider:a}},__vite__mapDeps([84,1,2,3,4,5,23,24,9,21,25,26,13,12,14,15,16,17,18,19,20,22,27,28,8,29,30,31,10]))).FlowGraphGLTFDataProvider);Ot(W);xt(W,!0,a=>new ft(a));const ke=Object.freeze(Object.defineProperty({__proto__:null,KHR_interactivity:ft,_AddInteractivityObjectModel:yt},Symbol.toStringTag,{value:"Module"}));export{$t as F,Mt as G,ke as K,dt as _,Zt as a,Jt as b,Xt as c,E as d,de as e,fe as f,Wt as g,ye as h,me as i,ge as j,J as k,tt as l};
|
assets/KHR_lights_punctual-CCzRzwty.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{M as x,V as h}from"./math.vector-C1xyPDEl.js";import{Color3 as b}from"./math.color-CzLaKyb6.js";import{_ as d,s as u}from"./bufferUtils-DTRdUD8L.js";import{N as T}from"./node-C-Iu0ALa.js";import{L as S}from"./light-DT53MGnW.js";import{b as E,c as v}from"./objectModelMapping-DWcnlpHl.js";import{R as Z}from"./math.scalar.functions-DkeaWAWz.js";import{A as D,G as M}from"./glTFLoader-BPeiodqB.js";import{u as C,r as R}from"./dynamic-BUKysMyT.js";import"./decorators.serialization-C7d7ykGG.js";import"./lightConstants-B1TSTh-k.js";import"./tools-D01N7ptR.js";import"./math.axis-Ck7JfPPj.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./math.plane-Ce_75-g5.js";import"./index-Bx1QoKVU.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./material-CrEsrP1R.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";T.AddNodeConstructor("Light_Type_1",(m,t)=>()=>new a(m,h.Zero(),t));class a extends E{get shadowFrustumSize(){return this._shadowFrustumSize}set shadowFrustumSize(t){this._shadowFrustumSize=t,this.forceProjectionMatrixCompute()}get shadowOrthoScale(){return this._shadowOrthoScale}set shadowOrthoScale(t){this._shadowOrthoScale=t,this.forceProjectionMatrixCompute()}get orthoLeft(){return this._orthoLeft}set orthoLeft(t){this._orthoLeft=t}get orthoRight(){return this._orthoRight}set orthoRight(t){this._orthoRight=t}get orthoTop(){return this._orthoTop}set orthoTop(t){this._orthoTop=t}get orthoBottom(){return this._orthoBottom}set orthoBottom(t){this._orthoBottom=t}constructor(t,o,e,i){super(t,e,i),this._shadowFrustumSize=0,this._shadowOrthoScale=.1,this.autoUpdateExtends=!0,this.autoCalcShadowZBounds=!1,this._orthoLeft=Number.MAX_VALUE,this._orthoRight=Number.MIN_VALUE,this._orthoTop=Number.MIN_VALUE,this._orthoBottom=Number.MAX_VALUE,this.position=o.scale(-1),this.direction=o}getClassName(){return"DirectionalLight"}getTypeID(){return S.LIGHTTYPEID_DIRECTIONALLIGHT}_setDefaultShadowProjectionMatrix(t,o,e){this.shadowFrustumSize>0?this._setDefaultFixedFrustumShadowProjectionMatrix(t):this._setDefaultAutoExtendShadowProjectionMatrix(t,o,e)}_setDefaultFixedFrustumShadowProjectionMatrix(t){const o=this.getScene().activeCamera;x.OrthoLHToRef(this.shadowFrustumSize,this.shadowFrustumSize,this.shadowMinZ!==void 0?this.shadowMinZ:o?o.minZ:0,this.shadowMaxZ!==void 0?this.shadowMaxZ:o?o.maxZ:1e4,t,this.getScene().getEngine().isNDCHalfZRange)}_setDefaultAutoExtendShadowProjectionMatrix(t,o,e){const i=this.getScene().activeCamera;if(this.autoUpdateExtends||this._orthoLeft===Number.MAX_VALUE){const r=h.Zero();this._orthoLeft=Number.MAX_VALUE,this._orthoRight=-Number.MAX_VALUE,this._orthoTop=-Number.MAX_VALUE,this._orthoBottom=Number.MAX_VALUE;let g=Number.MAX_VALUE,L=-Number.MAX_VALUE;for(let w=0;w<e.length;w++){const A=e[w];if(!A)continue;const B=A.getBoundingInfo().boundingBox;for(let y=0;y<B.vectorsWorld.length;y++)h.TransformCoordinatesToRef(B.vectorsWorld[y],o,r),r.x<this._orthoLeft&&(this._orthoLeft=r.x),r.y<this._orthoBottom&&(this._orthoBottom=r.y),r.x>this._orthoRight&&(this._orthoRight=r.x),r.y>this._orthoTop&&(this._orthoTop=r.y),this.autoCalcShadowZBounds&&(r.z<g&&(g=r.z),r.z>L&&(L=r.z))}this.autoCalcShadowZBounds&&(this._shadowMinZ=g,this._shadowMaxZ=L)}const c=this._orthoRight-this._orthoLeft,f=this._orthoTop-this._orthoBottom,s=this.shadowMinZ!==void 0?this.shadowMinZ:(i==null?void 0:i.minZ)||0,n=this.shadowMaxZ!==void 0?this.shadowMaxZ:(i==null?void 0:i.maxZ)||1e4,l=this.getScene().getEngine().useReverseDepthBuffer;x.OrthoOffCenterLHToRef(this._orthoLeft-c*this.shadowOrthoScale,this._orthoRight+c*this.shadowOrthoScale,this._orthoBottom-f*this.shadowOrthoScale,this._orthoTop+f*this.shadowOrthoScale,l?n:s,l?s:n,t,this.getScene().getEngine().isNDCHalfZRange)}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}transferToEffect(t,o){return this.computeTransformedInformation()?(this._uniformBuffer.updateFloat4("vLightData",this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z,1,o),this):(this._uniformBuffer.updateFloat4("vLightData",this.direction.x,this.direction.y,this.direction.z,1,o),this)}transferToNodeMaterialEffect(t,o){return this.computeTransformedInformation()?(t.setFloat3(o,this.transformedDirection.x,this.transformedDirection.y,this.transformedDirection.z),this):(t.setFloat3(o,this.direction.x,this.direction.y,this.direction.z),this)}getDepthMinZ(t){const o=this._scene.getEngine();return!o.useReverseDepthBuffer&&o.isNDCHalfZRange?0:1}getDepthMaxZ(t){const o=this._scene.getEngine();return o.useReverseDepthBuffer&&o.isNDCHalfZRange?0:1}prepareLightSpecificDefines(t,o){t["DIRLIGHT"+o]=!0}}d([u()],a.prototype,"shadowFrustumSize",null);d([u()],a.prototype,"shadowOrthoScale",null);d([u()],a.prototype,"autoUpdateExtends",void 0);d([u()],a.prototype,"autoCalcShadowZBounds",void 0);d([u("orthoLeft")],a.prototype,"_orthoLeft",void 0);d([u("orthoRight")],a.prototype,"_orthoRight",void 0);d([u("orthoTop")],a.prototype,"_orthoTop",void 0);d([u("orthoBottom")],a.prototype,"_orthoBottom",void 0);Z("BABYLON.DirectionalLight",a);T.AddNodeConstructor("Light_Type_0",(m,t)=>()=>new _(m,h.Zero(),t));class _ extends E{get shadowAngle(){return this._shadowAngle}set shadowAngle(t){this._shadowAngle=t,this.forceProjectionMatrixCompute()}get direction(){return this._direction}set direction(t){const o=this.needCube();if(this._direction=t,this.needCube()!==o&&this._shadowGenerators){const e=this._shadowGenerators.values();for(let i=e.next();i.done!==!0;i=e.next())i.value.recreateShadowMap()}}constructor(t,o,e,i){super(t,e,i),this._shadowAngle=Math.PI/2,this.position=o}getClassName(){return"PointLight"}getTypeID(){return S.LIGHTTYPEID_POINTLIGHT}needCube(){return!this.direction}getShadowDirection(t){if(this.direction)return super.getShadowDirection(t);switch(t){case 0:return new h(1,0,0);case 1:return new h(-1,0,0);case 2:return new h(0,-1,0);case 3:return new h(0,1,0);case 4:return new h(0,0,1);case 5:return new h(0,0,-1)}return h.Zero()}_setDefaultShadowProjectionMatrix(t,o,e){const i=this.getScene().activeCamera,c=this.getDepthMinZ(i),f=this.getDepthMaxZ(i),s=this.getScene().getEngine().useReverseDepthBuffer;x.PerspectiveFovLHToRef(this.shadowAngle,1,s?f:c,s?c:f,t,!0,this._scene.getEngine().isNDCHalfZRange,void 0,s)}_buildUniformLayout(){this._uniformBuffer.addUniform("vLightData",4),this._uniformBuffer.addUniform("vLightDiffuse",4),this._uniformBuffer.addUniform("vLightSpecular",4),this._uniformBuffer.addUniform("vLightFalloff",4),this._uniformBuffer.addUniform("shadowsInfo",3),this._uniformBuffer.addUniform("depthValues",2),this._uniformBuffer.create()}transferToEffect(t,o){const e=this._scene.floatingOriginOffset;return this.computeTransformedInformation()?this._uniformBuffer.updateFloat4("vLightData",this.transformedPosition.x-e.x,this.transformedPosition.y-e.y,this.transformedPosition.z-e.z,0,o):this._uniformBuffer.updateFloat4("vLightData",this.position.x-e.x,this.position.y-e.y,this.position.z-e.z,0,o),this._uniformBuffer.updateFloat4("vLightFalloff",this.range,this._inverseSquaredRange,0,0,o),this}transferToNodeMaterialEffect(t,o){const e=this._scene.floatingOriginOffset;return this.computeTransformedInformation()?t.setFloat3(o,this.transformedPosition.x-e.x,this.transformedPosition.y-e.y,this.transformedPosition.z-e.z):t.setFloat3(o,this.position.x-e.x,this.position.y-e.y,this.position.z-e.z),this}prepareLightSpecificDefines(t,o){t["POINTLIGHT"+o]=!0}}d([u()],_.prototype,"shadowAngle",null);Z("BABYLON.PointLight",_);const p="KHR_lights_punctual";class N{constructor(t){this.name=p,this._loader=t,this.enabled=this._loader.isExtensionUsed(p)}dispose(){this._loader=null,delete this._lights}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const o=t[this.name];this._lights=o.lights,D.Assign(this._lights)}}loadNodeAsync(t,o,e){return M.LoadExtensionAsync(t,o,this.name,async(i,c)=>(this._loader._allMaterialsDirtyRequired=!0,await this._loader.loadNodeAsync(t,o,f=>{let s;const n=D.Get(i,this._lights,c.light),l=n.name||f.name;switch(this._loader.babylonScene._blockEntityCollection=!!this._loader._assetContainer,n.type){case"directional":{const r=new a(l,h.Backward(),this._loader.babylonScene);r.position.setAll(0),s=r;break}case"point":{s=new _(l,h.Zero(),this._loader.babylonScene);break}case"spot":{const r=new v(l,h.Zero(),h.Backward(),0,1,this._loader.babylonScene);r.angle=(n.spot&&n.spot.outerConeAngle||Math.PI/4)*2,r.innerAngle=(n.spot&&n.spot.innerConeAngle||0)*2,s=r;break}default:throw this._loader.babylonScene._blockEntityCollection=!1,new Error(`${i}: Invalid light type (${n.type})`)}s._parentContainer=this._loader._assetContainer,this._loader.babylonScene._blockEntityCollection=!1,n._babylonLight=s,s.falloffType=S.FALLOFF_GLTF,s.diffuse=n.color?b.FromArray(n.color):b.White(),s.intensity=n.intensity==null?1:n.intensity,s.range=n.range==null?Number.MAX_VALUE:n.range,s.parent=f,this._loader._babylonLights.push(s),M.AddPointerMetadata(s,i),e(f)})))}}C(p);R(p,!0,m=>new N(m));export{N as KHR_lights};
|
assets/KHR_materials_anisotropy-DeuhwPRx.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as l}from"./glTFLoader-BPeiodqB.js";import{u as d,r as c}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const n="KHR_materials_anisotropy";class u{constructor(t){this.name=n,this.order=195,this._loader=t,this.enabled=this._loader.isExtensionUsed(n)}dispose(){this._loader=null}loadMaterialPropertiesAsync(t,o,i){return l.LoadExtensionAsync(t,o,this.name,async(r,e)=>{const s=new Array;s.push(this._loader.loadMaterialPropertiesAsync(t,o,i)),s.push(this._loadAnisotropyPropertiesAsync(r,e,i)),await Promise.all(s)})}async _loadAnisotropyPropertiesAsync(t,o,i){const r=this._loader._getOrCreateMaterialAdapter(i),e=new Array,s=o.anisotropyStrength??0,y=o.anisotropyRotation??0;r.specularRoughnessAnisotropy=s,r.geometryTangentAngle=y;const a=o.extensions??{};(!a.EXT_materials_anisotropy_openpbr||!a.EXT_materials_anisotropy_openpbr.openPbrAnisotropyEnabled)&&r.configureGltfStyleAnisotropy(!0),o.anisotropyTexture&&(o.anisotropyTexture.nonColorData=!0,e.push(this._loader.loadTextureInfoAsync(`${t}/anisotropyTexture`,o.anisotropyTexture,m=>{m.name=`${i.name} (Anisotropy Intensity)`,r.geometryTangentTexture=m}))),await Promise.all(e)}}d(n);c(n,!0,p=>new u(p));export{u as KHR_materials_anisotropy};
|
assets/KHR_materials_clearcoat-CqejipXp.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as n}from"./glTFLoader-BPeiodqB.js";import{u as l,r as u}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const m="KHR_materials_clearcoat";class d{constructor(a){this.name=m,this.order=190,this._loader=a,this.enabled=this._loader.isExtensionUsed(m)}dispose(){this._loader=null}loadMaterialPropertiesAsync(a,o,r){return n.LoadExtensionAsync(a,o,this.name,async(t,s)=>{const e=new Array;e.push(this._loader.loadMaterialPropertiesAsync(a,o,r)),e.push(this._loadClearCoatPropertiesAsync(t,s,r)),await Promise.all(e)})}_loadClearCoatPropertiesAsync(a,o,r){const t=this._loader._getOrCreateMaterialAdapter(r),s=new Array;return t.configureCoat(),t.coatWeight=o.clearcoatFactor!==void 0?o.clearcoatFactor:0,t.coatRoughness=o.clearcoatRoughnessFactor!==void 0?o.clearcoatRoughnessFactor:0,o.clearcoatTexture&&s.push(this._loader.loadTextureInfoAsync(`${a}/clearcoatTexture`,o.clearcoatTexture,e=>{e.name=`${r.name} (ClearCoat)`,t.coatWeightTexture=e})),o.clearcoatRoughnessTexture&&(o.clearcoatRoughnessTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${a}/clearcoatRoughnessTexture`,o.clearcoatRoughnessTexture,e=>{e.name=`${r.name} (ClearCoat Roughness)`,t.coatRoughnessTexture=e}))),o.clearcoatNormalTexture&&(o.clearcoatNormalTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${a}/clearcoatNormalTexture`,o.clearcoatNormalTexture,e=>{var c;e.name=`${r.name} (ClearCoat Normal)`,t.geometryCoatNormalTexture=e,((c=o.clearcoatNormalTexture)==null?void 0:c.scale)!=null&&(t.geometryCoatNormalTextureScale=o.clearcoatNormalTexture.scale)})),t.setNormalMapInversions(!r.getScene().useRightHandedSystem,r.getScene().useRightHandedSystem)),Promise.all(s).then(()=>{})}}l(m);u(m,!0,i=>new d(i));export{d as KHR_materials_clearcoat};
|
assets/KHR_materials_coat-DOoUAE9E.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as d}from"./glTFLoader-BPeiodqB.js";import{u as h,r as T}from"./dynamic-BUKysMyT.js";import{Color3 as g}from"./math.color-CzLaKyb6.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const i="KHR_materials_coat";class f{constructor(r){this.name=i,this.order=191,this.useOpenPBR=!1,this._loader=r,this.enabled=this._loader.isExtensionUsed(i)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,o,a){return d.LoadExtensionAsync(r,o,this.name,async(t,n)=>{const s=new Array;s.push(this._loader.loadMaterialPropertiesAsync(r,o,a)),o.extensions&&o.extensions.KHR_materials_openpbr&&(this.useOpenPBR=!0),s.push(this._loadCoatPropertiesAsync(t,n,a)),await Promise.all(s)})}_loadCoatPropertiesAsync(r,o,a){const t=this._loader._getOrCreateMaterialAdapter(a),n=new Array;t.configureCoat(),t.coatWeight=o.coatFactor!==void 0?o.coatFactor:0,t.coatRoughness=o.coatRoughnessFactor!==void 0?o.coatRoughnessFactor:0,o.coatTexture&&n.push(this._loader.loadTextureInfoAsync(`${r}/coatTexture`,o.coatTexture,e=>{e.name=`${a.name} (Coat)`,t.coatWeightTexture=e})),o.coatRoughnessTexture&&(o.coatRoughnessTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${r}/coatRoughnessTexture`,o.coatRoughnessTexture,e=>{e.name=`${a.name} (Coat Roughness)`,t.coatRoughnessTexture=e}))),o.coatNormalTexture&&(o.coatNormalTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${r}/coatNormalTexture`,o.coatNormalTexture,e=>{var m;e.name=`${a.name} (Coat Normal)`,t.geometryCoatNormalTexture=e,((m=o.coatNormalTexture)==null?void 0:m.scale)!=null&&(t.geometryCoatNormalTextureScale=o.coatNormalTexture.scale)})),t.setNormalMapInversions(!a.getScene().useRightHandedSystem,a.getScene().useRightHandedSystem)),t.coatDarkening=o.coatDarkeningFactor!==void 0?o.coatDarkeningFactor:1,t.coatIor=o.coatIor!==void 0?o.coatIor:1.5;const s=g.White();o.coatColorFactor!==void 0&&s.fromArray(o.coatColorFactor),t.coatColor=s,o.coatColorTexture&&n.push(this._loader.loadTextureInfoAsync(`${r}/coatColorTexture`,o.coatColorTexture,e=>{e.name=`${a.name} (Coat Color)`,t.coatColorTexture=e}));const u=o.coatAnisotropyStrength??0,l=o.coatAnisotropyRotation??0;return t.coatRoughnessAnisotropy=u,t.geometryCoatTangentAngle=l,this.useOpenPBR||t.configureGltfStyleAnisotropy(!0),o.coatAnisotropyTexture&&(o.coatAnisotropyTexture.nonColorData=!0,n.push(this._loader.loadTextureInfoAsync(`${r}/coatAnisotropyTexture`,o.coatAnisotropyTexture,e=>{e.name=`${a.name} (Coat Anisotropy)`,t.geometryCoatTangentTexture=e}))),Promise.all(n).then(()=>{})}}h(i);T(i,!0,c=>new f(c));export{f as KHR_materials_coat};
|
assets/KHR_materials_diffuse_roughness-3tU76Z0C.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as n}from"./glTFLoader-BPeiodqB.js";import{u as a,r as u}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const m="KHR_materials_diffuse_roughness";class h{constructor(r){this.name=m,this.order=190,this._loader=r,this.enabled=this._loader.isExtensionUsed(m)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,s,t){return n.LoadExtensionAsync(r,s,this.name,async(i,e)=>{const o=new Array;return o.push(this._loader.loadMaterialPropertiesAsync(r,s,t)),o.push(this._loadDiffuseRoughnessPropertiesAsync(i,e,t)),await Promise.all(o).then(()=>{})})}_loadDiffuseRoughnessPropertiesAsync(r,s,t){const i=this._loader._getOrCreateMaterialAdapter(t),e=new Array;return i.baseDiffuseRoughness=s.diffuseRoughnessFactor??0,s.diffuseRoughnessTexture&&e.push(this._loader.loadTextureInfoAsync(`${r}/diffuseRoughnessTexture`,s.diffuseRoughnessTexture,o=>{o.name=`${t.name} (Diffuse Roughness)`,i.baseDiffuseRoughnessTexture=o})),Promise.all(e).then(()=>{})}}a(m);u(m,!0,p=>new h(p));export{h as KHR_materials_diffuse_roughness};
|
assets/KHR_materials_diffuse_transmission-CfRoCwmd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as u}from"./glTFLoader-BPeiodqB.js";import{Color3 as p}from"./math.color-CzLaKyb6.js";import{u as f,r as d}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const n="KHR_materials_diffuse_transmission";class T{constructor(s){this.name=n,this.order=174,this._loader=s,this.enabled=this._loader.isExtensionUsed(n),this.enabled&&(s.parent.transparencyAsCoverage=!0)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,m,t){return u.LoadExtensionAsync(s,m,this.name,async(r,i)=>{const o=new Array;return o.push(this._loader.loadMaterialPropertiesAsync(s,m,t)),o.push(this._loadTranslucentPropertiesAsync(r,m,t,i)),await Promise.all(o).then(()=>{})})}_loadTranslucentPropertiesAsync(s,m,t,r){const i=this._loader._getOrCreateMaterialAdapter(t);i.configureSubsurface(),i.subsurfaceWeight=r.diffuseTransmissionFactor??0,i.subsurfaceConstantTint=r.diffuseTransmissionColorFactor!==void 0?p.FromArray(r.diffuseTransmissionColorFactor):p.White();const o=new Array;return r.diffuseTransmissionTexture&&(r.diffuseTransmissionTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync(`${s}/diffuseTransmissionTexture`,r.diffuseTransmissionTexture).then(e=>{e.name=`${t.name} (Diffuse Transmission)`,i.subsurfaceWeightTexture=e}))),r.diffuseTransmissionColorTexture&&o.push(this._loader.loadTextureInfoAsync(`${s}/diffuseTransmissionColorTexture`,r.diffuseTransmissionColorTexture).then(e=>{e.name=`${t.name} (Diffuse Transmission Color)`,i.subsurfaceConstantTintTexture=e})),Promise.all(o).then(()=>{})}}f(n);d(n,!0,a=>new T(a));export{T as KHR_materials_diffuse_transmission};
|
assets/KHR_materials_dispersion-fuNIvVrP.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as n}from"./glTFLoader-BPeiodqB.js";import{u as a,r as d}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const e="KHR_materials_dispersion";class l{constructor(r){this.name=e,this.order=174,this._loader=r,this.enabled=this._loader.isExtensionUsed(e)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,o,t){return n.LoadExtensionAsync(r,o,this.name,async(s,i)=>{const p=new Array;return p.push(this._loader.loadMaterialPropertiesAsync(r,o,t)),p.push(this._loadDispersionPropertiesAsync(s,o,t,i)),await Promise.all(p).then(()=>{})})}_loadDispersionPropertiesAsync(r,o,t,s){const i=this._loader._getOrCreateMaterialAdapter(t);return i.transmissionWeight==0||!s.dispersion||(i.transmissionDispersionAbbeNumber=20,i.transmissionDispersionScale=s.dispersion),Promise.resolve()}}a(e);d(e,!0,m=>new l(m));export{l as KHR_materials_dispersion};
|
assets/KHR_materials_emissive_strength-rOKORGq9.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as p}from"./glTFLoader-BPeiodqB.js";import{u as a,r as n}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const o="KHR_materials_emissive_strength";class d{constructor(i){this.name=o,this.order=170,this._loader=i,this.enabled=this._loader.isExtensionUsed(o)}dispose(){this._loader=null}loadMaterialPropertiesAsync(i,t,r){return p.LoadExtensionAsync(i,t,this.name,async(e,s)=>(await this._loader.loadMaterialPropertiesAsync(i,t,r),this._loadEmissiveProperties(e,s,r),await Promise.resolve()))}_loadEmissiveProperties(i,t,r){if(t.emissiveStrength!==void 0){const e=this._loader._getOrCreateMaterialAdapter(r);e.emissionLuminance=t.emissiveStrength}}}a(o);n(o,!0,m=>new d(m));export{d as KHR_materials_emissive_strength};
|
assets/KHR_materials_fuzz-Clhu1IVg.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as n}from"./glTFLoader-BPeiodqB.js";import{Color3 as m}from"./math.color-CzLaKyb6.js";import{u as a,r as f}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const s="KHR_materials_fuzz";class h{constructor(e){this.name=s,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,o,u){return n.LoadExtensionAsync(e,o,this.name,async(t,i)=>{const r=new Array;return r.push(this._loader.loadMaterialPropertiesAsync(e,o,u)),r.push(this._loadFuzzPropertiesAsync(t,i,u)),await Promise.all(r).then(()=>{})})}_loadFuzzPropertiesAsync(e,o,u){const t=this._loader._getOrCreateMaterialAdapter(u),i=new Array;return t.configureFuzz(),t.fuzzWeight=o.fuzzFactor!==void 0?o.fuzzFactor:0,t.fuzzColor=o.fuzzColorFactor!==void 0?m.FromArray(o.fuzzColorFactor):m.White(),t.fuzzRoughness=o.fuzzRoughnessFactor!==void 0?o.fuzzRoughnessFactor:.5,o.fuzzTexture&&i.push(this._loader.loadTextureInfoAsync(`${e}/fuzzTexture`,o.fuzzTexture,r=>{r.name=`${u.name} (Fuzz)`,t.fuzzWeightTexture=r})),o.fuzzColorTexture&&i.push(this._loader.loadTextureInfoAsync(`${e}/fuzzColorTexture`,o.fuzzColorTexture,r=>{r.name=`${u.name} (Fuzz Color)`,t.fuzzColorTexture=r})),o.fuzzRoughnessTexture&&(o.fuzzRoughnessTexture.nonColorData=!0,i.push(this._loader.loadTextureInfoAsync(`${e}/fuzzRoughnessTexture`,o.fuzzRoughnessTexture,r=>{r.name=`${u.name} (Fuzz Roughness)`,t.fuzzRoughnessTexture=r}))),Promise.all(i).then(()=>{})}}a(s);f(s,!0,z=>new h(z));export{h as KHR_materials_fuzz};
|
assets/KHR_materials_ior-B1oqd8B6.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as a}from"./glTFLoader-BPeiodqB.js";import{u as d,r as l}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const i="KHR_materials_ior";class e{constructor(r){this.name=i,this.order=180,this._loader=r,this.enabled=this._loader.isExtensionUsed(i)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,o,t){return a.LoadExtensionAsync(r,o,this.name,async(p,m)=>{const s=new Array;return s.push(this._loader.loadMaterialPropertiesAsync(r,o,t)),s.push(this._loadIorPropertiesAsync(p,m,t)),await Promise.all(s).then(()=>{})})}_loadIorPropertiesAsync(r,o,t){const p=this._loader._getOrCreateMaterialAdapter(t),m=o.ior!==void 0?o.ior:e._DEFAULT_IOR;return p.specularIor=m,Promise.resolve()}}e._DEFAULT_IOR=1.5;d(i);l(i,!0,n=>new e(n));export{e as KHR_materials_ior};
|
assets/KHR_materials_iridescence-acCc2TH6.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as c}from"./glTFLoader-BPeiodqB.js";import{u as a,r as p}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const n="KHR_materials_iridescence";class d{constructor(t){this.name=n,this.order=195,this._loader=t,this.enabled=this._loader.isExtensionUsed(n)}dispose(){this._loader=null}loadMaterialPropertiesAsync(t,i,s){return c.LoadExtensionAsync(t,i,this.name,async(r,o)=>{const e=new Array;return e.push(this._loader.loadMaterialPropertiesAsync(t,i,s)),e.push(this._loadIridescencePropertiesAsync(r,o,s)),await Promise.all(e).then(()=>{})})}_loadIridescencePropertiesAsync(t,i,s){const r=this._loader._getOrCreateMaterialAdapter(s),o=new Array;return r.thinFilmWeight=i.iridescenceFactor??0,r.thinFilmIor=i.iridescenceIor??i.iridescenceIOR??1.3,r.thinFilmThicknessMinimum=i.iridescenceThicknessMinimum??100,r.thinFilmThicknessMaximum=i.iridescenceThicknessMaximum??400,i.iridescenceTexture&&o.push(this._loader.loadTextureInfoAsync(`${t}/iridescenceTexture`,i.iridescenceTexture,e=>{e.name=`${s.name} (Iridescence)`,r.thinFilmWeightTexture=e})),i.iridescenceThicknessTexture&&o.push(this._loader.loadTextureInfoAsync(`${t}/iridescenceThicknessTexture`,i.iridescenceThicknessTexture,e=>{e.name=`${s.name} (Iridescence Thickness)`,r.thinFilmThicknessTexture=e})),Promise.all(o).then(()=>{})}}a(n);p(n,!0,m=>new d(m));export{d as KHR_materials_iridescence};
|
assets/KHR_materials_pbrSpecularGlossiness-C3yScQoz.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{Color3 as e}from"./math.color-CzLaKyb6.js";import{PBRMaterial as l}from"./pbrMaterial-BY72QmxQ.js";import{G as n}from"./glTFLoader-BPeiodqB.js";import{u as c,r as a}from"./dynamic-BUKysMyT.js";import"./math.scalar.functions-DkeaWAWz.js";import"./bufferUtils-DTRdUD8L.js";import"./brdfTextureTools-BcdKBp2Y.js";import"./texture-BEqhDl5Y.js";import"./math.vector-C1xyPDEl.js";import"./baseTexture-CgAggsey.js";import"./decorators.serialization-C7d7ykGG.js";import"./tools-D01N7ptR.js";import"./math.plane-Ce_75-g5.js";import"./index-Bx1QoKVU.js";import"./passPostProcess-kvX6RZRb.js";import"./smartArray-CO6iJ0u5.js";import"./effectRenderer-CSz5fi0n.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./math.viewport-CgkTt1RS.js";import"./drawWrapper-CZVk0xN-.js";import"./engine-DaBDhQ20.js";import"./thinEngine-D5ynu8Dd.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./math.axis-Ck7JfPPj.js";import"./math.path-DFucxaHn.js";import"./perfCounter-DusmGz8t.js";import"./textureTools-Dam1Xl1N.js";import"./renderTargetTexture-B0kOC1Jy.js";import"./renderingManager-CiY2OUrf.js";import"./lightConstants-B1TSTh-k.js";import"./scene-gn_hoGMy.js";import"./sceneComponent-Dflhczui.js";import"./deviceInputEvents-BTza-zoR.js";import"./imageProcessing-2WziWti-.js";import"./material.detailMapConfiguration-D1Pl6X8T.js";import"./material-CrEsrP1R.js";import"./subMesh-UWDo5wjI.js";import"./pushMaterial-B8MG1fVH.js";import"./baseTexture.polynomial-BRyqQovE.js";import"./cubemapToSphericalPolynomial-BhsWOHWR.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./node-C-Iu0ALa.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./cameraInputsManager-WrTH9PVf.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const m="KHR_materials_pbrSpecularGlossiness";class d{constructor(s){this.name=m,this.order=200,this._loader=s,this.enabled=this._loader.isExtensionUsed(m)}dispose(){this._loader=null}loadMaterialPropertiesAsync(s,o,r){return n.LoadExtensionAsync(s,o,this.name,async(t,i)=>{const p=new Array;return p.push(this._loader.loadMaterialBasePropertiesAsync(s,o,r)),p.push(this._loadSpecularGlossinessPropertiesAsync(t,i,r)),this._loader.loadMaterialAlphaProperties(s,o,r),await Promise.all(p).then(()=>{})})}_loadSpecularGlossinessPropertiesAsync(s,o,r){if(!(r instanceof l))throw new Error(`${s}: Material type not supported`);const t=new Array;return r.metallic=null,r.roughness=null,o.diffuseFactor?(r.albedoColor=e.FromArray(o.diffuseFactor),r.alpha=o.diffuseFactor[3]):r.albedoColor=e.White(),r.reflectivityColor=o.specularFactor?e.FromArray(o.specularFactor):e.White(),r.microSurface=o.glossinessFactor==null?1:o.glossinessFactor,o.diffuseTexture&&t.push(this._loader.loadTextureInfoAsync(`${s}/diffuseTexture`,o.diffuseTexture,i=>{i.name=`${r.name} (Diffuse)`,r.albedoTexture=i})),o.specularGlossinessTexture&&(t.push(this._loader.loadTextureInfoAsync(`${s}/specularGlossinessTexture`,o.specularGlossinessTexture,i=>{i.name=`${r.name} (Specular Glossiness)`,r.reflectivityTexture=i,r.reflectivityTexture.hasAlpha=!0})),r.useMicroSurfaceFromReflectivityMapAlpha=!0),Promise.all(t).then(()=>{})}}c(m);a(m,!0,u=>new d(u));export{d as KHR_materials_pbrSpecularGlossiness};
|
assets/KHR_materials_sheen-DWUKP0Pn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as p}from"./glTFLoader-BPeiodqB.js";import{Color3 as a}from"./math.color-CzLaKyb6.js";import{u as l,r as d}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const m="KHR_materials_sheen";class c{constructor(r){this.name=m,this.order=190,this._loader=r,this.enabled=this._loader.isExtensionUsed(m)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,e,t){return p.LoadExtensionAsync(r,e,this.name,async(o,s)=>{const n=new Array;return n.push(this._loader.loadMaterialPropertiesAsync(r,e,t)),n.push(this._loadSheenPropertiesAsync(o,s,t)),await Promise.all(n).then(()=>{})})}_loadSheenPropertiesAsync(r,e,t){const o=this._loader._getOrCreateMaterialAdapter(t),s=new Array;o.configureFuzz();const n=e.sheenColorFactor!==void 0?a.FromArray(e.sheenColorFactor):a.Black(),u=e.sheenRoughnessFactor!==void 0?e.sheenRoughnessFactor:0;return o.fuzzWeight=1,o.fuzzColor=n,o.fuzzRoughness=u,e.sheenColorTexture&&s.push(this._loader.loadTextureInfoAsync(`${r}/sheenColorTexture`,e.sheenColorTexture,i=>{i.name=`${t.name} (Sheen Color)`,o.fuzzColorTexture=i})),e.sheenRoughnessTexture&&(e.sheenRoughnessTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync(`${r}/sheenRoughnessTexture`,e.sheenRoughnessTexture,i=>{i.name=`${t.name} (Sheen Roughness)`,o.fuzzRoughnessTexture=i}))),Promise.all(s).then(()=>{})}}l(m);d(m,!0,h=>new c(h));export{c as KHR_materials_sheen};
|
assets/KHR_materials_specular-z6x6B2Wk.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as u}from"./glTFLoader-BPeiodqB.js";import{Color3 as l}from"./math.color-CzLaKyb6.js";import{u as n,r as c}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const i="KHR_materials_specular";class d{constructor(t){this.name=i,this.order=190,this._loader=t,this.enabled=this._loader.isExtensionUsed(i)}dispose(){this._loader=null}loadMaterialPropertiesAsync(t,r,s){return u.LoadExtensionAsync(t,r,this.name,async(a,o)=>{const e=new Array;e.push(this._loader.loadMaterialPropertiesAsync(t,r,s)),e.push(this._loadSpecularPropertiesAsync(a,o,s));const m=this._loader._getOrCreateMaterialAdapter(s);return o.extensions&&o.extensions.EXT_materials_specular_edge_color&&o.extensions.EXT_materials_specular_edge_color.specularEdgeColorEnabled&&m.enableSpecularEdgeColor(!0),await Promise.all(e).then(()=>{})})}_loadSpecularPropertiesAsync(t,r,s){const a=this._loader._getOrCreateMaterialAdapter(s),o=new Array;return a.specularWeight=r.specularFactor??1,a.specularColor=r.specularColorFactor!==void 0?l.FromArray(r.specularColorFactor):new l(1,1,1),r.specularTexture&&(r.specularTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync(`${t}/specularTexture`,r.specularTexture,e=>{e.name=`${s.name} (Specular)`,a.specularWeightTexture=e}))),r.specularColorTexture&&o.push(this._loader.loadTextureInfoAsync(`${t}/specularColorTexture`,r.specularColorTexture,e=>{e.name=`${s.name} (Specular Color)`,a.specularColorTexture=e})),Promise.all(o).then(()=>{})}}n(i);c(i,!0,p=>new d(p));export{d as KHR_materials_specular};
|
assets/KHR_materials_transmission-BOMnlenZ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as u}from"./glTFLoader-BPeiodqB.js";import{R as c}from"./renderTargetTexture-B0kOC1Jy.js";import{O as m}from"./math.vector-C1xyPDEl.js";import{C as g}from"./objectModelMapping-DWcnlpHl.js";import{T}from"./tools-D01N7ptR.js";import{u as f,r as M}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.color-CzLaKyb6.js";import"./math.scalar.functions-DkeaWAWz.js";import"./mesh-Fj-9677A.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";class p{static _GetDefaultOptions(){return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:g.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}}constructor(e,s,t){this._opaqueRenderTarget=null,this._opaqueMeshesCache=[],this._transparentMeshesCache=[],this._materialObservers={},this._options={...p._GetDefaultOptions(),...e},this._scene=s,this._scene._transmissionHelper=this,this._loader=t,this.onErrorObservable=new m,this._scene.onDisposeObservable.addOnce(()=>{this.dispose()}),this._parseScene(),this._setupRenderTargets()}updateOptions(e){if(!Object.keys(e).filter(i=>this._options[i]!==e[i]).length)return;const t={...this._options,...e},r=this._options;this._options=t,t.renderSize!==r.renderSize||t.renderTargetTextureType!==r.renderTargetTextureType||t.generateMipmaps!==r.generateMipmaps||!this._opaqueRenderTarget?this._setupRenderTargets():(this._opaqueRenderTarget.samples=t.samples,this._opaqueRenderTarget.lodGenerationScale=t.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=t.lodGenerationOffset)}getOpaqueTarget(){return this._opaqueRenderTarget}_addMesh(e){this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),T.SetImmediate(()=>{if(e.material){if(!this._loader.isMatchingMaterialType(e.material))return;const s=this._loader._getOrCreateMaterialAdapter(e.material);s.transmissionWeight>0?(s.refractionBackgroundTexture=this._opaqueRenderTarget,this._transparentMeshesCache.indexOf(e)===-1&&this._transparentMeshesCache.push(e)):this._opaqueMeshesCache.indexOf(e)===-1&&this._opaqueMeshesCache.push(e)}})}_removeMesh(e){e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];let s=this._transparentMeshesCache.indexOf(e);s!==-1&&this._transparentMeshesCache.splice(s,1),s=this._opaqueMeshesCache.indexOf(e),s!==-1&&this._opaqueMeshesCache.splice(s,1)}_parseScene(){this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))}_onMeshMaterialChanged(e){const s=this._transparentMeshesCache.indexOf(e),t=this._opaqueMeshesCache.indexOf(e);if(!this._loader.isMatchingMaterialType(e.material))return;const r=e.material?this._loader._getOrCreateMaterialAdapter(e.material):null;(r?r.transmissionWeight>0:!1)?(r&&(r.refractionBackgroundTexture=this._opaqueRenderTarget),t!==-1?(this._opaqueMeshesCache.splice(t,1),this._transparentMeshesCache.push(e)):s===-1&&this._transparentMeshesCache.push(e)):s!==-1?(this._transparentMeshesCache.splice(s,1),this._opaqueMeshesCache.push(e)):t===-1&&this._opaqueMeshesCache.push(e)}_isRenderTargetValid(){var e;return((e=this._opaqueRenderTarget)==null?void 0:e.getInternalTexture())!==null}_setupRenderTargets(){var s;this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new c("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=((s=this._options.clearColor)==null?void 0:s.clone())??this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.renderSprites=!0,this._opaqueRenderTarget.renderParticles=!0,this._opaqueRenderTarget.disableImageProcessing=!0;let e;this._opaqueRenderTarget.onBeforeBindObservable.add(t=>{e=this._scene.environmentIntensity,this._scene.environmentIntensity=1,this._options.clearColor?t.clearColor.copyFrom(this._options.clearColor):this._scene.clearColor.toLinearSpaceToRef(t.clearColor,this._scene.getEngine().useExactSrgbConversions)}),this._opaqueRenderTarget.onAfterUnbindObservable.add(()=>{this._scene.environmentIntensity=e});for(const t of this._transparentMeshesCache)if(t.material){if(!this._loader.isMatchingMaterialType(t.material))return;const r=this._loader._getOrCreateMaterialAdapter(t.material);r.transmissionWeight>0&&(r.refractionBackgroundTexture=this._opaqueRenderTarget)}}dispose(){this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]}}const o="KHR_materials_transmission";class q{constructor(e){this.name=o,this.order=175,this._loader=e,this.enabled=this._loader.isExtensionUsed(o),this.enabled&&(e.parent.transparencyAsCoverage=!0)}dispose(){this._loader=null}loadMaterialPropertiesAsync(e,s,t){return u.LoadExtensionAsync(e,s,this.name,async(r,i)=>{const a=new Array;return a.push(this._loader.loadMaterialPropertiesAsync(e,s,t)),a.push(this._loadTransparentPropertiesAsync(r,s,t,i)),await Promise.all(a).then(()=>{})})}_loadTransparentPropertiesAsync(e,s,t,r){var l,_;const i=this._loader._getOrCreateMaterialAdapter(t),a=r.transmissionFactor!==void 0?r.transmissionFactor:0;if(a===0||!i)return Promise.resolve();if(i.configureTransmission(),i.transmissionWeight=a,a>0&&!this._loader.parent.dontUseTransmissionHelper){const n=t.getScene();n._transmissionHelper?(l=n._transmissionHelper)!=null&&l._isRenderTargetValid()||(_=n._transmissionHelper)==null||_._setupRenderTargets():new p({},t.getScene(),this._loader)}let d=Promise.resolve(null);return r.transmissionTexture&&(r.transmissionTexture.nonColorData=!0,d=this._loader.loadTextureInfoAsync(`${e}/transmissionTexture`,r.transmissionTexture,n=>{n.name=`${t.name} (Transmission)`,i.transmissionWeightTexture=n})),d.then(()=>{})}}f(o);M(o,!0,h=>new q(h));export{q as KHR_materials_transmission};
|
assets/KHR_materials_unlit-CTd-ysfe.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{Color3 as l}from"./math.color-CzLaKyb6.js";import{G as n}from"./glTFLoader-BPeiodqB.js";import{u as d,r as u}from"./dynamic-BUKysMyT.js";import"./math.scalar.functions-DkeaWAWz.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const s="KHR_materials_unlit";class c{constructor(r){this.name=s,this.order=210,this._loader=r,this.enabled=this._loader.isExtensionUsed(s)}dispose(){this._loader=null}loadMaterialPropertiesAsync(r,o,e){return n.LoadExtensionAsync(r,o,this.name,async()=>await this._loadUnlitPropertiesAsync(r,o,e))}_loadUnlitPropertiesAsync(r,o,e){const t=this._loader._getOrCreateMaterialAdapter(e),m=new Array,i=o.pbrMetallicRoughness;return i&&(i.baseColorFactor&&(t.baseColor=l.FromArray(i.baseColorFactor),t.geometryOpacity=i.baseColorFactor[3]),i.baseColorTexture&&m.push(this._loader.loadTextureInfoAsync(`${r}/baseColorTexture`,i.baseColorTexture,a=>{a.name=`${e.name} (Base Color)`,t.baseColorTexture=a}))),t.isUnlit=!0,o.doubleSided&&(t.backFaceCulling=!1,t.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(r,o,e),Promise.all(m).then(()=>{})}}d(s);u(s,!0,p=>new c(p));export{c as KHR_materials_unlit};
|
assets/KHR_materials_variants-CR-weLGR.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as S,A as L}from"./glTFLoader-BPeiodqB.js";import{M as O}from"./mesh-Fj-9677A.js";import{u as C,r as I}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./cameraInputsManager-WrTH9PVf.js";import"./math.axis-Ck7JfPPj.js";import"./node-C-Iu0ALa.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./math.plane-Ce_75-g5.js";import"./animation-IftAdLIx.js";import"./material-CrEsrP1R.js";import"./subMesh-UWDo5wjI.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./drawWrapper-CZVk0xN-.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./smartArray-CO6iJ0u5.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./math.viewport-CgkTt1RS.js";const r="KHR_materials_variants";class s{constructor(t){this.name=r,this._loader=t,this.enabled=this._loader.isExtensionUsed(r)&&!this._loader.parent.skipMaterials}dispose(){this._loader=null}static GetAvailableVariants(t){const a=this._GetExtensionMetadata(t);return a?Object.keys(a.variants):[]}getAvailableVariants(t){return s.GetAvailableVariants(t)}static SelectVariant(t,a){const e=this._GetExtensionMetadata(t);if(!e)throw new Error(`Cannot select variant on a glTF mesh that does not have the ${r} extension`);const o=c=>{const p=e.variants[c];if(p)for(const h of p)h.mesh.material=h.material};if(a instanceof Array)for(const c of a)o(c);else o(a);e.lastSelected=a}selectVariant(t,a){s.SelectVariant(t,a)}static Reset(t){const a=this._GetExtensionMetadata(t);if(!a)throw new Error(`Cannot reset on a glTF mesh that does not have the ${r} extension`);for(const e of a.original)e.mesh.material=e.material;a.lastSelected=null}reset(t){s.Reset(t)}static GetLastSelectedVariant(t){const a=this._GetExtensionMetadata(t);if(!a)throw new Error(`Cannot get the last selected variant on a glTF mesh that does not have the ${r} extension`);return a.lastSelected}getLastSelectedVariant(t){return s.GetLastSelectedVariant(t)}static _GetExtensionMetadata(t){var a,e;return((e=(a=t==null?void 0:t._internalMetadata)==null?void 0:a.gltf)==null?void 0:e[r])||null}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const a=t[this.name];this._variants=a.variants}}onReady(){var a;const t=this._loader.rootBabylonMesh;if(t){const e=this._loader.parent.extensionOptions[r];e!=null&&e.defaultVariant&&s.SelectVariant(t,e.defaultVariant),(a=e==null?void 0:e.onLoaded)==null||a.call(e,{get variants(){return s.GetAvailableVariants(t)},get selectedVariant(){const o=s.GetLastSelectedVariant(t);return o?Array.isArray(o)?o[0]:o:s.GetAvailableVariants(t)[0]},set selectedVariant(o){s.SelectVariant(t,o)}})}}_loadMeshPrimitiveAsync(t,a,e,o,c,p){return S.LoadExtensionAsync(t,c,this.name,async(h,V)=>{const x=new Array;return x.push(this._loader._loadMeshPrimitiveAsync(t,a,e,o,c,l=>{if(p(l),l instanceof O){const $=S._GetDrawMode(t,c.mode),d=this._loader.rootBabylonMesh,A=d?d._internalMetadata=d._internalMetadata||{}:{},E=A.gltf=A.gltf||{},f=E[r]=E[r]||{lastSelected:null,original:[],variants:{}};f.original.push({mesh:l,material:l.material});for(let g=0;g<V.mappings.length;++g){const u=V.mappings[g],F=L.Get(`${h}/mappings/${g}/material`,this._loader.gltf.materials,u.material);x.push(this._loader._loadMaterialAsync(`#/materials/${u.material}`,F,l,$,T=>{for(let v=0;v<u.variants.length;++v){const w=u.variants[v],M=L.Get(`/extensions/${r}/variants/${w}`,this._variants,w);f.variants[M.name]=f.variants[M.name]||[],f.variants[M.name].push({mesh:l,material:T}),l.onClonedObservable.add(k=>{const G=k;let m,i=G;do{if(i=i.parent,!i)return;m=s._GetExtensionMetadata(i)}while(m===null);if(d&&m===s._GetExtensionMetadata(d)){i._internalMetadata={};for(const n in d._internalMetadata)i._internalMetadata[n]=d._internalMetadata[n];i._internalMetadata.gltf=[];for(const n in d._internalMetadata.gltf)i._internalMetadata.gltf[n]=d._internalMetadata.gltf[n];i._internalMetadata.gltf[r]={lastSelected:null,original:[],variants:{}};for(const n of m.original)i._internalMetadata.gltf[r].original.push({mesh:n.mesh,material:n.material});for(const n in m.variants)if(Object.prototype.hasOwnProperty.call(m.variants,n)){i._internalMetadata.gltf[r].variants[n]=[];for(const y of m.variants[n])i._internalMetadata.gltf[r].variants[n].push({mesh:y.mesh,material:y.material})}m=i._internalMetadata.gltf[r]}for(const n of m.original)n.mesh===l&&(n.mesh=G);for(const n of m.variants[M.name])n.mesh===l&&(n.mesh=G)})}}))}}})),await Promise.all(x).then(([l])=>l)})}}C(r);I(r,!0,_=>new s(_));export{s as KHR_materials_variants};
|
assets/KHR_materials_volume-DyryNepY.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{Color3 as h}from"./math.color-CzLaKyb6.js";import{G as u}from"./glTFLoader-BPeiodqB.js";import{u as d,r as _}from"./dynamic-BUKysMyT.js";import{V as f}from"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./index-Bx1QoKVU.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const n="KHR_materials_volume";class A{constructor(o){this.name=n,this.order=173,this._loader=o,this.enabled=this._loader.isExtensionUsed(n),this.enabled&&this._loader._disableInstancedMesh++}dispose(){this.enabled&&this._loader._disableInstancedMesh--,this._loader=null}loadMaterialPropertiesAsync(o,s,e){return u.LoadExtensionAsync(o,s,this.name,async(t,r)=>{const i=new Array;return i.push(this._loader.loadMaterialPropertiesAsync(o,s,e)),i.push(this._loadVolumePropertiesAsync(t,s,e,r)),await Promise.all(i).then(()=>{})})}_loadVolumePropertiesAsync(o,s,e,t){const r=this._loader._getOrCreateMaterialAdapter(e);if(r.transmissionWeight===0&&r.subsurfaceWeight===0||!t.thicknessFactor)return Promise.resolve();const i=t.attenuationDistance!==void 0?t.attenuationDistance:Number.MAX_VALUE,a=t.attenuationColor!==void 0&&t.attenuationColor.length==3?h.FromArray(t.attenuationColor):h.White(),p=new f(-Math.log(a.r),-Math.log(a.g),-Math.log(a.b));p.scaleInPlace(1/Math.max(i,.001)),r.extinctionCoefficient=p,r.transmissionDepth=i,r.transmissionColor=a,r.volumeThickness=t.thicknessFactor??0;const l=new Array;return t.thicknessTexture&&(t.thicknessTexture.nonColorData=!0,l.push(this._loader.loadTextureInfoAsync(`${o}/thicknessTexture`,t.thicknessTexture,c=>{c.name=`${e.name} (Thickness)`,r.volumeThicknessTexture=c}))),Promise.all(l).then(()=>{})}}d(n);_(n,!0,m=>new A(m));export{A as KHR_materials_volume};
|
assets/KHR_materials_volume_scatter-Dilc3FVg.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{Color3 as p}from"./math.color-CzLaKyb6.js";import{V as s}from"./math.vector-C1xyPDEl.js";import{G as y}from"./glTFLoader-BPeiodqB.js";import{u as C,r as _}from"./dynamic-BUKysMyT.js";import"./math.scalar.functions-DkeaWAWz.js";import"./index-Bx1QoKVU.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const c="KHR_materials_volume_scatter";function x(n){const r=new s(n.r,n.g,n.b),i=new s(4.09712,4.09712,4.09712);i.multiplyInPlace(r),i.addInPlace(new s(4.20863,4.20863,4.20863));const e=new s(9.59217,9.59217,9.59217);return e.addInPlace(new s(41.6808,41.6808,41.6808).multiplyInPlace(r)),e.addInPlace(new s(17.7126,17.7126,17.7126).multiplyInPlace(r.multiply(r))),i.subtractInPlace(new s(Math.sqrt(e.x),Math.sqrt(e.y),Math.sqrt(e.z))),new s(1,1,1).subtract(i.multiply(i))}class A{constructor(r){this.name=c,this.order=172,this._loader=r,this.enabled=this._loader.isExtensionUsed(c),this.enabled&&this._loader._disableInstancedMesh++}dispose(){this.enabled&&this._loader._disableInstancedMesh--,this._loader=null}loadMaterialPropertiesAsync(r,i,e){return y.LoadExtensionAsync(r,i,this.name,async(o,t)=>{const l=new Array;return l.push(this._loader.loadMaterialPropertiesAsync(r,i,e)),l.push(this._loadVolumePropertiesAsync(o,i,e,t)),await Promise.all(l).then(()=>{})})}_loadVolumePropertiesAsync(r,i,e,o){const t=this._loader._getOrCreateMaterialAdapter(e);if(t.transmissionWeight===0&&t.subsurfaceWeight===0)return Promise.resolve();const l=o.multiscatterColor!==void 0&&o.multiscatterColor.length==3?p.FromArray(o.multiscatterColor):p.Black(),u=o.scatterAnisotropy!==void 0?o.scatterAnisotropy:0;if(t.transmissionWeight>0){const a=x(l),d=new s(-Math.log(t.transmissionColor.r),-Math.log(t.transmissionColor.g),-Math.log(t.transmissionColor.b));d.scaleInPlace(1/Math.max(t.transmissionDepth,.001));const m=d.multiply(a);m.scaleInPlace(t.transmissionDepth),t.transmissionScatter.set(m.x,m.y,m.z);let f=Promise.resolve(null);return o.multiscatterColorTexture&&(o.multiscatterColorTexture.nonColorData=!0,f=this._loader.loadTextureInfoAsync(`${r}/multiscatterColorTexture`,o.multiscatterColorTexture,h=>{h.name=`${e.name} (Transmission)`,t.transmissionWeightTexture=h})),t.transmissionScatterAnisotropy=u,f.then(()=>{})}if(t.subsurfaceWeight>0){t.subsurfaceScatterAnisotropy=u,t.subsurfaceColor=l;const a=new s(t.extinctionCoefficient.x!==0?1/t.extinctionCoefficient.x:1,t.extinctionCoefficient.y!==0?1/t.extinctionCoefficient.y:1,t.extinctionCoefficient.z!==0?1/t.extinctionCoefficient.z:1);t.subsurfaceRadius=Math.max(a.x,a.y,a.z),t.subsurfaceRadiusScale=new p(a.x/t.subsurfaceRadius,a.y/t.subsurfaceRadius,a.z/t.subsurfaceRadius)}return Promise.resolve()}}C(c);_(c,!0,n=>new A(n));export{A as KHR_materials_volume_scatter};
|
assets/KHR_mesh_quantization-DRY1BM2Q.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as r,r as m}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./sceneLoader-CutT-qCn.js";import"./tools-D01N7ptR.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./math.color-CzLaKyb6.js";import"./scene-gn_hoGMy.js";import"./smartArray-CO6iJ0u5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./renderingManager-CiY2OUrf.js";import"./deviceInputEvents-BTza-zoR.js";import"./perfCounter-DusmGz8t.js";import"./sceneLoaderFlags-wywyb9ml.js";const t="KHR_mesh_quantization";class p{constructor(o){this.name=t,this.enabled=o.isExtensionUsed(t)}dispose(){}}r(t);m(t,!0,i=>new p(i));export{p as KHR_mesh_quantization};
|
assets/KHR_node_hoverability-k_keZPJw.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as k,r as B}from"./dynamic-BUKysMyT.js";import{e as b}from"./declarationMapper-oEUQrCmY.js";import{A as y}from"./objectModelMapping-DWcnlpHl.js";import"./index-Bx1QoKVU.js";import"./sceneLoader-CutT-qCn.js";import"./tools-D01N7ptR.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./math.color-CzLaKyb6.js";import"./scene-gn_hoGMy.js";import"./smartArray-CO6iJ0u5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./renderingManager-CiY2OUrf.js";import"./deviceInputEvents-BTza-zoR.js";import"./perfCounter-DusmGz8t.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./node-C-Iu0ALa.js";import"./light-DT53MGnW.js";import"./math.axis-Ck7JfPPj.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";const p="KHR_node_hoverability",I="targetMeshPointerOver_";b("event/onHoverIn",p,{blocks:["FlowGraphPointerOverEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(o){return I+o}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshUnderPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(o,n,i,s,t,u,e){var c,l,m,h,f,v,x;const a=t[t.length-1];a.config=a.config||{},a.config.glTF=e;const r=(m=(l=(c=o.configuration)==null?void 0:c.nodeIndex)==null?void 0:l.value)==null?void 0:m[0];if(r===void 0||typeof r!="number")throw new Error("nodeIndex not found in configuration");const d=I+r;return t[1].config.variable=d,u._userVariables[d]={className:"Mesh",id:(f=(h=e==null?void 0:e.nodes)==null?void 0:h[r]._babylonTransformNode)==null?void 0:f.id,uniqueId:(x=(v=e==null?void 0:e.nodes)==null?void 0:v[r]._babylonTransformNode)==null?void 0:x.uniqueId},t}});const _="targetMeshPointerOut_";b("event/onHoverOut",p,{blocks:["FlowGraphPointerOutEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(o){return _+o}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshOutOfPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(o,n,i,s,t,u,e){var c,l,m,h,f,v,x;const a=t[t.length-1];a.config=a.config||{},a.config.glTF=e;const r=(m=(l=(c=o.configuration)==null?void 0:c.nodeIndex)==null?void 0:l.value)==null?void 0:m[0];if(r===void 0||typeof r!="number")throw new Error("nodeIndex not found in configuration");const d=_+r;return t[1].config.variable=d,u._userVariables[d]={className:"Mesh",id:(f=(h=e==null?void 0:e.nodes)==null?void 0:h[r]._babylonTransformNode)==null?void 0:f.id,uniqueId:(x=(v=e==null?void 0:e.nodes)==null?void 0:v[r]._babylonTransformNode)==null?void 0:x.uniqueId},t}});y("/nodes/{}/extensions/KHR_node_hoverability/hoverable",{get:o=>{const n=o._babylonTransformNode;return n&&n.pointerOverDisableMeshTesting!==void 0?n.pointerOverDisableMeshTesting:!0},set:(o,n)=>{var i;(i=n._primitiveBabylonMeshes)==null||i.forEach(s=>{s.pointerOverDisableMeshTesting=!o})},getTarget:o=>o._babylonTransformNode,getPropertyName:[()=>"pointerOverDisableMeshTesting"],type:"boolean"});class g{constructor(n){this.name=p,this._loader=n,this.enabled=n.isExtensionUsed(p)}async onReady(){var n;(n=this._loader.gltf.nodes)==null||n.forEach(i=>{var s,t,u;(s=i.extensions)!=null&&s.KHR_node_hoverability&&((t=i.extensions)==null?void 0:t.KHR_node_hoverability.hoverable)===!1&&((u=i._babylonTransformNode)==null||u.getChildMeshes().forEach(e=>{e.pointerOverDisableMeshTesting=!0}))})}dispose(){this._loader=null}}k(p);B(p,!0,o=>new g(o));export{g as KHR_node_hoverability};
|
assets/KHR_node_selectability-CWoTfyY_.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as h,r as x}from"./dynamic-BUKysMyT.js";import{e as y}from"./declarationMapper-oEUQrCmY.js";import{A as I}from"./objectModelMapping-DWcnlpHl.js";import"./index-Bx1QoKVU.js";import"./sceneLoader-CutT-qCn.js";import"./tools-D01N7ptR.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./math.color-CzLaKyb6.js";import"./scene-gn_hoGMy.js";import"./smartArray-CO6iJ0u5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./renderingManager-CiY2OUrf.js";import"./deviceInputEvents-BTza-zoR.js";import"./perfCounter-DusmGz8t.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./node-C-Iu0ALa.js";import"./light-DT53MGnW.js";import"./math.axis-Ck7JfPPj.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";const s="KHR_node_selectability";y("event/onSelect",s,{blocks:["FlowGraphMeshPickEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer(e){return"pickedMesh_"+e}}},outputs:{values:{selectedNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"},selectionPoint:{name:"pickedPoint"},selectionRayOrigin:{name:"pickOrigin"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"asset",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"pickedMesh",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor(e,o,i,r,n,p,t){var l,m,u,f,b,k,_;const c=n[n.length-1];c.config=c.config||{},c.config.glTF=t;const a=(u=(m=(l=e.configuration)==null?void 0:l.nodeIndex)==null?void 0:m.value)==null?void 0:u[0];if(a===void 0||typeof a!="number")throw new Error("nodeIndex not found in configuration");const d="pickedMesh_"+a;return n[1].config.variable=d,p._userVariables[d]={className:"Mesh",id:(b=(f=t==null?void 0:t.nodes)==null?void 0:f[a]._babylonTransformNode)==null?void 0:b.id,uniqueId:(_=(k=t==null?void 0:t.nodes)==null?void 0:k[a]._babylonTransformNode)==null?void 0:_.uniqueId},n}});I("/nodes/{}/extensions/KHR_node_selectability/selectable",{get:e=>{const o=e._babylonTransformNode;return o&&o.isPickable!==void 0?o.isPickable:!0},set:(e,o)=>{var i;(i=o._primitiveBabylonMeshes)==null||i.forEach(r=>{r.isPickable=e})},getTarget:e=>e._babylonTransformNode,getPropertyName:[()=>"isPickable"],type:"boolean"});class B{constructor(o){this.name=s,this._loader=o,this.enabled=o.isExtensionUsed(s)}async onReady(){var o;(o=this._loader.gltf.nodes)==null||o.forEach(i=>{var r,n,p;(r=i.extensions)!=null&&r.KHR_node_selectability&&((n=i.extensions)==null?void 0:n.KHR_node_selectability.selectable)===!1&&((p=i._babylonTransformNode)==null||p.getChildMeshes().forEach(t=>{t.isPickable=!1}))})}dispose(){this._loader=null}}h(s);x(s,!0,e=>new B(e));export{B as KHR_node_selectability};
|
assets/KHR_node_visibility-Dxpqh4YG.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as n,r as m}from"./dynamic-BUKysMyT.js";import{A as b}from"./objectModelMapping-DWcnlpHl.js";import"./index-Bx1QoKVU.js";import"./sceneLoader-CutT-qCn.js";import"./tools-D01N7ptR.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./math.color-CzLaKyb6.js";import"./scene-gn_hoGMy.js";import"./smartArray-CO6iJ0u5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./renderingManager-CiY2OUrf.js";import"./deviceInputEvents-BTza-zoR.js";import"./perfCounter-DusmGz8t.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./node-C-Iu0ALa.js";import"./light-DT53MGnW.js";import"./math.axis-Ck7JfPPj.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";const s="KHR_node_visibility";b("/nodes/{}/extensions/KHR_node_visibility/visible",{get:o=>{const i=o._babylonTransformNode;return i&&i.isVisible!==void 0?i.isVisible:!0},set:(o,i)=>{var e,t;(e=i._primitiveBabylonMeshes)==null||e.forEach(r=>{r.inheritVisibility=!0}),i._babylonTransformNode&&(i._babylonTransformNode.isVisible=o),(t=i._primitiveBabylonMeshes)==null||t.forEach(r=>{r.isVisible=o})},getTarget:o=>o._babylonTransformNode,getPropertyName:[()=>"isVisible"],type:"boolean"});class l{constructor(i){this.name=s,this._loader=i,this.enabled=i.isExtensionUsed(s)}onReady(){if(!this._loader)return;const i=this._loader.gltf.nodes;if(i)for(const e of i){const t=e._babylonTransformNode;t&&(t.inheritVisibility=!0,e.extensions&&e.extensions.KHR_node_visibility&&e.extensions.KHR_node_visibility.visible===!1&&(t.isVisible=!1))}}dispose(){delete this._loader}}n(s);m(s,!0,o=>new l(o));export{l as KHR_node_visibility};
|
assets/KHR_texture_basisu-wb_QWhaW.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as m,A as e}from"./glTFLoader-BPeiodqB.js";import{u as d,r as _}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const o="KHR_texture_basisu";class c{constructor(r){this.name=o,this._loader=r,this.enabled=r.isExtensionUsed(o)}dispose(){this._loader=null}_loadTextureAsync(r,t,p){return m.LoadExtensionAsync(r,t,this.name,async(s,a)=>{const n=t.sampler==null?m.DefaultSampler:e.Get(`${r}/sampler`,this._loader.gltf.samplers,t.sampler),l=e.Get(`${s}/source`,this._loader.gltf.images,a.source);return await this._loader._createTextureAsync(r,n,l,u=>{p(u)},t._textureInfo.nonColorData?{useRGBAIfASTCBC7NotAvailableWhenUASTC:!0}:void 0,!t._textureInfo.nonColorData)})}}d(o);_(o,!0,i=>new c(i));export{c as KHR_texture_basisu};
|
assets/KHR_texture_transform-BDMWBq3N.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{T as f}from"./texture-BEqhDl5Y.js";import{G as e}from"./glTFLoader-BPeiodqB.js";import{u as d,r as c}from"./dynamic-BUKysMyT.js";import"./bufferUtils-DTRdUD8L.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./baseTexture-CgAggsey.js";import"./decorators.serialization-C7d7ykGG.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./math.plane-Ce_75-g5.js";import"./index-Bx1QoKVU.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const i="KHR_texture_transform";class n{constructor(o){this.name=i,this._loader=o,this.enabled=this._loader.isExtensionUsed(i)}dispose(){this._loader=null}loadTextureInfoAsync(o,p,s){return e.LoadExtensionAsync(o,p,this.name,async(a,r)=>await this._loader.loadTextureInfoAsync(o,p,t=>{if(!(t instanceof f))throw new Error(`${a}: Texture type not supported`);r.offset&&(t.uOffset=r.offset[0],t.vOffset=r.offset[1]),t.uRotationCenter=0,t.vRotationCenter=0,r.rotation&&(t.wAng=-r.rotation),r.scale&&(t.uScale=r.scale[0],t.vScale=r.scale[1]),r.texCoord!=null&&(t.coordinatesIndex=r.texCoord),s(t)}))}}d(i);c(i,!0,m=>new n(m));export{n as KHR_texture_transform};
|
assets/KHR_xmp_json_ld-kzuW6Xgd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{u as n,r as m}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./sceneLoader-CutT-qCn.js";import"./tools-D01N7ptR.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./math.color-CzLaKyb6.js";import"./scene-gn_hoGMy.js";import"./smartArray-CO6iJ0u5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./renderingManager-CiY2OUrf.js";import"./deviceInputEvents-BTza-zoR.js";import"./perfCounter-DusmGz8t.js";import"./sceneLoaderFlags-wywyb9ml.js";const o="KHR_xmp_json_ld";class l{constructor(t){this.name=o,this.order=100,this._loader=t,this.enabled=this._loader.isExtensionUsed(o)}dispose(){this._loader=null}onLoading(){var e,i,a;if(this._loader.rootBabylonMesh===null)return;const t=(e=this._loader.gltf.extensions)==null?void 0:e.KHR_xmp_json_ld,s=(a=(i=this._loader.gltf.asset)==null?void 0:i.extensions)==null?void 0:a.KHR_xmp_json_ld;if(t&&s){const p=+s.packet;t.packets&&p<t.packets.length&&(this._loader.rootBabylonMesh.metadata=this._loader.rootBabylonMesh.metadata||{},this._loader.rootBabylonMesh.metadata.xmp=t.packets[p])}}}n(o);m(o,!0,r=>new l(r));export{l as KHR_xmp_json_ld};
|
assets/LineageSection-CRyR37ec.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
var ur=Object.defineProperty;var ut=e=>{throw TypeError(e)};var hr=(e,t,r)=>t in e?ur(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ht=(e,t,r)=>hr(e,typeof t!="symbol"?t+"":t,r),Ve=(e,t,r)=>t.has(e)||ut("Cannot "+r);var oe=(e,t,r)=>(Ve(e,t,"read from private field"),r?r.call(e):t.get(e)),ke=(e,t,r)=>t.has(e)?ut("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ge=(e,t,r,n)=>(Ve(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ft=(e,t,r)=>(Ve(e,t,"access private method"),r);import{e as fr,u as gr,a as Ue,p as et,b as Z,s as te,c as Tt,d as tt,g as h,f as y,h as O,i as H,j as vr,t as K,k as Be,l as V,m as pr,n as L,o as rt,q as j,r as Le,v as W,w as fe,x as B,y as ee,z as R,A as Ie,B as le,C as Pt,D as Qe,E as br,F as mr,S as _r,G as wr,H as gt,I as vt,J as Er,K as yr}from"./index-Bx1QoKVU.js";var de,be,Ne,Se,St;const Fe=class Fe{constructor(t){ke(this,Se);ke(this,de,new WeakMap);ke(this,be);ke(this,Ne);Ge(this,Ne,t)}observe(t,r){var n=oe(this,de).get(t)||new Set;return n.add(r),oe(this,de).set(t,n),ft(this,Se,St).call(this).observe(t,oe(this,Ne)),()=>{var o=oe(this,de).get(t);o.delete(r),o.size===0&&(oe(this,de).delete(t),oe(this,be).unobserve(t))}}};de=new WeakMap,be=new WeakMap,Ne=new WeakMap,Se=new WeakSet,St=function(){return oe(this,be)??Ge(this,be,new ResizeObserver(t=>{for(var r of t){Fe.entries.set(r.target,r);for(var n of oe(this,de).get(r.target)||[])n(r)}}))},ht(Fe,"entries",new WeakMap);let $e=Fe;var kr=new $e({box:"border-box"});function pt(e,t,r){var n=kr.observe(e,()=>r(e[t]));fr(()=>(gr(()=>r(e[t])),n))}var Ft=Object.defineProperty,xr=(e,t,r)=>t in e?Ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Or=(e,t)=>{for(var r in t)Ft(e,r,{get:t[r],enumerable:!0})},Nr=(e,t,r)=>xr(e,t+"",r),Dt={};Or(Dt,{Graph:()=>J,alg:()=>nt,json:()=>qt,version:()=>jr});var Ir=Object.defineProperty,Rt=(e,t)=>{for(var r in t)Ir(e,r,{get:t[r],enumerable:!0})},J=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(r=>{t!==void 0?this.setNode(r,t):this.setNode(r)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=r=>this.removeEdge(this._edgeObjs[r]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(r=>{this.setParent(r)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let r=t;r!==void 0;r=this.parent(r))if(r===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let r=new Set(t);for(let n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([o,s])=>{e(o)&&t.setNode(o,s)}),Object.values(this._edgeObjs).forEach(o=>{t.hasNode(o.v)&&t.hasNode(o.w)&&t.setEdge(o,this.edge(o))});let r={},n=o=>{let s=this.parent(o);return!s||t.hasNode(s)?(r[o]=s??void 0,s??void 0):s in r?r[s]:n(s)};return this._isCompound&&t.nodes().forEach(o=>t.setParent(o,n(o))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((r,n)=>(t!==void 0?this.setEdge(r,n,t):this.setEdge(r,n),n)),this}setEdge(e,t,r,n){let o,s,i,a,d=!1;typeof e=="object"&&e!==null&&"v"in e?(o=e.v,s=e.w,i=e.name,arguments.length===2&&(a=t,d=!0)):(o=e,s=t,i=n,arguments.length>2&&(a=r,d=!0)),o=""+o,s=""+s,i!==void 0&&(i=""+i);let l=xe(this._isDirected,o,s,i);if(l in this._edgeLabels)return d&&(this._edgeLabels[l]=a),this;if(i!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(o),this.setNode(s),this._edgeLabels[l]=d?a:this._defaultEdgeLabelFn(o,s,i);let c=Mr(this._isDirected,o,s,i);return o=c.v,s=c.w,Object.freeze(c),this._edgeObjs[l]=c,bt(this._preds[s],o),bt(this._sucs[o],s),this._in[s][l]=c,this._out[o][l]=c,this._edgeCount++,this}edge(e,t,r){let n=arguments.length===1?ze(this._isDirected,e):xe(this._isDirected,e,t,r);return this._edgeLabels[n]}edgeAsObj(e,t,r){let n=arguments.length===1?this.edge(e):this.edge(e,t,r);return typeof n!="object"?{label:n}:n}hasEdge(e,t,r){return(arguments.length===1?ze(this._isDirected,e):xe(this._isDirected,e,t,r))in this._edgeLabels}removeEdge(e,t,r){let n=arguments.length===1?ze(this._isDirected,e):xe(this._isDirected,e,t,r),o=this._edgeObjs[n];if(o){let s=o.v,i=o.w;delete this._edgeLabels[n],delete this._edgeObjs[n],mt(this._preds[i],s),mt(this._sucs[s],i),delete this._in[i][n],delete this._out[s][n],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,r){if(!e)return;let n=Object.values(e);return r?n.filter(o=>o.v===t&&o.w===r||o.v===r&&o.w===t):n}};function bt(e,t){e[t]?e[t]++:e[t]=1}function mt(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function xe(e,t,r,n){let o=""+t,s=""+r;if(!e&&o>s){let i=o;o=s,s=i}return o+""+s+""+(n===void 0?"\0":n)}function Mr(e,t,r,n){let o=""+t,s=""+r;if(!e&&o>s){let a=o;o=s,s=a}let i={v:o,w:s};return n&&(i.name=n),i}function ze(e,t){return xe(e,t.v,t.w,t.name)}var jr="4.0.1",qt={};Rt(qt,{read:()=>Pr,write:()=>Lr});function Lr(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Cr(e),edges:Tr(e)},r=e.graph();return r!==void 0&&(t.value=structuredClone(r)),t}function Cr(e){return e.nodes().map(t=>{let r=e.node(t),n=e.parent(t),o={v:t};return r!==void 0&&(o.value=r),n!==void 0&&(o.parent=n),o})}function Tr(e){return e.edges().map(t=>{let r=e.edge(t),n={v:t.v,w:t.w};return t.name!==void 0&&(n.name=t.name),r!==void 0&&(n.value=r),n})}function Pr(e){let t=new J(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(r=>{t.setNode(r.v,r.value),r.parent&&t.setParent(r.v,r.parent)}),e.edges.forEach(r=>{t.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),t}var nt={};Rt(nt,{CycleException:()=>Te,bellmanFord:()=>Yt,components:()=>Dr,dijkstra:()=>Ce,dijkstraAll:()=>Yr,findCycles:()=>Ar,floydWarshall:()=>Gr,isAcyclic:()=>zr,postorder:()=>Wr,preorder:()=>Hr,prim:()=>Kr,shortestPaths:()=>Zr,tarjan:()=>Vt,topsort:()=>Gt});var Sr=()=>1;function Yt(e,t,r,n){return Fr(e,String(t),r||Sr,n||function(o){return e.outEdges(o)})}function Fr(e,t,r,n){let o={},s,i=0,a=e.nodes(),d=function(u){let g=r(u);o[u.v].distance+g<o[u.w].distance&&(o[u.w]={distance:o[u.v].distance+g,predecessor:u.v},s=!0)},l=function(){a.forEach(function(u){n(u).forEach(function(g){let v=g.v===u?g.v:g.w,p=v===g.v?g.w:g.v;d({v,w:p})})})};a.forEach(function(u){let g=u===t?0:Number.POSITIVE_INFINITY;o[u]={distance:g,predecessor:""}});let c=a.length;for(let u=1;u<c&&(s=!1,i++,l(),!!s);u++);if(i===c-1&&(s=!1,l(),s))throw new Error("The graph contains a negative weight cycle");return o}function Dr(e){let t={},r=[],n;function o(s){s in t||(t[s]=!0,n.push(s),e.successors(s).forEach(o),e.predecessors(s).forEach(o))}return e.nodes().forEach(function(s){n=[],o(s),n.length&&r.push(n)}),r}var At=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let r=this._keyIndices,n=String(e);if(!(n in r)){let o=this._arr,s=o.length;return r[n]=s,o.push({key:n,priority:t}),this._decrease(s),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let r=this._keyIndices[e];if(r===void 0)throw new Error(`Key not found: ${e}`);let n=this._arr[r].priority;if(t>n)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${n} New: ${t}`);this._arr[r].priority=t,this._decrease(r)}_heapify(e){let t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){let t=this._arr,r=t[e].priority,n;for(;e!==0&&(n=e>>1,!(t[n].priority<r));)this._swap(e,n),e=n}_swap(e,t){let r=this._arr,n=this._keyIndices,o=r[e],s=r[t];r[e]=s,r[t]=o,n[s.key]=e,n[o.key]=t}},Rr=()=>1;function Ce(e,t,r,n){let o=function(s){return e.outEdges(s)};return qr(e,String(t),r||Rr,n||o)}function qr(e,t,r,n){let o={},s=new At,i,a,d=function(l){let c=l.v!==i?l.v:l.w,u=o[c],g=r(l),v=a.distance+g;if(g<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+l+" Weight: "+g);v<u.distance&&(u.distance=v,u.predecessor=i,s.decrease(c,v))};for(e.nodes().forEach(function(l){let c=l===t?0:Number.POSITIVE_INFINITY;o[l]={distance:c,predecessor:""},s.add(l,c)});s.size()>0&&(i=s.removeMin(),a=o[i],a.distance!==Number.POSITIVE_INFINITY);)n(i).forEach(d);return o}function Yr(e,t,r){return e.nodes().reduce(function(n,o){return n[o]=Ce(e,o,t,r),n},{})}function Vt(e){let t=0,r=[],n={},o=[];function s(i){let a=n[i]={onStack:!0,lowlink:t,index:t++};if(r.push(i),e.successors(i).forEach(function(d){d in n?n[d].onStack&&(a.lowlink=Math.min(a.lowlink,n[d].index)):(s(d),a.lowlink=Math.min(a.lowlink,n[d].lowlink))}),a.lowlink===a.index){let d=[],l;do l=r.pop(),n[l].onStack=!1,d.push(l);while(i!==l);o.push(d)}}return e.nodes().forEach(function(i){i in n||s(i)}),o}function Ar(e){return Vt(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Vr=()=>1;function Gr(e,t,r){return Br(e,t||Vr,r||function(n){return e.outEdges(n)})}function Br(e,t,r){let n={},o=e.nodes();return o.forEach(function(s){n[s]={},n[s][s]={distance:0,predecessor:""},o.forEach(function(i){s!==i&&(n[s][i]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),r(s).forEach(function(i){let a=i.v===s?i.w:i.v,d=t(i);n[s][a]={distance:d,predecessor:s}})}),o.forEach(function(s){let i=n[s];o.forEach(function(a){let d=n[a];o.forEach(function(l){let c=d[s],u=i[l],g=d[l],v=c.distance+u.distance;v<g.distance&&(g.distance=v,g.predecessor=u.predecessor)})})}),n}var Te=class extends Error{constructor(...e){super(...e)}};function Gt(e){let t={},r={},n=[];function o(s){if(s in r)throw new Te;s in t||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(o),delete r[s],n.push(s))}if(e.sinks().forEach(o),Object.keys(t).length!==e.nodeCount())throw new Te;return n}function zr(e){try{Gt(e)}catch(t){if(t instanceof Te)return!1;throw t}return!0}function Xr(e,t,r,n,o){Array.isArray(t)||(t=[t]);let s=(a=>{var d;return(d=e.isDirected()?e.successors(a):e.neighbors(a))!=null?d:[]}),i={};return t.forEach(function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);o=Bt(e,a,r==="post",i,s,n,o)}),o}function Bt(e,t,r,n,o,s,i){return t in n||(n[t]=!0,r||(i=s(i,t)),o(t).forEach(function(a){i=Bt(e,a,r,n,o,s,i)}),r&&(i=s(i,t))),i}function zt(e,t,r){return Xr(e,t,r,function(n,o){return n.push(o),n},[])}function Wr(e,t){return zt(e,t,"post")}function Hr(e,t){return zt(e,t,"pre")}function Kr(e,t){let r=new J,n={},o=new At,s;function i(d){let l=d.v===s?d.w:d.v,c=o.priority(l);if(c!==void 0){let u=t(d);u<c&&(n[l]=s,o.decrease(l,u))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(d){o.add(d,Number.POSITIVE_INFINITY),r.setNode(d)}),o.decrease(e.nodes()[0],0);let a=!1;for(;o.size()>0;){if(s=o.removeMin(),s in n)r.setEdge(s,n[s]);else{if(a)throw new Error("Input graph is not connected: "+e);a=!0}e.nodeEdges(s).forEach(i)}return r}function Zr(e,t,r,n){return Ur(e,t,r,n??(o=>{let s=e.outEdges(o);return s??[]}))}function Ur(e,t,r,n){if(r===void 0)return Ce(e,t,r,n);let o=!1,s=e.nodes();for(let i=0;i<s.length;i++){let a=n(s[i]);for(let d=0;d<a.length;d++){let l=a[d],c=l.v===s[i]?l.v:l.w,u=c===l.v?l.w:l.v;r({v:c,w:u})<0&&(o=!0)}if(o)return Yt(e,t,r,n)}return Ce(e,t,r,n)}function _e(e,t,r,n){let o=n;for(;e.hasNode(o);)o=ot(n);return r.dummy=t,e.setNode(o,r),o}function Qr(e){let t=new J().setGraph(e.graph());return e.nodes().forEach(r=>t.setNode(r,e.node(r))),e.edges().forEach(r=>{let n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),t}function Xt(e){let t=new J({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r))}),e.edges().forEach(r=>{t.setEdge(r,e.edge(r))}),t}function _t(e,t){let r=e.x,n=e.y,o=t.x-r,s=t.y-n,i=e.width/2,a=e.height/2;if(!o&&!s)throw new Error("Not possible to find intersection inside of the rectangle");let d,l;return Math.abs(s)*i>Math.abs(o)*a?(s<0&&(a=-a),d=a*o/s,l=a):(o<0&&(i=-i),d=i,l=i*s/o),{x:r+d,y:n+l}}function De(e){let t=Oe(Ht(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),o=n.rank;o!==void 0&&(t[o]||(t[o]=[]),t[o][n.order]=r)}),t}function $r(e){let t=e.nodes().map(n=>{let o=e.node(n).rank;return o===void 0?Number.MAX_VALUE:o}),r=re(Math.min,t);e.nodes().forEach(n=>{let o=e.node(n);Object.hasOwn(o,"rank")&&(o.rank-=r)})}function Jr(e){let t=e.nodes().map(i=>e.node(i).rank).filter(i=>i!==void 0),r=re(Math.min,t),n=[];e.nodes().forEach(i=>{let a=e.node(i).rank-r;n[a]||(n[a]=[]),n[a].push(i)});let o=0,s=e.graph().nodeRankFactor;Array.from(n).forEach((i,a)=>{i===void 0&&a%s!==0?--o:i!==void 0&&o&&i.forEach(d=>e.node(d).rank+=o)})}function wt(e,t,r,n){let o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=n),_e(e,"border",o,t)}function en(e,t=Wt){let r=[];for(let n=0;n<e.length;n+=t){let o=e.slice(n,n+t);r.push(o)}return r}var Wt=65535;function re(e,t){if(t.length>Wt){let r=en(t);return e(...r.map(n=>e(...n)))}else return e(...t)}function Ht(e){let t=e.nodes().map(r=>{let n=e.node(r).rank;return n===void 0?Number.MIN_VALUE:n});return re(Math.max,t)}function tn(e,t){let r={lhs:[],rhs:[]};return e.forEach(n=>{t(n)?r.lhs.push(n):r.rhs.push(n)}),r}function rn(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}}function nn(e,t){return t()}var on=0;function ot(e){let t=++on;return e+(""+t)}function Oe(e,t,r=1){t==null&&(t=e,e=0);let n=s=>s<t;r<0&&(n=s=>t<s);let o=[];for(let s=e;n(s);s+=r)o.push(s);return o}function Pe(e,t){let r={};for(let n of t)e[n]!==void 0&&(r[n]=e[n]);return r}function Re(e,t){let r;return typeof t=="string"?r=n=>n[t]:r=t,Object.entries(e).reduce((n,[o,s])=>(n[o]=r(s,o),n),{})}function sn(e,t){return e.reduce((r,n,o)=>(r[n]=t[o],r),{})}var qe="\0",an=class{constructor(){Nr(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Et(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Et(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,ln)),r=r._prev;return"["+e.join(", ")+"]"}};function Et(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function ln(e,t){if(e!=="_next"&&e!=="_prev")return t}var dn=an,cn=()=>1;function un(e,t){if(e.nodeCount()<=1)return[];let r=fn(e,t||cn);return hn(r.graph,r.buckets,r.zeroIdx).flatMap(n=>e.outEdges(n.v,n.w)||[])}function hn(e,t,r){var n;let o=[],s=t[t.length-1],i=t[0],a;for(;e.nodeCount();){for(;a=i.dequeue();)Xe(e,t,r,a);for(;a=s.dequeue();)Xe(e,t,r,a);if(e.nodeCount()){for(let d=t.length-2;d>0;--d)if(a=(n=t[d])==null?void 0:n.dequeue(),a){o=o.concat(Xe(e,t,r,a,!0)||[]);break}}}return o}function Xe(e,t,r,n,o){let s=[],i=o?s:void 0;return(e.inEdges(n.v)||[]).forEach(a=>{let d=e.edge(a),l=e.node(a.v);o&&s.push({v:a.v,w:a.w}),l.out-=d,Je(t,r,l)}),(e.outEdges(n.v)||[]).forEach(a=>{let d=e.edge(a),l=a.w,c=e.node(l);c.in-=d,Je(t,r,c)}),e.removeNode(n.v),i}function fn(e,t){let r=new J,n=0,o=0;e.nodes().forEach(a=>{r.setNode(a,{v:a,in:0,out:0})}),e.edges().forEach(a=>{let d=r.edge(a.v,a.w)||0,l=t(a),c=d+l;r.setEdge(a.v,a.w,c);let u=r.node(a.v),g=r.node(a.w);o=Math.max(o,u.out+=l),n=Math.max(n,g.in+=l)});let s=gn(o+n+3).map(()=>new dn),i=n+1;return r.nodes().forEach(a=>{Je(s,i,r.node(a))}),{graph:r,buckets:s,zeroIdx:i}}function Je(e,t,r){var n,o,s;r.out?r.in?(s=e[r.out-r.in+t])==null||s.enqueue(r):(o=e[e.length-1])==null||o.enqueue(r):(n=e[0])==null||n.enqueue(r)}function gn(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t}function vn(e){(e.graph().acyclicer==="greedy"?un(e,t(e)):pn(e)).forEach(r=>{let n=e.edge(r);e.removeEdge(r),n.forwardName=r.name,n.reversed=!0,e.setEdge(r.w,r.v,n,ot("rev"))});function t(r){return n=>r.edge(n).weight}}function pn(e){let t=[],r={},n={};function o(s){Object.hasOwn(n,s)||(n[s]=!0,r[s]=!0,e.outEdges(s).forEach(i=>{Object.hasOwn(r,i.w)?t.push(i):o(i.w)}),delete r[s])}return e.nodes().forEach(o),t}function bn(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}function mn(e){e.graph().dummyChains=[],e.edges().forEach(t=>_n(e,t))}function _n(e,t){let r=t.v,n=e.node(r).rank,o=t.w,s=e.node(o).rank,i=t.name,a=e.edge(t),d=a.labelRank;if(s===n+1)return;e.removeEdge(t);let l,c,u;for(u=0,++n;n<s;++u,++n)a.points=[],c={width:0,height:0,edgeLabel:a,edgeObj:t,rank:n},l=_e(e,"edge",c,"_d"),n===d&&(c.width=a.width,c.height=a.height,c.dummy="edge-label",c.labelpos=a.labelpos),e.setEdge(r,l,{weight:a.weight},i),u===0&&e.graph().dummyChains.push(l),r=l;e.setEdge(r,o,{weight:a.weight},i)}function wn(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,o;for(e.setEdge(r.edgeObj,n);r.dummy;)o=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=o,r=e.node(t)})}function st(e){let t={};function r(n){let o=e.node(n);if(Object.hasOwn(t,n))return o.rank;t[n]=!0;let s=e.outEdges(n),i=s?s.map(d=>d==null?Number.POSITIVE_INFINITY:r(d.w)-e.edge(d).minlen):[],a=re(Math.min,i);return a===Number.POSITIVE_INFINITY&&(a=0),o.rank=a}e.sources().forEach(r)}function me(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Kt=En;function En(e){let t=new J({directed:!1}),r=e.nodes();if(r.length===0)throw new Error("Graph must have at least one node");let n=r[0],o=e.nodeCount();t.setNode(n,{});let s,i;for(;yn(t,e)<o&&(s=kn(t,e),!!s);)i=t.hasNode(s.v)?me(e,s):-me(e,s),xn(t,e,i);return t}function yn(e,t){function r(n){let o=t.nodeEdges(n);o&&o.forEach(s=>{let i=s.v,a=n===i?s.w:i;!e.hasNode(a)&&!me(t,s)&&(e.setNode(a,{}),e.setEdge(n,a,{}),r(a))})}return e.nodes().forEach(r),e.nodeCount()}function kn(e,t){return t.edges().reduce((r,n)=>{let o=Number.POSITIVE_INFINITY;return e.hasNode(n.v)!==e.hasNode(n.w)&&(o=me(t,n)),o<r[0]?[o,n]:r},[Number.POSITIVE_INFINITY,null])[1]}function xn(e,t,r){e.nodes().forEach(n=>t.node(n).rank+=r)}var{preorder:On,postorder:Nn}=nt,In=ge;ge.initLowLimValues=at;ge.initCutValues=it;ge.calcCutValue=Zt;ge.leaveEdge=Qt;ge.enterEdge=$t;ge.exchangeEdges=Jt;function ge(e){e=Qr(e),st(e);let t=Kt(e);at(t),it(t,e);let r,n;for(;r=Qt(t);)n=$t(t,e,r),Jt(t,e,r,n)}function it(e,t){let r=Nn(e,e.nodes());r=r.slice(0,r.length-1),r.forEach(n=>Mn(e,t,n))}function Mn(e,t,r){let n=e.node(r).parent,o=e.edge(r,n);o.cutvalue=Zt(e,t,r)}function Zt(e,t,r){let n=e.node(r).parent,o=!0,s=t.edge(r,n),i=0;s||(o=!1,s=t.edge(n,r)),i=s.weight;let a=t.nodeEdges(r);return a&&a.forEach(d=>{let l=d.v===r,c=l?d.w:d.v;if(c!==n){let u=l===o,g=t.edge(d).weight;if(i+=u?g:-g,Ln(e,r,c)){let v=e.edge(r,c).cutvalue;i+=u?-v:v}}}),i}function at(e,t){arguments.length<2&&(t=e.nodes()[0]),Ut(e,{},1,t)}function Ut(e,t,r,n,o){let s=r,i=e.node(n);t[n]=!0;let a=e.neighbors(n);return a&&a.forEach(d=>{Object.hasOwn(t,d)||(r=Ut(e,t,r,d,n))}),i.low=s,i.lim=r++,o?i.parent=o:delete i.parent,r}function Qt(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function $t(e,t,r){let n=r.v,o=r.w;t.hasEdge(n,o)||(n=r.w,o=r.v);let s=e.node(n),i=e.node(o),a=s,d=!1;return s.lim>i.lim&&(a=i,d=!0),t.edges().filter(l=>d===yt(e,e.node(l.v),a)&&d!==yt(e,e.node(l.w),a)).reduce((l,c)=>me(t,c)<me(t,l)?c:l)}function Jt(e,t,r,n){let o=r.v,s=r.w;e.removeEdge(o,s),e.setEdge(n.v,n.w,{}),at(e),it(e,t),jn(e,t)}function jn(e,t){let r=e.nodes().find(o=>!e.node(o).parent);if(!r)return;let n=On(e,[r]);n=n.slice(1),n.forEach(o=>{let s=e.node(o).parent,i=t.edge(o,s),a=!1;i||(i=t.edge(s,o),a=!0),t.node(o).rank=t.node(s).rank+(a?i.minlen:-i.minlen)})}function Ln(e,t,r){return e.hasEdge(t,r)}function yt(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}var Cn=Tn;function Tn(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":kt(e);break;case"tight-tree":Sn(e);break;case"longest-path":Pn(e);break;case"none":break;default:kt(e)}}var Pn=st;function Sn(e){st(e),Kt(e)}function kt(e){In(e)}var Fn=Dn;function Dn(e){let t=qn(e);e.graph().dummyChains.forEach(r=>{let n=e.node(r),o=n.edgeObj,s=Rn(e,t,o.v,o.w),i=s.path,a=s.lca,d=0,l=i[d],c=!0;for(;r!==o.w;){if(n=e.node(r),c){for(;(l=i[d])!==a&&e.node(l).maxRank<n.rank;)d++;l===a&&(c=!1)}if(!c){for(;d<i.length-1&&e.node(i[d+1]).minRank<=n.rank;)d++;l=i[d]}l!==void 0&&e.setParent(r,l),r=e.successors(r)[0]}})}function Rn(e,t,r,n){let o=[],s=[],i=Math.min(t[r].low,t[n].low),a=Math.max(t[r].lim,t[n].lim),d;d=r;do d=e.parent(d),o.push(d);while(d&&(t[d].low>i||a>t[d].lim));let l=d,c=n;for(;(c=e.parent(c))!==l;)s.push(c);return{path:o.concat(s.reverse()),lca:l}}function qn(e){let t={},r=0;function n(o){let s=r;e.children(o).forEach(n),t[o]={low:s,lim:r++}}return e.children(qe).forEach(n),t}function Yn(e){let t=_e(e,"root",{},"_root"),r=An(e),n=Object.values(r),o=re(Math.max,n)-1,s=2*o+1;e.graph().nestingRoot=t,e.edges().forEach(a=>e.edge(a).minlen*=s);let i=Vn(e)+1;e.children(qe).forEach(a=>er(e,t,s,i,o,r,a)),e.graph().nodeRankFactor=s}function er(e,t,r,n,o,s,i){var a;let d=e.children(i);if(!d.length){i!==t&&e.setEdge(t,i,{weight:0,minlen:r});return}let l=wt(e,"_bt"),c=wt(e,"_bb"),u=e.node(i);e.setParent(l,i),u.borderTop=l,e.setParent(c,i),u.borderBottom=c,d.forEach(g=>{var v;er(e,t,r,n,o,s,g);let p=e.node(g),b=p.borderTop?p.borderTop:g,k=p.borderBottom?p.borderBottom:g,N=p.borderTop?n:2*n,q=b!==k?1:o-((v=s[i])!=null?v:0)+1;e.setEdge(l,b,{weight:N,minlen:q,nestingEdge:!0}),e.setEdge(k,c,{weight:N,minlen:q,nestingEdge:!0})}),e.parent(i)||e.setEdge(t,l,{weight:0,minlen:o+((a=s[i])!=null?a:0)})}function An(e){let t={};function r(n,o){let s=e.children(n);s&&s.length&&s.forEach(i=>r(i,o+1)),t[n]=o}return e.children(qe).forEach(n=>r(n,1)),t}function Vn(e){return e.edges().reduce((t,r)=>t+e.edge(r).weight,0)}function Gn(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(r=>{e.edge(r).nestingEdge&&e.removeEdge(r)})}var Bn=zn;function zn(e){function t(r){let n=e.children(r),o=e.node(r);if(n.length&&n.forEach(t),Object.hasOwn(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let s=o.minRank,i=o.maxRank+1;s<i;++s)xt(e,"borderLeft","_bl",r,o,s),xt(e,"borderRight","_br",r,o,s)}}e.children(qe).forEach(t)}function xt(e,t,r,n,o,s){let i={width:0,height:0,rank:s,borderType:t},a=o[t][s-1],d=_e(e,"border",i,r);o[t][s]=d,e.setParent(d,n),a&&e.setEdge(a,d,{weight:1})}function Xn(e){var t;let r=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(r==="lr"||r==="rl")&&tr(e)}function Wn(e){var t;let r=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(r==="bt"||r==="rl")&&Hn(e),(r==="lr"||r==="rl")&&(Kn(e),tr(e))}function tr(e){e.nodes().forEach(t=>Ot(e.node(t))),e.edges().forEach(t=>Ot(e.edge(t)))}function Ot(e){let t=e.width;e.width=e.height,e.height=t}function Hn(e){e.nodes().forEach(t=>We(e.node(t))),e.edges().forEach(t=>{var r;let n=e.edge(t);(r=n.points)==null||r.forEach(We),Object.hasOwn(n,"y")&&We(n)})}function We(e){e.y=-e.y}function Kn(e){e.nodes().forEach(t=>He(e.node(t))),e.edges().forEach(t=>{var r;let n=e.edge(t);(r=n.points)==null||r.forEach(He),Object.hasOwn(n,"x")&&He(n)})}function He(e){let t=e.x;e.x=e.y,e.y=t}function Zn(e){let t={},r=e.nodes().filter(a=>!e.children(a).length),n=r.map(a=>e.node(a).rank),o=re(Math.max,n),s=Oe(o+1).map(()=>[]);function i(a){if(t[a])return;t[a]=!0;let d=e.node(a);s[d.rank].push(a);let l=e.successors(a);l&&l.forEach(i)}return r.sort((a,d)=>e.node(a).rank-e.node(d).rank).forEach(i),s}function Un(e,t){let r=0;for(let n=1;n<t.length;++n)r+=Qn(e,t[n-1],t[n]);return r}function Qn(e,t,r){let n=sn(r,r.map((l,c)=>c)),o=t.flatMap(l=>{let c=e.outEdges(l);return c?c.map(u=>({pos:n[u.w],weight:e.edge(u).weight})).sort((u,g)=>u.pos-g.pos):[]}),s=1;for(;s<r.length;)s<<=1;let i=2*s-1;s-=1;let a=new Array(i).fill(0),d=0;return o.forEach(l=>{let c=l.pos+s;a[c]+=l.weight;let u=0;for(;c>0;)c%2&&(u+=a[c+1]),c=c-1>>1,a[c]+=l.weight;d+=l.weight*u}),d}function $n(e,t=[]){return t.map(r=>{let n=e.inEdges(r);if(!n||!n.length)return{v:r};{let o=n.reduce((s,i)=>{let a=e.edge(i),d=e.node(i.v);return{sum:s.sum+a.weight*d.order,weight:s.weight+a.weight}},{sum:0,weight:0});return{v:r,barycenter:o.sum/o.weight,weight:o.weight}}})}function Jn(e,t){let r={};e.forEach((o,s)=>{let i={indegree:0,in:[],out:[],vs:[o.v],i:s};o.barycenter!==void 0&&(i.barycenter=o.barycenter,i.weight=o.weight),r[o.v]=i}),t.edges().forEach(o=>{let s=r[o.v],i=r[o.w];s!==void 0&&i!==void 0&&(i.indegree++,s.out.push(i))});let n=Object.values(r).filter(o=>!o.indegree);return eo(n)}function eo(e){let t=[];function r(o){return s=>{s.merged||(s.barycenter===void 0||o.barycenter===void 0||s.barycenter>=o.barycenter)&&to(o,s)}}function n(o){return s=>{s.in.push(o),--s.indegree===0&&e.push(s)}}for(;e.length;){let o=e.pop();t.push(o),o.in.reverse().forEach(r(o)),o.out.forEach(n(o))}return t.filter(o=>!o.merged).map(o=>Pe(o,["vs","i","barycenter","weight"]))}function to(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}function ro(e,t){let r=tn(e,c=>Object.hasOwn(c,"barycenter")),n=r.lhs,o=r.rhs.sort((c,u)=>u.i-c.i),s=[],i=0,a=0,d=0;n.sort(no(!!t)),d=Nt(s,o,d),n.forEach(c=>{d+=c.vs.length,s.push(c.vs),i+=c.barycenter*c.weight,a+=c.weight,d=Nt(s,o,d)});let l={vs:s.flat(1)};return a&&(l.barycenter=i/a,l.weight=a),l}function Nt(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}function no(e){return(t,r)=>t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}function rr(e,t,r,n){let o=e.children(t),s=e.node(t),i=s?s.borderLeft:void 0,a=s?s.borderRight:void 0,d={};i&&(o=o.filter(g=>g!==i&&g!==a));let l=$n(e,o);l.forEach(g=>{if(e.children(g.v).length){let v=rr(e,g.v,r,n);d[g.v]=v,Object.hasOwn(v,"barycenter")&&so(g,v)}});let c=Jn(l,r);oo(c,d);let u=ro(c,n);if(i&&a){u.vs=[i,u.vs,a].flat(1);let g=e.predecessors(i);if(g&&g.length){let v=e.node(g[0]),p=e.predecessors(a),b=e.node(p[0]);Object.hasOwn(u,"barycenter")||(u.barycenter=0,u.weight=0),u.barycenter=(u.barycenter*u.weight+v.order+b.order)/(u.weight+2),u.weight+=2}}return u}function oo(e,t){e.forEach(r=>{r.vs=r.vs.flatMap(n=>t[n]?t[n].vs:n)})}function so(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function io(e,t,r,n){n||(n=e.nodes());let o=ao(e),s=new J({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(i=>e.node(i));return n.forEach(i=>{let a=e.node(i),d=e.parent(i);if(a.rank===t||a.minRank<=t&&t<=a.maxRank){s.setNode(i),s.setParent(i,d||o);let l=e[r](i);l&&l.forEach(c=>{let u=c.v===i?c.w:c.v,g=s.edge(u,i),v=g!==void 0?g.weight:0;s.setEdge(u,i,{weight:e.edge(c).weight+v})}),Object.hasOwn(a,"minRank")&&s.setNode(i,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]})}}),s}function ao(e){let t;for(;e.hasNode(t=ot("_root")););return t}function lo(e,t,r){let n={},o;r.forEach(s=>{let i=e.parent(s),a,d;for(;i;){if(a=e.parent(i),a?(d=n[a],n[a]=i):(d=o,o=i),d&&d!==i){t.setEdge(d,i);return}i=a}})}function nr(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,nr);return}let r=Ht(e),n=It(e,Oe(1,r+1),"inEdges"),o=It(e,Oe(r-1,-1,-1),"outEdges"),s=Zn(e);if(Mt(e,s),t.disableOptimalOrderHeuristic)return;let i=Number.POSITIVE_INFINITY,a,d=t.constraints||[];for(let l=0,c=0;c<4;++l,++c){co(l%2?n:o,l%4>=2,d),s=De(e);let u=Un(e,s);u<i?(c=0,a=Object.assign({},s),i=u):u===i&&(a=structuredClone(s))}Mt(e,a)}function It(e,t,r){let n=new Map,o=(s,i)=>{n.has(s)||n.set(s,[]),n.get(s).push(i)};for(let s of e.nodes()){let i=e.node(s);if(typeof i.rank=="number"&&o(i.rank,s),typeof i.minRank=="number"&&typeof i.maxRank=="number")for(let a=i.minRank;a<=i.maxRank;a++)a!==i.rank&&o(a,s)}return t.map(function(s){return io(e,s,r,n.get(s)||[])})}function co(e,t,r){let n=new J;e.forEach(function(o){r.forEach(a=>n.setEdge(a.left,a.right));let s=o.graph().root,i=rr(o,s,n,t);i.vs.forEach((a,d)=>o.node(a).order=d),lo(o,n,i.vs)})}function Mt(e,t){Object.values(t).forEach(r=>r.forEach((n,o)=>e.node(n).order=o))}function uo(e,t){let r={};function n(o,s){let i=0,a=0,d=o.length,l=s[s.length-1];return s.forEach((c,u)=>{let g=fo(e,c),v=g?e.node(g).order:d;(g||c===l)&&(s.slice(a,u+1).forEach(p=>{let b=e.predecessors(p);b&&b.forEach(k=>{let N=e.node(k),q=N.order;(q<i||v<q)&&!(N.dummy&&e.node(p).dummy)&&or(r,k,p)})}),a=u+1,i=v)}),s}return t.length&&t.reduce(n),r}function ho(e,t){let r={};function n(s,i,a,d,l){Oe(i,a).forEach(c=>{let u=s[c];if(u!==void 0&&e.node(u).dummy){let g=e.predecessors(u);g&&g.forEach(v=>{if(v===void 0)return;let p=e.node(v);p.dummy&&(p.order<d||p.order>l)&&or(r,v,u)})}})}function o(s,i){let a=-1,d=-1,l=0;return i.forEach((c,u)=>{if(e.node(c).dummy==="border"){let g=e.predecessors(c);if(g&&g.length){let v=g[0];if(v===void 0)return;d=e.node(v).order,n(i,l,u,a,d),l=u,a=d}}n(i,l,i.length,d,s.length)}),i}return t.length&&t.reduce(o),r}function fo(e,t){if(e.node(t).dummy){let r=e.predecessors(t);if(r)return r.find(n=>e.node(n).dummy)}}function or(e,t,r){if(t>r){let o=t;t=r,r=o}let n=e[t];n||(e[t]=n={}),n[r]=!0}function go(e,t,r){if(t>r){let o=t;t=r,r=o}let n=e[t];return n!==void 0&&Object.hasOwn(n,r)}function vo(e,t,r,n){let o={},s={},i={};return t.forEach(a=>{a.forEach((d,l)=>{o[d]=d,s[d]=d,i[d]=l})}),t.forEach(a=>{let d=-1;a.forEach(l=>{let c=n(l);if(c&&c.length){let u=c.sort((v,p)=>{let b=i[v],k=i[p];return(b!==void 0?b:0)-(k!==void 0?k:0)}),g=(u.length-1)/2;for(let v=Math.floor(g),p=Math.ceil(g);v<=p;++v){let b=u[v];if(b===void 0)continue;let k=i[b];if(k!==void 0&&s[l]===l&&d<k&&!go(r,l,b)){let N=o[b];N!==void 0&&(s[b]=l,s[l]=o[l]=N,d=k)}}}})}),{root:o,align:s}}function po(e,t,r,n,o=!1){let s={},i=bo(e,t,r,o),a=o?"borderLeft":"borderRight";function d(v,p){let b=i.nodes().slice(),k={},N=b.pop();for(;N;){if(k[N])v(N);else{k[N]=!0,b.push(N);for(let q of p(N))b.push(q)}N=b.pop()}}function l(v){let p=i.inEdges(v);p?s[v]=p.reduce((b,k)=>{var N;let q=(N=s[k.v])!=null?N:0,S=i.edge(k);return Math.max(b,q+(S!==void 0?S:0))},0):s[v]=0}function c(v){let p=i.outEdges(v),b=Number.POSITIVE_INFINITY;p&&(b=p.reduce((N,q)=>{let S=s[q.w],ne=i.edge(q);return Math.min(N,(S!==void 0?S:0)-(ne!==void 0?ne:0))},Number.POSITIVE_INFINITY));let k=e.node(v);b!==Number.POSITIVE_INFINITY&&k.borderType!==a&&(s[v]=Math.max(s[v]!==void 0?s[v]:0,b))}function u(v){return i.predecessors(v)||[]}function g(v){return i.successors(v)||[]}return d(l,u),d(c,g),Object.keys(n).forEach(v=>{var p;let b=r[v];b!==void 0&&(s[v]=(p=s[b])!=null?p:0)}),s}function bo(e,t,r,n){let o=new J,s=e.graph(),i=yo(s.nodesep,s.edgesep,n);return t.forEach(a=>{let d;a.forEach(l=>{let c=r[l];if(c!==void 0){if(o.setNode(c),d!==void 0){let u=r[d];if(u!==void 0){let g=o.edge(u,c);o.setEdge(u,c,Math.max(i(e,l,d),g||0))}}d=l}})}),o}function mo(e,t){return Object.values(t).reduce((r,n)=>{let o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;Object.entries(n).forEach(([a,d])=>{let l=ko(e,a)/2;o=Math.max(d+l,o),s=Math.min(d-l,s)});let i=o-s;return i<r[0]&&(r=[i,n]),r},[Number.POSITIVE_INFINITY,null])[1]}function _o(e,t){let r=Object.values(t),n=re(Math.min,r),o=re(Math.max,r);["u","d"].forEach(s=>{["l","r"].forEach(i=>{let a=s+i,d=e[a];if(!d||d===t)return;let l=Object.values(d),c=n-re(Math.min,l);i!=="l"&&(c=o-re(Math.max,l)),c&&(e[a]=Re(d,u=>u+c))})})}function wo(e,t=void 0){let r=e.ul;return r?Re(r,(n,o)=>{var s,i;if(t){let d=t.toLowerCase(),l=e[d];if(l&&l[o]!==void 0)return l[o]}let a=Object.values(e).map(d=>{let l=d[o];return l!==void 0?l:0}).sort((d,l)=>d-l);return(((s=a[1])!=null?s:0)+((i=a[2])!=null?i:0))/2}):{}}function Eo(e){let t=De(e),r=Object.assign(uo(e,t),ho(e,t)),n={},o;["u","d"].forEach(i=>{o=i==="u"?t:Object.values(t).reverse(),["l","r"].forEach(a=>{a==="r"&&(o=o.map(c=>Object.values(c).reverse()));let d=vo(e,o,r,c=>(i==="u"?e.predecessors(c):e.successors(c))||[]),l=po(e,o,d.root,d.align,a==="r");a==="r"&&(l=Re(l,c=>-c)),n[i+a]=l})});let s=mo(e,n);return _o(n,s),wo(n,e.graph().align)}function yo(e,t,r){return(n,o,s)=>{let i=n.node(o),a=n.node(s),d=0,l;if(d+=i.width/2,Object.hasOwn(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":l=-i.width/2;break;case"r":l=i.width/2;break}if(l&&(d+=r?l:-l),l=void 0,d+=(i.dummy?t:e)/2,d+=(a.dummy?t:e)/2,d+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":l=a.width/2;break;case"r":l=-a.width/2;break}return l&&(d+=r?l:-l),d}}function ko(e,t){return e.node(t).width}function xo(e){e=Xt(e),Oo(e),Object.entries(Eo(e)).forEach(([t,r])=>e.node(t).x=r)}function Oo(e){let t=De(e),r=e.graph(),n=r.ranksep,o=r.rankalign,s=0;t.forEach(i=>{let a=i.reduce((d,l)=>{var c;let u=(c=e.node(l).height)!=null?c:0;return d>u?d:u},0);i.forEach(d=>{let l=e.node(d);o==="top"?l.y=s+l.height/2:o==="bottom"?l.y=s+a-l.height/2:l.y=s+a/2}),s+=a+n})}function No(e,t={}){let r=t.debugTiming?rn:nn;return r("layout",()=>{let n=r(" buildLayoutGraph",()=>Do(e));return r(" runLayout",()=>Io(n,r,t)),r(" updateInputGraph",()=>Mo(e,n)),n})}function Io(e,t,r){t(" makeSpaceForEdgeLabels",()=>Ro(e)),t(" removeSelfEdges",()=>Wo(e)),t(" acyclic",()=>vn(e)),t(" nestingGraph.run",()=>Yn(e)),t(" rank",()=>Cn(Xt(e))),t(" injectEdgeLabelProxies",()=>qo(e)),t(" removeEmptyRanks",()=>Jr(e)),t(" nestingGraph.cleanup",()=>Gn(e)),t(" normalizeRanks",()=>$r(e)),t(" assignRankMinMax",()=>Yo(e)),t(" removeEdgeLabelProxies",()=>Ao(e)),t(" normalize.run",()=>mn(e)),t(" parentDummyChains",()=>Fn(e)),t(" addBorderSegments",()=>Bn(e)),t(" order",()=>nr(e,r)),t(" insertSelfEdges",()=>Ho(e)),t(" adjustCoordinateSystem",()=>Xn(e)),t(" position",()=>xo(e)),t(" positionSelfEdges",()=>Ko(e)),t(" removeBorderNodes",()=>Xo(e)),t(" normalize.undo",()=>wn(e)),t(" fixupEdgeLabelCoords",()=>Bo(e)),t(" undoCoordinateSystem",()=>Wn(e)),t(" translateGraph",()=>Vo(e)),t(" assignNodeIntersects",()=>Go(e)),t(" reversePoints",()=>zo(e)),t(" acyclic.undo",()=>bn(e))}function Mo(e,t){e.nodes().forEach(r=>{let n=e.node(r),o=t.node(r);n&&(n.x=o.x,n.y=o.y,n.order=o.order,n.rank=o.rank,t.children(r).length&&(n.width=o.width,n.height=o.height))}),e.edges().forEach(r=>{let n=e.edge(r),o=t.edge(r);n.points=o.points,Object.hasOwn(o,"x")&&(n.x=o.x,n.y=o.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var jo=["nodesep","edgesep","ranksep","marginx","marginy"],Lo={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},Co=["acyclicer","ranker","rankdir","align","rankalign"],To=["width","height","rank"],jt={width:0,height:0},Po=["minlen","weight","width","height","labeloffset"],So={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Fo=["labelpos"];function Do(e){let t=new J({multigraph:!0,compound:!0}),r=Ze(e.graph());return t.setGraph(Object.assign({},Lo,Ke(r,jo),Pe(r,Co))),e.nodes().forEach(n=>{let o=Ze(e.node(n)),s=Ke(o,To);Object.keys(jt).forEach(a=>{s[a]===void 0&&(s[a]=jt[a])}),t.setNode(n,s);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let o=Ze(e.edge(n));t.setEdge(n,Object.assign({},So,Ke(o,Po),Pe(o,Fo)))}),t}function Ro(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(r=>{let n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function qo(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.width&&r.height){let n=e.node(t.v),o={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};_e(e,"edge-proxy",o,"_ep")}})}function Yo(e){let t=0;e.nodes().forEach(r=>{let n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Math.max(t,n.maxRank))}),e.graph().maxRank=t}function Ao(e){e.nodes().forEach(t=>{let r=e.node(t);if(r.dummy==="edge-proxy"){let n=r;e.edge(n.e).labelRank=r.rank,e.removeNode(t)}})}function Vo(e){let t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,o=0,s=e.graph(),i=s.marginx||0,a=s.marginy||0;function d(l){let c=l.x,u=l.y,g=l.width,v=l.height;t=Math.min(t,c-g/2),r=Math.max(r,c+g/2),n=Math.min(n,u-v/2),o=Math.max(o,u+v/2)}e.nodes().forEach(l=>d(e.node(l))),e.edges().forEach(l=>{let c=e.edge(l);Object.hasOwn(c,"x")&&d(c)}),t-=i,n-=a,e.nodes().forEach(l=>{let c=e.node(l);c.x-=t,c.y-=n}),e.edges().forEach(l=>{let c=e.edge(l);c.points.forEach(u=>{u.x-=t,u.y-=n}),Object.hasOwn(c,"x")&&(c.x-=t),Object.hasOwn(c,"y")&&(c.y-=n)}),s.width=r-t+i,s.height=o-n+a}function Go(e){e.edges().forEach(t=>{let r=e.edge(t),n=e.node(t.v),o=e.node(t.w),s,i;r.points?(s=r.points[0],i=r.points[r.points.length-1]):(r.points=[],s=o,i=n),r.points.unshift(_t(n,s)),r.points.push(_t(o,i))})}function Bo(e){e.edges().forEach(t=>{let r=e.edge(t);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function zo(e){e.edges().forEach(t=>{let r=e.edge(t);r.reversed&&r.points.reverse()})}function Xo(e){e.nodes().forEach(t=>{if(e.children(t).length){let r=e.node(t),n=e.node(r.borderTop),o=e.node(r.borderBottom),s=e.node(r.borderLeft[r.borderLeft.length-1]),i=e.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(i.x-s.x),r.height=Math.abs(o.y-n.y),r.x=s.x+r.width/2,r.y=n.y+r.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function Wo(e){e.edges().forEach(t=>{if(t.v===t.w){let r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Ho(e){De(e).forEach(t=>{let r=0;t.forEach((n,o)=>{let s=e.node(n);s.order=o+r,(s.selfEdges||[]).forEach(i=>{_e(e,"selfedge",{width:i.label.width,height:i.label.height,rank:s.rank,order:o+ ++r,e:i.e,label:i.label},"_se")}),delete s.selfEdges})})}function Ko(e){e.nodes().forEach(t=>{let r=e.node(t);if(r.dummy==="selfedge"){let n=r,o=e.node(n.e.v),s=o.x+o.width/2,i=o.y,a=r.x-s,d=o.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:s+2*a/3,y:i-d},{x:s+5*a/6,y:i-d},{x:s+a,y:i},{x:s+5*a/6,y:i+d},{x:s+2*a/3,y:i+d}],n.label.x=r.x,n.label.y=r.y}})}function Ke(e,t){return Re(Pe(e,t),Number)}function Ze(e){let t={};return e&&Object.entries(e).forEach(([r,n])=>{typeof r=="string"&&(r=r.toLowerCase()),t[r]=n}),t}/*! For license information please see dagre.esm.js.LEGAL.txt */const se=140,ie=44,Lt=300,Zo=6,Ct=12;function Uo(e){const t=new Map,r=(n,o)=>{const s=`${n}|${o.side}`;t.has(s)||t.set(s,[]),t.get(s).push(o)};for(const n of e)r(n.edge.source,n.start),r(n.edge.target,n.end);for(const n of t.values())n.sort((o,s)=>o.sortY-s.sortY),n.forEach((o,s)=>{o.y=o.node.y-ie/2+ie*(s+1)/(n.length+1)})}function je(e,t=0){return{x:e.node.x+e.side*(se/2+Zo+t),y:e.y}}function Qo(e){const t=new Map;for(const n of e){const o=[n.source,n.target].sort().join("|");t.has(o)||t.set(o,[]),t.get(o).push(n)}const r=[];for(const n of t.values()){const o=n.find(i=>i.direction==="output"),s=n.find(i=>i.direction==="input");o&&s?r.push({...o,bidirectional:!0}):r.push(...n.map(i=>({...i,bidirectional:!1})))}return r}function $o(e,t){const r=new Dt.Graph({multigraph:!0});r.setGraph({rankdir:"LR",nodesep:14,ranksep:50,edgesep:8,marginx:20,marginy:20}),r.setDefaultEdgeLabel(()=>({}));const n=new Set(e.map(l=>l.id));for(const l of e)r.setNode(l.id,{width:se,height:ie});const o=Qo(t.filter(l=>n.has(l.source)&&n.has(l.target)));for(const l of o)r.setEdge(l.source,l.target,{},Ue(l));No(r);const s=e.map(l=>{const c=r.node(l.id);return{...l,x:c.x,y:c.y,width:se,height:ie}}),i=o.map(l=>{var p,b;const c=r.edge(l.source,l.target,Ue(l)),u=r.node(l.source),g=r.node(l.target),v=((c==null?void 0:c.points)??[]).slice(1,-1);return{edge:l,interior:v,start:{node:u,side:g.x>=u.x?1:-1,sortY:((p=v[0])==null?void 0:p.y)??g.y},end:{node:g,side:u.x>=g.x?1:-1,sortY:((b=v[v.length-1])==null?void 0:b.y)??u.y}}});Uo(i);const a=i.map(({edge:l,interior:c,start:u,end:g})=>({...l,points:[je(u),je(u,Ct),...c,je(g,Ct),je(g)]})),d=r.graph();return{nodes:s,edges:a,width:d.width??0,height:d.height??0}}function Jo(e,t=!0){if(!e||e.length===0)return"";const[r,...n]=e;if(!t||e.length<3)return`M ${r.x} ${r.y}`+n.map(d=>` L ${d.x} ${d.y}`).join("");const o=(d,l)=>({x:(d.x+l.x)/2,y:(d.y+l.y)/2}),s=o(r,e[1]);let i=`M ${r.x} ${r.y} L ${s.x} ${s.y}`;for(let d=1;d<e.length-1;d++){const l=e[d],c=o(e[d],e[d+1]);i+=` Q ${l.x} ${l.y} ${c.x} ${c.y}`}const a=e[e.length-1];return i+=` L ${a.x} ${a.y}`,i}var es=Ie('<path marker-end="url(#lineage-arrow-end)"></path>'),ts=Ie('<rect class="node-box stack svelte-envflr" x="8" y="-8" rx="6"></rect><rect class="node-box stack svelte-envflr" x="4" y="-4" rx="6"></rect>',1),rs=Ie('<g class="base-target"><circle class="target-ring svelte-envflr" r="5.5"></circle><circle class="target-dot svelte-envflr" r="2.25"></circle><title>base artifact</title></g>'),ns=Ie('<g role="button" tabindex="0"><!><rect class="node-box svelte-envflr" rx="6"></rect><rect class="selection-ring svelte-envflr" x="-4" y="-4" rx="10"></rect><!><text class="node-chip svelte-envflr" x="10" y="16"> </text><text class="node-label svelte-envflr" x="10" y="33"> <title> </title></text></g>'),os=Ie("<g><!><!></g>"),ss=R('<div class="graph-container svelte-envflr"><svg role="application" aria-label="Artifact lineage graph"><defs><marker id="lineage-arrow-end" viewBox="0 0 10 10" refX="6" refY="5" markerWidth="4" markerHeight="4" orient="auto-start-reverse"><path d="M 0 1 L 9 5 L 0 9 Z" class="arrow-head svelte-envflr"></path></marker></defs><!></svg> <div class="zoom-controls svelte-envflr"><button title="Zoom in" class="svelte-envflr">+</button> <button title="Zoom out" class="svelte-envflr">−</button> <button title="Fit graph" class="svelte-envflr">Fit</button> <button title="Reset to original view" class="svelte-envflr">Reset</button></div></div>');function is(e,t){et(t,!0);let r=Z(t,"layout",3,null),n=Z(t,"focusId",3,null),o=Z(t,"selectedId",3,null),s=Z(t,"smooth",3,!0),i=Z(t,"onSelect",3,()=>{}),a=te(0),d=te(0),l=te(Tt({x:0,y:0,k:1})),c=null;const u=.25,g=2.5,v=1;function p(){if(!r()||!h(a)||!h(d))return;const f=Math.min(h(a)/Math.max(r().width,1),h(d)/Math.max(r().height,1),1);j(l,{k:f,x:(h(a)-r().width*f)/2,y:(h(d)-r().height*f)/2},!0)}function b(f,m,_){return _<=m?(m-_)/2:Math.min(0,Math.max(m-_,f))}function k(){if(!r()||!h(a)||!h(d))return;const f=r().nodes.find(_=>_.id===n());if(!f){p();return}const m=v;j(l,{k:m,x:b(h(a)/2-f.x*m,h(a),r().width*m),y:b(h(d)/2-f.y*m,h(d),r().height*m)},!0)}tt(()=>{!r()||!h(a)||!h(d)||c!==n()&&(c=n(),k())});function N(f,m=h(a)/2,_=h(d)/2){const Y=Math.min(g,Math.max(u,h(l).k*f)),P=Y/h(l).k;j(l,{k:Y,x:m-(m-h(l).x)*P,y:_-(_-h(l).y)*P},!0)}function q(f){const m=_=>{if(!_.ctrlKey&&!_.metaKey)return;_.preventDefault();const Y=f.getBoundingClientRect();N(Math.exp(-_.deltaY*.002),_.clientX-Y.left,_.clientY-Y.top)};return f.addEventListener("wheel",m,{passive:!1}),{destroy:()=>f.removeEventListener("wheel",m)}}let S=te(null);function ne(f){f.button===0&&(j(S,{x:f.clientX,y:f.clientY,startX:f.clientX,startY:f.clientY},!0),f.currentTarget.setPointerCapture(f.pointerId))}function we(f){h(S)&&(j(l,{...h(l),x:h(l).x+f.clientX-h(S).x,y:h(l).y+f.clientY-h(S).y},!0),j(S,{...h(S),x:f.clientX,y:f.clientY},!0))}function ce(f){if(!h(S))return;const m=Math.hypot(f.clientX-h(S).startX,f.clientY-h(S).startY);j(S,null),f.currentTarget.releasePointerCapture(f.pointerId),m<4&&i()(null)}function ve(f,m=18){if(f==null)return"";const _=String(f);return _.length>m?_.slice(0,m-1)+"…":_}function pe(f){return f.kind==="artifact"?f.artifact_type:f.kind==="cluster"?"cluster":"run"}const $=le(()=>{if(!r()||!o())return null;const f=new Map,m=new Map,_=(x,A,Q)=>{x.has(A)||x.set(A,[]),x.get(A).push(Q)};for(const x of r().edges)_(f,x.source,x.target),_(m,x.target,x.source),x.bidirectional&&(_(f,x.target,x.source),_(m,x.source,x.target));const Y=x=>{const A=new Set([o()]),Q=[o()];for(;Q.length;)for(const ue of x.get(Q.pop())??[])A.has(ue)||(A.add(ue),Q.push(ue));return A},P=Y(f),E=Y(m);return{nodes:new Set([...P,...E]),down:P,up:E}});function I(f){return h($).down.has(f.source)&&h($).down.has(f.target)||h($).up.has(f.source)&&h($).up.has(f.target)}function F(f,m){(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),i()(m.id))}var G=ss(),z=O(G);let ae;var Ee=y(O(z));{var w=f=>{var m=os(),_=O(m);Le(_,17,()=>r().edges,P=>Ue(P),(P,E)=>{var x=es();let A;K((Q,ue)=>{A=Be(x,0,"edge svelte-envflr",null,A,Q),W(x,"d",ue),W(x,"marker-start",h(E).bidirectional?"url(#lineage-arrow-end)":null)},[()=>({dimmed:h($)&&!I(h(E))}),()=>Jo(h(E).points,s())]),L(P,x)});var Y=y(_);Le(Y,17,()=>r().nodes,P=>P.id,(P,E)=>{var x=ns();let A;var Q=O(x);{var ue=U=>{var he=ts(),ye=ee(he),Me=y(ye);K(()=>{W(ye,"width",se-16),W(ye,"height",ie),W(Me,"width",se-8),W(Me,"height",ie)}),L(U,he)};H(Q,U=>{h(E).kind==="cluster"&&U(ue)})}var Ye=y(Q),Ae=y(Ye),lt=y(Ae);{var sr=U=>{var he=rs();K(()=>W(he,"transform",`translate(${se}, 0)`)),L(U,he)};H(lt,U=>{h(E).id===n()&&U(sr)})}var dt=y(lt),ir=O(dt),ar=y(dt),ct=O(ar),lr=y(ct),dr=O(lr);K((U,he,ye,Me,cr)=>{A=Be(x,0,`node ${h(E).kind??""} ${h(E).kind==="cluster"?`cluster-${h(E).member_kind}`:""}`,"svelte-envflr",A,U),W(x,"transform",`translate(${h(E).x-se/2}, ${h(E).y-ie/2})`),W(x,"aria-label",he),W(Ye,"width",se),W(Ye,"height",ie),W(Ae,"width",se+8),W(Ae,"height",ie+8),B(ir,ye),B(ct,`${Me??""} `),B(dr,cr)},[()=>({focused:h(E).id===n(),selected:h(E).id===o(),dimmed:h($)&&!h($).nodes.has(h(E).id)}),()=>fe(h(E)),()=>ve(pe(h(E)),20).toUpperCase(),()=>h(E).kind==="cluster"?fe(h(E)):ve(fe(h(E))),()=>fe(h(E))]),V("pointerdown",x,U=>U.stopPropagation()),V("click",x,()=>i()(h(E).id)),V("keydown",x,U=>F(U,h(E))),L(P,x)}),K(()=>W(m,"transform",`translate(${h(l).x??""}, ${h(l).y??""}) scale(${h(l).k??""})`)),L(f,m)};H(Ee,f=>{r()&&f(w)})}vr(z,f=>q==null?void 0:q(f));var M=y(z,2),D=O(M),C=y(D,2),T=y(C,2),X=y(T,2);K(()=>ae=Be(z,0,"graph svelte-envflr",null,ae,{panning:h(S)})),V("pointerdown",z,ne),V("pointermove",z,we),V("pointerup",z,ce),pr("pointercancel",z,ce),V("click",D,()=>N(1.25)),V("click",C,()=>N(.8)),V("click",T,p),V("click",X,k),pt(G,"clientWidth",f=>j(a,f)),pt(G,"clientHeight",f=>j(d,f)),L(e,G),rt()}Pt(["pointerdown","pointermove","pointerup","click","keydown"]);var as=R('<span class="kind-chip artifact svelte-h7g2eb"> </span> <span class="title svelte-h7g2eb"> </span> <span class="ver-badge svelte-h7g2eb"> </span> <!>',1),ls=R('<span class="kind-chip cluster svelte-h7g2eb">cluster</span> <span class="title svelte-h7g2eb"> </span>',1),ds=R('<span class="kind-chip run svelte-h7g2eb">run</span> <span class="title svelte-h7g2eb"> </span>',1),cs=R('<li class="member-item svelte-h7g2eb"><button class="member-row svelte-h7g2eb" title="Show in graph"> </button></li>'),us=R('<li class="member-empty svelte-h7g2eb">No matches.</li>'),hs=R('<button class="open-btn svelte-h7g2eb">Show all</button>'),fs=R('<div class="cluster-body svelte-h7g2eb"><!> <ul class="member-list svelte-h7g2eb"></ul> <!></div>'),gs=R('<span class="detail-key svelte-h7g2eb">Produced by</span> <span class="detail-val svelte-h7g2eb"><button class="run-link svelte-h7g2eb"> </button></span>',1),vs=R('<span class="detail-key svelte-h7g2eb">Size</span> <span class="detail-val svelte-h7g2eb"> </span> <span class="detail-key svelte-h7g2eb">Files</span> <span class="detail-val svelte-h7g2eb"> </span> <span class="detail-key svelte-h7g2eb">Created</span> <span class="detail-val svelte-h7g2eb"> </span> <!>',1),ps=R('<span class="detail-key svelte-h7g2eb">First linked</span> <span class="detail-val svelte-h7g2eb"> </span>',1),bs=R('<button class="open-btn svelte-h7g2eb">Open version</button>'),ms=R('<button class="open-btn svelte-h7g2eb">Open run</button>'),_s=R('<div class="preview svelte-h7g2eb"><div class="preview-header svelte-h7g2eb"><!> <button class="close-btn svelte-h7g2eb" title="Close preview">×</button></div> <!> <div class="detail-grid svelte-h7g2eb"><!></div> <div class="preview-footer svelte-h7g2eb"><!></div></div>');function ws(e,t){et(t,!0);let r=Z(t,"node",3,null),n=Z(t,"focusId",3,null),o=Z(t,"onOpenVersion",3,null),s=Z(t,"onExtract",3,()=>{}),i=Z(t,"onExtractAll",3,()=>{}),a=Z(t,"onClose",3,()=>{});const d=30;let l=te("");tt(()=>{var p;(p=r())==null||p.id,j(l,"")});const c=le(()=>{var b;if(((b=r())==null?void 0:b.kind)!=="cluster")return[];const p=h(l).toLowerCase();return r().members.filter(k=>fe(k).toLowerCase().includes(p))});var u=Qe(),g=ee(u);{var v=p=>{var b=_s(),k=O(b),N=O(k);{var q=w=>{var M=as(),D=ee(M),C=O(D),T=y(D,2),X=O(T),f=y(T,2),m=O(f),_=y(f,2);Le(_,17,()=>r().aliases,mr,(Y,P)=>{br(Y,{get alias(){return h(P)}})}),K(()=>{B(C,r().artifact_type),B(X,r().artifact_name),B(m,`v${r().version??""}`)}),L(w,M)},S=w=>{var M=ls(),D=y(ee(M),2),C=O(D);K(T=>B(C,T),[()=>fe(r())]),L(w,M)},ne=w=>{var M=ds(),D=y(ee(M),2),C=O(D);K(()=>B(C,r().run_name??r().run_id)),L(w,M)};H(N,w=>{r().kind==="artifact"?w(q):r().kind==="cluster"?w(S,1):w(ne,-1)})}var we=y(N,2),ce=y(k,2);{var ve=w=>{var M=fs(),D=O(M);{let f=le(()=>r().member_kind==="run"?"runs":"versions");_r(D,{get placeholder(){return`Search ${h(f)??""}…`},get value(){return h(l)},set value(m){j(l,m,!0)}})}var C=y(D,2);Le(C,21,()=>h(c),f=>f.id,(f,m)=>{var _=cs(),Y=O(_),P=O(Y);K(E=>B(P,E),[()=>fe(h(m))]),V("click",Y,()=>s()(h(m).id)),L(f,_)},f=>{var m=us();L(f,m)});var T=y(C,2);{var X=f=>{var m=hs();V("click",m,()=>i()(r().members.map(_=>_.id))),L(f,m)};H(T,f=>{r().count<=d&&f(X)})}L(w,M)};H(ce,w=>{r().kind==="cluster"&&w(ve)})}var pe=y(ce,2),$=O(pe);{var I=w=>{var M=vs(),D=y(ee(M),2),C=O(D),T=y(D,4),X=O(T),f=y(T,4),m=O(f),_=y(f,2);{var Y=P=>{var E=gs(),x=y(ee(E),2),A=O(x),Q=O(A);K(()=>B(Q,r().producer_run_name)),V("click",A,()=>vt(r().producer_run_name,r().producer_run_id)),L(P,E)};H(_,P=>{r().producer_run_name&&P(Y)})}K((P,E)=>{B(C,P),B(X,r().num_files),B(m,E)},[()=>wr(r().size_bytes),()=>gt(r().created_at)]),L(w,M)},F=w=>{var M=ps(),D=y(ee(M),2),C=O(D);K(T=>B(C,T),[()=>gt(r().created_at)]),L(w,M)};H($,w=>{r().kind==="artifact"?w(I):r().kind==="run"&&w(F,1)})}var G=y(pe,2),z=O(G);{var ae=w=>{var M=Qe(),D=ee(M);{var C=T=>{var X=bs();V("click",X,()=>o()(r().artifact_name,r().version)),L(T,X)};H(D,T=>{o()&&r().id!==n()&&T(C)})}L(w,M)},Ee=w=>{var M=ms();V("click",M,()=>vt(r().run_name,r().run_id)),L(w,M)};H(z,w=>{r().kind==="artifact"?w(ae):r().kind==="run"&&w(Ee,1)})}V("click",we,function(...w){var M;(M=a())==null||M.apply(this,w)}),L(p,b)};H(g,p=>{r()&&p(v)})}L(e,u),rt()}Pt(["click"]);var Es=R('<div class="status svelte-sqcnye">Loading lineage…</div>'),ys=R('<div class="status svelte-sqcnye">Failed to load lineage.</div>'),ks=R('<div class="status svelte-sqcnye">No lineage recorded for this version.</div>'),xs=R('<div class="toolbar svelte-sqcnye"><span class="notice svelte-sqcnye">Large graph — lineage was truncated.</span></div>'),Os=R('<div class="toolbar svelte-sqcnye"><span class="notice svelte-sqcnye"> </span></div>'),Ns=R('<div class="preview-overlay svelte-sqcnye"><!></div>'),Is=R('<div class="lineage svelte-sqcnye"><!> <div class="graph-wrap svelte-sqcnye"><!> <div class="legend svelte-sqcnye"><span class="legend-item svelte-sqcnye"><svg class="target-swatch svelte-sqcnye" viewBox="-7 -7 14 14" aria-hidden="true"><circle class="target-ring svelte-sqcnye" r="5"></circle><circle class="target-dot svelte-sqcnye" r="2"></circle></svg>Base Artifact</span> <span class="legend-item svelte-sqcnye"><span class="swatch artifact svelte-sqcnye"></span>Artifact</span> <span class="legend-item svelte-sqcnye"><span class="swatch run svelte-sqcnye"></span>Run</span></div> <span class="hint svelte-sqcnye">Drag to pan · Ctrl/Cmd + scroll to zoom · Click a node for details</span> <!></div></div>');function Ls(e,t){et(t,!0);let r=Z(t,"project",3,null),n=Z(t,"versionId",3,null),o=Z(t,"onOpenVersion",3,null),s=te(null),i=te(!0),a=te(!1),d=te(Tt(new Set)),l=te(null),c=0;const u=le(()=>`art:${n()}`);tt(()=>{g()});async function g(){const I=++c,F=r(),G=n(),z=`art:${G}`;if(!F||G==null){j(s,null),j(a,!1),j(d,new Set,!0),j(l,null),j(i,!1);return}j(i,!0),j(a,!1),j(d,new Set,!0),j(l,null);try{const ae=await Er(F,G);if(I!==c)return;j(s,ae,!0),j(l,z)}catch{if(I!==c)return;j(a,!0)}finally{I===c&&j(i,!1)}}const v=le(()=>h(s)?yr(h(s),h(u),{extracted:h(d)}):null),p=le(()=>h(v)&&h(v).nodes.length?$o(h(v).nodes,h(v).edges):null),b=le(()=>!h(v)||h(v).nodes.length<=Lt),k=le(()=>h(v)&&h(l)?h(v).nodes.find(I=>I.id===h(l))??null:null);function N(I){const F=new Set(h(d));F.add(I),j(d,F,!0),j(l,I,!0)}function q(I){const F=new Set(h(d));for(const G of I)F.add(G);j(d,F,!0),j(l,null)}function S(I){j(l,h(l)===I?null:I,!0)}var ne=Qe(),we=ee(ne);{var ce=I=>{var F=Es();L(I,F)},ve=I=>{var F=ys();L(I,F)},pe=I=>{var F=ks();L(I,F)},$=I=>{var F=Is(),G=O(F);{var z=C=>{var T=xs();L(C,T)},ae=C=>{var T=Os(),X=O(T),f=O(X);K(()=>B(f,`Large graph — showing ${h(v).nodes.length??""} nodes.`)),L(C,T)};H(G,C=>{h(s).truncated?C(z):h(v).nodes.length>Lt&&C(ae,1)})}var Ee=y(G,2),w=O(Ee);is(w,{get layout(){return h(p)},get focusId(){return h(u)},get selectedId(){return h(l)},get smooth(){return h(b)},onSelect:S});var M=y(w,6);{var D=C=>{var T=Ns(),X=O(T);ws(X,{get node(){return h(k)},get focusId(){return h(u)},get onOpenVersion(){return o()},onExtract:N,onExtractAll:q,onClose:()=>j(l,null)}),L(C,T)};H(M,C=>{h(k)&&C(D)})}L(I,F)};H(we,I=>{h(i)?I(ce):h(a)?I(ve,1):!h(s)||h(s).edges.length===0?I(pe,2):I($,-1)})}L(e,ne),rt()}export{Ls as default};
|
assets/LineageSection-D4yA5g5T.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.graph-container.svelte-envflr{position:relative;height:100%;min-height:400px;background:var(--background-fill-primary, #ffffff);overflow:hidden}.graph.svelte-envflr{width:100%;height:100%;display:block;cursor:grab;touch-action:none}.graph.panning.svelte-envflr{cursor:grabbing}.edge.svelte-envflr{fill:none;stroke:color-mix(in srgb,var(--body-text-color-subdued, #6b7280) 55%,var(--border-color-primary, #d1d5db));stroke-width:1.5}.arrow-head.svelte-envflr{fill:color-mix(in srgb,var(--body-text-color-subdued, #6b7280) 55%,var(--border-color-primary, #d1d5db))}.node.svelte-envflr{cursor:pointer;outline:none;transition:opacity .15s ease}.edge.svelte-envflr{transition:opacity .15s ease}.node.dimmed.svelte-envflr,.edge.dimmed.svelte-envflr{opacity:.5}.node-box.svelte-envflr{fill:var(--background-fill-primary, #ffffff);stroke-width:1.5}.node.run.svelte-envflr .node-box:where(.svelte-envflr){stroke:var(--lineage-run)}.node.artifact.svelte-envflr .node-box:where(.svelte-envflr){stroke:var(--lineage-artifact)}.node.cluster.svelte-envflr .node-box:where(.svelte-envflr){stroke-dasharray:4 3}.node.cluster-artifact.svelte-envflr .node-box:where(.svelte-envflr){stroke:var(--lineage-artifact)}.node.cluster-run.svelte-envflr .node-box:where(.svelte-envflr){stroke:var(--lineage-run)}.node.cluster.svelte-envflr .node-box.stack:where(.svelte-envflr){fill:var(--background-fill-secondary, #f3f4f6);stroke-dasharray:none;opacity:.7}.selection-ring.svelte-envflr{fill:none;stroke:color-mix(in srgb,var(--body-text-color, #1f2937) 80%,var(--background-fill-primary, #ffffff));stroke-width:2;pointer-events:none;opacity:0}.node.selected.svelte-envflr .selection-ring:where(.svelte-envflr),.node.svelte-envflr:focus-visible .selection-ring:where(.svelte-envflr){opacity:1}.target-ring.svelte-envflr{fill:var(--background-fill-primary, #ffffff);stroke:var(--color-accent, #f97316);stroke-width:2}.target-dot.svelte-envflr{fill:var(--color-accent, #f97316)}.node-chip.svelte-envflr{font-size:9px;font-weight:600;letter-spacing:.05em;fill:var(--body-text-color-subdued, #6b7280)}.node.run.svelte-envflr .node-chip:where(.svelte-envflr),.node.cluster-run.svelte-envflr .node-chip:where(.svelte-envflr){fill:var(--lineage-run)}.node.artifact.svelte-envflr .node-chip:where(.svelte-envflr),.node.cluster-artifact.svelte-envflr .node-chip:where(.svelte-envflr){fill:var(--lineage-artifact)}.node-label.svelte-envflr{font-size:12px;font-weight:500;fill:var(--body-text-color, #1f2937)}.zoom-controls.svelte-envflr{position:absolute;bottom:8px;left:8px;display:flex;gap:4px}.zoom-controls.svelte-envflr button:where(.svelte-envflr){min-width:26px;height:26px;padding:0 7px;border:1px solid var(--border-color-primary, #e5e7eb);border-radius:var(--radius-sm, 4px);background:var(--background-fill-primary, #ffffff);color:var(--body-text-color-subdued, #6b7280);font-size:var(--text-sm, 13px);cursor:pointer}.zoom-controls.svelte-envflr button:where(.svelte-envflr):hover{color:var(--body-text-color, #1f2937);border-color:var(--color-accent, #f97316)}.preview.svelte-h7g2eb{border:1px solid var(--border-color-primary, #e5e7eb);border-radius:var(--radius-md, 6px);background:var(--background-fill-secondary, #f9fafb);padding:12px 14px;display:flex;flex-direction:column;gap:10px}.preview-header.svelte-h7g2eb{position:relative;display:flex;align-items:baseline;flex-wrap:wrap;gap:6px;padding-right:24px}.title.svelte-h7g2eb{font-size:var(--text-md, 14px);font-weight:600;color:var(--body-text-color, #1f2937)}.ver-badge.svelte-h7g2eb{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:var(--text-sm, 12px);font-weight:600;color:var(--body-text-color-subdued, #6b7280);background:var(--background-fill-primary, #ffffff);border-radius:var(--radius-sm, 4px);padding:2px 7px}.kind-chip.svelte-h7g2eb{flex-basis:100%;font-size:var(--text-xs, 11px);text-transform:uppercase;letter-spacing:.05em;font-weight:600;color:var(--lineage-run)}.kind-chip.cluster.svelte-h7g2eb{color:var(--body-text-color-subdued, #6b7280)}.kind-chip.artifact.svelte-h7g2eb{color:var(--lineage-artifact)}.cluster-body.svelte-h7g2eb{min-height:0;display:flex;flex-direction:column;gap:6px}.member-list.svelte-h7g2eb{list-style:none;margin:0;padding:0;min-height:0;overflow-y:auto;border:1px solid var(--border-color-primary, #e5e7eb);border-radius:var(--radius-sm, 4px);background:var(--background-fill-primary, #ffffff)}.member-item.svelte-h7g2eb+.member-item:where(.svelte-h7g2eb){border-top:1px solid var(--border-color-primary, #f3f4f6)}.member-row.svelte-h7g2eb{display:block;width:100%;background:none;border:none;text-align:left;padding:5px 8px;font-size:var(--text-sm, 12px);color:var(--body-text-color, #1f2937);overflow-wrap:anywhere;cursor:pointer}.member-row.svelte-h7g2eb:hover,.member-row.svelte-h7g2eb:focus-visible{background:var(--background-fill-secondary, #f3f4f6)}.member-empty.svelte-h7g2eb{padding:6px 8px;font-size:var(--text-sm, 12px);color:var(--body-text-color-subdued, #6b7280)}.close-btn.svelte-h7g2eb{position:absolute;top:0;right:0;background:none;border:none;color:var(--body-text-color-subdued, #6b7280);font-size:16px;cursor:pointer;padding:0 4px;line-height:1}.detail-grid.svelte-h7g2eb{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;align-items:baseline}.detail-key.svelte-h7g2eb{font-size:var(--text-xs, 11px);color:var(--body-text-color-subdued, #6b7280);white-space:nowrap}.detail-val.svelte-h7g2eb{font-size:var(--text-sm, 12px);color:var(--body-text-color, #1f2937);overflow-wrap:anywhere}.run-link.svelte-h7g2eb{background:none;border:none;padding:0;font-size:var(--text-sm, 12px);color:var(--color-accent, #f97316);cursor:pointer;text-align:left}.preview-footer.svelte-h7g2eb:empty{display:none}.open-btn.svelte-h7g2eb{font-size:var(--text-sm, 12px);padding:4px 12px;border:1px solid var(--border-color-primary, #e5e7eb);border-radius:var(--radius-sm, 4px);background:var(--background-fill-primary, #ffffff);color:var(--body-text-color, #1f2937);cursor:pointer}.open-btn.svelte-h7g2eb:hover{border-color:var(--color-accent, #f97316);color:var(--color-accent, #f97316)}.status.svelte-sqcnye{font-size:var(--text-sm, 12px);color:var(--body-text-color-subdued, #6b7280);padding:6px 0}.lineage.svelte-sqcnye{--lineage-run: #10b981;--lineage-artifact: #3b82f6;flex:1;min-height:0;display:flex;flex-direction:column;gap:8px}.graph-wrap.svelte-sqcnye{flex:1;min-height:0;position:relative}.preview-overlay.svelte-sqcnye{position:absolute;top:8px;right:8px;z-index:5;width:280px;max-width:calc(100% - 16px);max-height:calc(100% - 16px);overflow-y:auto}.preview-overlay.svelte-sqcnye>*{box-sizing:border-box;box-shadow:0 4px 16px #0000002e}.toolbar.svelte-sqcnye{display:flex;align-items:center;gap:12px;min-height:18px}.notice.svelte-sqcnye{font-size:var(--text-xs, 11px);color:var(--color-accent, #f97316)}.legend.svelte-sqcnye{position:absolute;top:8px;left:8px;z-index:4;display:flex;align-items:center;gap:12px;font-size:var(--text-xs, 11px);color:var(--body-text-color-subdued, #6b7280)}.hint.svelte-sqcnye{position:absolute;bottom:8px;right:8px;z-index:4;font-size:var(--text-xs, 11px);color:var(--body-text-color-subdued, #6b7280)}.legend-item.svelte-sqcnye{display:inline-flex;align-items:center;gap:5px}.swatch.svelte-sqcnye{width:10px;height:10px;border-radius:3px;background:var(--background-fill-primary, #ffffff);border:1.5px solid}.swatch.artifact.svelte-sqcnye{border-color:var(--lineage-artifact)}.swatch.run.svelte-sqcnye{border-color:var(--lineage-run)}.target-swatch.svelte-sqcnye{width:11px;height:11px}.target-swatch.svelte-sqcnye .target-ring:where(.svelte-sqcnye){fill:none;stroke:var(--color-accent, #f97316);stroke-width:2}.target-swatch.svelte-sqcnye .target-dot:where(.svelte-sqcnye){fill:var(--color-accent, #f97316)}
|
assets/MSFT_audio_emitter-Dn8xGnZi.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webAudioBus-7GGmRMcj.js","assets/abstractAudioBus-D0ySXXLP.js","assets/math.vector-C1xyPDEl.js","assets/math.scalar.functions-DkeaWAWz.js","assets/tools-D01N7ptR.js","assets/decorators.serialization-C7d7ykGG.js","assets/bufferUtils-DTRdUD8L.js","assets/math.color-CzLaKyb6.js","assets/glTFLoader-BPeiodqB.js","assets/index-Bx1QoKVU.js","assets/index-BfQ3YfM4.css","assets/mesh-Fj-9677A.js","assets/mesh.vertexData-Cr3zcPIw.js","assets/buffer-DqKlo1ts.js","assets/dataBuffer-CgoqiUzT.js","assets/subMesh-UWDo5wjI.js","assets/drawWrapper-CZVk0xN-.js","assets/smartArray-CO6iJ0u5.js","assets/node-C-Iu0ALa.js","assets/math.viewport-CgkTt1RS.js","assets/sceneComponent-Dflhczui.js","assets/math.plane-Ce_75-g5.js","assets/lightConstants-B1TSTh-k.js","assets/sceneLoaderFlags-wywyb9ml.js","assets/math.axis-Ck7JfPPj.js","assets/material-CrEsrP1R.js","assets/texture-BEqhDl5Y.js","assets/baseTexture-CgAggsey.js","assets/drawWrapper.functions-Dzz0ghog.js","assets/cameraInputsManager-WrTH9PVf.js","assets/deviceInputEvents-BTza-zoR.js","assets/bone-B35odufe.js","assets/skeleton-BVUVDN0a.js","assets/rawTexture-Cp8_XuDs.js","assets/animation-IftAdLIx.js","assets/sceneLoader-CutT-qCn.js","assets/scene-gn_hoGMy.js","assets/renderingManager-CiY2OUrf.js","assets/perfCounter-DusmGz8t.js","assets/assetContainer-DOnbxwKX.js","assets/instancedMesh-Cz-e1Hca.js","assets/light-DT53MGnW.js","assets/dynamic-BUKysMyT.js","assets/objectModelMapping-DWcnlpHl.js","assets/webAudioMainBus-DhWe-5w4.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{Q as C,V as h,O as y,M as B,E as $}from"./math.vector-C1xyPDEl.js";import{T as k}from"./tools-D01N7ptR.js";import{L as S,f as Ft,e as kt,G as Ut}from"./bufferUtils-DTRdUD8L.js";import{W as Q,P as wt,A as _}from"./decorators.serialization-C7d7ykGG.js";import{R as Bt}from"./math.scalar.functions-DkeaWAWz.js";import{A as O,G as X}from"./glTFLoader-BPeiodqB.js";import{u as Gt,r as zt}from"./dynamic-BUKysMyT.js";import{b as A}from"./sceneComponent-Dflhczui.js";import{S as V}from"./scene-gn_hoGMy.js";import{_ as R}from"./index-Bx1QoKVU.js";class nt{constructor(t,e,i){this.frame=t,this.action=e,this.onlyOnce=i,this.isDone=!1}_clone(){return new nt(this.frame,this.action,this.onlyOnce)}}const u={coneInnerAngle:6.28318530718,coneOuterAngle:6.28318530718,coneOuterVolume:0,distanceModel:"linear",maxDistance:1e4,minDistance:1,orientation:h.Right(),panningModel:"equalpower",position:h.Zero(),rolloffFactor:1,rotation:h.Zero(),rotationQuaternion:new C};function G(s){return s.spatialEnabled||s.spatialAutoUpdate!==void 0||s.spatialConeInnerAngle!==void 0||s.spatialConeOuterAngle!==void 0||s.spatialConeOuterVolume!==void 0||s.spatialDistanceModel!==void 0||s.spatialMaxDistance!==void 0||s.spatialMinDistance!==void 0||s.spatialMinUpdateTime!==void 0||s.spatialOrientation!==void 0||s.spatialPanningModel!==void 0||s.spatialPosition!==void 0||s.spatialRolloffFactor!==void 0||s.spatialRotation!==void 0||s.spatialRotationQuaternion!==void 0}class Wt{}var ht;(function(s){s[s.HAS_INPUTS=1]="HAS_INPUTS",s[s.HAS_OUTPUTS=2]="HAS_OUTPUTS",s[s.HAS_INPUTS_AND_OUTPUTS=3]="HAS_INPUTS_AND_OUTPUTS"})(ht||(ht={}));class ot{constructor(t,e){this.onDisposeObservable=new y,this.engine=t,e&1&&(this._upstreamNodes=new Set),e&2&&(this._downstreamNodes=new Set)}dispose(){if(this._downstreamNodes){for(const t of Array.from(this._downstreamNodes))if(!this._disconnect(t))throw new Error("Disconnect failed");this._downstreamNodes.clear()}if(this._upstreamNodes){for(const t of Array.from(this._upstreamNodes))if(!t._disconnect(this))throw new Error("Disconnect failed");this._upstreamNodes.clear()}this.onDisposeObservable.notifyObservers(this),this.onDisposeObservable.clear()}_connect(t){return!this._downstreamNodes||this._downstreamNodes.has(t)||!t._onConnect(this)?!1:(this._downstreamNodes.add(t),!0)}_disconnect(t){return!this._downstreamNodes||!this._downstreamNodes.delete(t)?!1:t._onDisconnect(this)}_onConnect(t){return!this._upstreamNodes||this._upstreamNodes.has(t)?!1:(this._upstreamNodes.add(t),!0)}_onDisconnect(t){var e;return((e=this._upstreamNodes)==null?void 0:e.delete(t))??!1}}class vt extends ot{constructor(t,e,i){super(e,i),this.onNameChangedObservable=new y,this._name=t}get name(){return this._name}set name(t){if(this._name===t)return;const e=this._name;this._name=t,this.onNameChangedObservable.notifyObservers({newName:t,oldName:e,node:this})}dispose(){super.dispose(),this.onNameChangedObservable.clear()}}class j extends vt{constructor(t,e){super(t,e,3)}connect(t){if(!this._connect(t))throw new Error("Connect failed")}disconnect(t){if(!this._disconnect(t))throw new Error("Disconnect failed")}disconnectAll(){if(!this._downstreamNodes)throw new Error("Disconnect failed");const t=this._downstreamNodes.values();for(let e=t.next();!e.done;e=t.next())if(!this._disconnect(e.value))throw new Error("Disconnect failed")}}const Tt={volume:1};class Lt extends j{constructor(t){super("Volume",t)}setOptions(t){this.setVolume(t.volume??Tt.volume,{shape:"none"})}}function I(s){return s.getSubNode("Volume")}function qt(s,t){var e;return((e=I(s))==null?void 0:e[t])??Tt[t]}const P={fftSize:2048,minDecibels:-100,maxDecibels:-30,smoothing:.8};function Qt(s){return s.analyzerEnabled||s.analyzerFFTSize!==void 0||s.analyzerMinDecibels!==void 0||s.analyzerMaxDecibels!==void 0||s.analyzerSmoothing!==void 0}class Zt{get frequencyBinCount(){return this.fftSize/2}}class $t extends j{constructor(t){super("Analyzer",t)}setOptions(t){this.fftSize=t.analyzerFFTSize??P.fftSize,this.minDecibels=t.analyzerMinDecibels??P.minDecibels,this.maxDecibels=t.analyzerMaxDecibels??P.maxDecibels,this.smoothing=t.analyzerSmoothing??P.smoothing}}function D(s){return s.getSubNode("Analyzer")}function z(s,t,e){s.callOnSubNode("Analyzer",i=>{i[t]=e})}let Y=null,J=null;function Ot(){return Y||(Y=new Uint8Array),Y}function xt(){return J||(J=new Float32Array),J}class jt extends Zt{constructor(t){super(),this._fftSize=P.fftSize,this._maxDecibels=P.maxDecibels,this._minDecibels=P.minDecibels,this._smoothing=P.smoothing,this._subGraph=t}get fftSize(){return this._fftSize}set fftSize(t){this._fftSize=t,z(this._subGraph,"fftSize",t)}get isEnabled(){return D(this._subGraph)!==null}get minDecibels(){return this._minDecibels}set minDecibels(t){this._minDecibels=t,z(this._subGraph,"minDecibels",t)}get maxDecibels(){return this._maxDecibels}set maxDecibels(t){this._maxDecibels=t,z(this._subGraph,"maxDecibels",t)}get smoothing(){return this._smoothing}set smoothing(t){this._smoothing=t,z(this._subGraph,"smoothing",t)}dispose(){const t=D(this._subGraph);t&&(this._subGraph.removeSubNodeAsync(t),t.dispose())}async enableAsync(){D(this._subGraph)||await this._subGraph.createAndAddSubNodeAsync("Analyzer")}getByteFrequencyData(){const t=D(this._subGraph);return t?t.getByteFrequencyData():(S.Warn("AudioAnalyzer not enabled"),this.enableAsync(),Ot())}getFloatFrequencyData(){const t=D(this._subGraph);return t?t.getFloatFrequencyData():(S.Warn("AudioAnalyzer not enabled"),this.enableAsync(),xt())}}class Ht extends vt{constructor(t,e,i){super(t,e,i),this._analyzer=null}get analyzer(){return this._analyzer??(this._analyzer=new jt(this._subGraph))}get volume(){return qt(this._subGraph,"volume")}set volume(t){const e=I(this._subGraph);if(!e)throw new Error("No volume subnode");e.volume=t}dispose(){var t;super.dispose(),(t=this._analyzer)==null||t.dispose(),this._analyzer=null,this._subGraph.dispose()}setVolume(t,e=null){const i=I(this._subGraph);if(!i)throw new Error("No volume subnode");i.setVolume(t,e)}}class Pt extends Ht{constructor(t,e,i,n=2){super(t,e,n),this._spatialAutoUpdate=!0,this._spatialMinUpdateTime=0,this._outBus=null,this._spatial=null,this._onOutBusDisposed=null,typeof i.spatialAutoUpdate=="boolean"&&(this._spatialAutoUpdate=i.spatialAutoUpdate),typeof i.spatialMinUpdateTime=="number"&&(this._spatialMinUpdateTime=i.spatialMinUpdateTime)}get outBus(){return this._outBus}set outBus(t){if(this._outBus!==t){if(this._outBus&&(this._onOutBusDisposed&&(this._outBus.onDisposeObservable.removeCallback(this._onOutBusDisposed),this._onOutBusDisposed=null),!this._disconnect(this._outBus)))throw new Error("Disconnect failed");if(this._outBus=t,this._outBus&&(this._onOutBusDisposed=()=>{this._outBus=null},this._outBus.onDisposeObservable.add(this._onOutBusDisposed),!this._connect(this._outBus)))throw new Error("Connect failed")}}get spatial(){return this._spatial?this._spatial:this._initSpatialProperty()}dispose(){var t;super.dispose(),(t=this._spatial)==null||t.dispose(),this._spatial=null,this._outBus&&this._onOutBusDisposed&&(this._outBus.onDisposeObservable.removeCallback(this._onOutBusDisposed),this._onOutBusDisposed=null),this._outBus=null}_initSpatialProperty(){return this._spatial=this._createSpatialProperty(this._spatialAutoUpdate,this._spatialMinUpdateTime)}get _isSpatial(){return this._spatial!==null}set _isSpatial(t){t&&!this._spatial?this._initSpatialProperty():!t&&this._spatial&&(this._spatial.dispose(),this._spatial=null)}}const Dt={pan:0};function Xt(s){return s.stereoEnabled||s.stereoPan!==void 0}class Yt{}class Jt extends j{constructor(t){super("Stereo",t)}setOptions(t){this.pan=t.stereoPan??Dt.pan}}function lt(s){return s.getSubNode("Stereo")}function Kt(s,t,e){s.callOnSubNode("Stereo",i=>{i[t]=e})}class at extends Yt{constructor(t){super(),this._pan=Dt.pan,this._subGraph=t}get pan(){return this._pan}set pan(t){this._pan=t,Kt(this._subGraph,"pan",t)}}class st{constructor(t){this._attachmentType=3,this._position=new h,this._rotationQuaternion=new C,this._sceneNode=null,this._useBoundingBox=!1,this.dispose=()=>{this.detach()},this._spatialAudioNode=t}get isAttached(){return this._sceneNode!==null}attach(t,e,i){this._sceneNode!==t&&(this.detach(),t&&(this._attachmentType=i,this._sceneNode=t,this._sceneNode.onDisposeObservable.add(this.dispose),this._useBoundingBox=e))}detach(){var t;(t=this._sceneNode)==null||t.onDisposeObservable.removeCallback(this.dispose),this._sceneNode=null}update(){var t,e;this._attachmentType&1&&(this._useBoundingBox&&this._sceneNode.getBoundingInfo?this._position.copyFrom(this._sceneNode.getBoundingInfo().boundingBox.centerWorld):(t=this._sceneNode)==null||t.getWorldMatrix().getTranslationToRef(this._position),this._spatialAudioNode.position.copyFrom(this._position),this._spatialAudioNode._updatePosition()),this._attachmentType&2&&((e=this._sceneNode)==null||e.getWorldMatrix().decompose(void 0,this._rotationQuaternion),this._spatialAudioNode.rotationQuaternion.copyFrom(this._rotationQuaternion),this._spatialAudioNode._updateRotation())}}class te extends j{constructor(t){super("Spatial",t),this._attacherComponent=null}get isAttached(){return this._attacherComponent!==null&&this._attacherComponent.isAttached}attach(t,e,i){this.detach(),this._attacherComponent||(this._attacherComponent=new st(this)),this._attacherComponent.attach(t,e,i)}detach(){var t;(t=this._attacherComponent)==null||t.detach()}dispose(){var t;super.dispose(),(t=this._attacherComponent)==null||t.dispose(),this._attacherComponent=null}setOptions(t){this.coneInnerAngle=t.spatialConeInnerAngle??u.coneInnerAngle,this.coneOuterAngle=t.spatialConeOuterAngle??u.coneOuterAngle,this.coneOuterVolume=t.spatialConeOuterVolume??u.coneOuterVolume,this.distanceModel=t.spatialDistanceModel??u.distanceModel,this.maxDistance=t.spatialMaxDistance??u.maxDistance,this.minDistance=t.spatialMinDistance??u.minDistance,this.orientation=t.spatialOrientation??u.orientation,this.panningModel=t.spatialPanningModel??u.panningModel,this.rolloffFactor=t.spatialRolloffFactor??u.rolloffFactor,t.spatialPosition&&(this.position=t.spatialPosition.clone()),t.spatialRotationQuaternion?this.rotationQuaternion=t.spatialRotationQuaternion.clone():t.spatialRotation?this.rotation=t.spatialRotation.clone():this.rotationQuaternion=u.rotationQuaternion.clone(),this.update()}update(){var t;this.isAttached?(t=this._attacherComponent)==null||t.update():(this._updatePosition(),this._updateRotation())}}function w(s){return s.getSubNode("Spatial")}function x(s,t,e){s.callOnSubNode("Spatial",i=>{i[t]=e})}const ee=new RegExp("\\.(\\w{3,4})($|\\?)"),v=100,K=new Float32Array([0,0]);let F=null,W=null,L=null;function ie(){if(!W){W=new Float32Array(v);const s=1/(v-1);let t=s;for(let e=1;e<v;e++)W[e]=Math.exp(-11.512925464970227*(1-t)),t+=s}return W}function se(){if(!L){L=new Float32Array(v);const s=1/v;let t=s;for(let e=0;e<v;e++)L[e]=1+Math.log10(t)/Math.log10(v),t+=s}return L}function ne(s,t,e){F||(F=new Float32Array(v));let i;if(s==="linear")return K[0]=t,K[1]=e,K;if(s==="exponential")i=ie();else if(s==="logarithmic")i=se();else throw new Error(`Unknown ramp shape: ${s}`);const n=Math.sign(e-t),o=Math.abs(e-t);if(n===1)for(let a=0;a<i.length;a++)F[a]=t+o*i[a];else{let a=v-1;for(let r=0;r<i.length;r++,a--)F[r]=t-o*(1-i[a])}return F}function U(s){return s.replace(/#/gm,"%23")}function ct(s){const{url:t,headers:e}=Q._CollectCustomizations(s);return Object.keys(e).length>0&&S.Warn("WebAudioStreamingSound: Custom request headers cannot be applied to a streaming <audio> element and will be ignored. To use custom headers with audio, switch to a static (non-streaming) sound which fetches the file up-front."),t}async function oe(s){const t=await Q.FetchAsync(s);if(!t.ok)throw new Error(`HTTP ${t.status} loading '${s}': ${t.statusText}`);const e=await t.arrayBuffer(),i=t.headers.get("Content-Type")??"";return{data:e,contentType:i}}const ae=1e-6;let _t=!0;class f{constructor(t,e){this._rampEndTime=0,this._engine=t,this._param=e,this._targetValue=e.value}get isRamping(){return this._engine.currentTime<this._rampEndTime}get targetValue(){return this._targetValue}set targetValue(t){this.setTargetValue(t)}get value(){return this._param.value}dispose(){this._param=null,this._engine=null}setTargetValue(t,e=null){if(!Number.isFinite(t)){S.Warn(`Attempted to set audio parameter to non-finite value: ${t}`);return}this._param.cancelScheduledValues(0);const i=typeof(e==null?void 0:e.shape)=="string"?e.shape:"linear",n=this._engine.currentTime;if(i==="none"){this._param.value=this._targetValue=t,this._rampEndTime=n;return}let o=typeof(e==null?void 0:e.duration)=="number"?Math.max(e.duration,this._engine.parameterRampDuration):this._engine.parameterRampDuration;if(this._targetValue=t,(o=Math.max(this._engine.parameterRampDuration,o))<ae){this._param.setValueAtTime(t,n);return}try{this._param.setValueCurveAtTime(ne(i,Number.isFinite(this._param.value)?this._param.value:0,t),n,o),this._rampEndTime=n+o}catch(a){_t&&(S.Warn(`Audio parameter ramping failed: ${a.message}`),_t=!1)}}}const ft=B.Zero(),tt=new C;function pt(s){return s*Math.PI/180}function mt(s){return s*180/Math.PI}async function re(s){return new ue(s)}class ue extends te{constructor(t){super(t),this._lastOrientation=h.Zero(),this._lastPosition=h.Zero(),this._lastRotation=h.Zero(),this._lastRotationQuaternion=new C,this.orientation=u.orientation.clone(),this.position=u.position.clone(),this.rotation=u.rotation.clone(),this.rotationQuaternion=u.rotationQuaternion.clone(),this.node=new PannerNode(t._audioContext),this._orientationX=new f(t,this.node.orientationX),this._orientationY=new f(t,this.node.orientationY),this._orientationZ=new f(t,this.node.orientationZ),this._positionX=new f(t,this.node.positionX),this._positionY=new f(t,this.node.positionY),this._positionZ=new f(t,this.node.positionZ)}dispose(){super.dispose(),this._orientationX.dispose(),this._orientationY.dispose(),this._orientationZ.dispose(),this._positionX.dispose(),this._positionY.dispose(),this._positionZ.dispose(),this.node.disconnect()}get coneInnerAngle(){return pt(this.node.coneInnerAngle)}set coneInnerAngle(t){this.node.coneInnerAngle=mt(t)}get coneOuterAngle(){return pt(this.node.coneOuterAngle)}set coneOuterAngle(t){this.node.coneOuterAngle=mt(t)}get coneOuterVolume(){return this.node.coneOuterGain}set coneOuterVolume(t){this.node.coneOuterGain=t}get distanceModel(){return this.node.distanceModel}set distanceModel(t){this.node.distanceModel=t;const e=this.node.maxDistance;this.node.maxDistance=e+.001,this.node.maxDistance=e}get minDistance(){return this.node.refDistance}set minDistance(t){this.node.refDistance=t}get maxDistance(){return this.node.maxDistance}set maxDistance(t){this.node.maxDistance=t}get panningModel(){return this.node.panningModel}set panningModel(t){this.node.panningModel=t}get rolloffFactor(){return this.node.rolloffFactor}set rolloffFactor(t){this.node.rolloffFactor=t}get _inNode(){return this.node}get _outNode(){return this.node}_updatePosition(){this._lastPosition.equalsWithEpsilon(this.position)||(this._positionX.targetValue=this.position.x,this._positionY.targetValue=this.position.y,this._positionZ.targetValue=this.position.z,this._lastPosition.copyFrom(this.position))}_updateRotation(){let t=!1;if(!this._lastRotationQuaternion.equalsWithEpsilon(this.rotationQuaternion))tt.copyFrom(this.rotationQuaternion),this._lastRotationQuaternion.copyFrom(this.rotationQuaternion),t=!0;else if(!this._lastRotation.equalsWithEpsilon(this.rotation))C.FromEulerAnglesToRef(this.rotation.x,this.rotation.y,this.rotation.z,tt),this._lastRotation.copyFrom(this.rotation),t=!0;else if(this._lastOrientation.equalsWithEpsilon(this.orientation))return;t&&(B.FromQuaternionToRef(tt,ft),h.TransformNormalToRef(h.RightReadOnly,ft,this.orientation)),this._orientationX.targetValue=this.orientation.x,this._orientationY.targetValue=this.orientation.y,this._orientationZ.targetValue=this.orientation.z}_connect(t){return super._connect(t)?(t._inNode&&this.node.connect(t._inNode),!0):!1}_disconnect(t){return super._disconnect(t)?(t._inNode&&this.node.disconnect(t._inNode),!0):!1}getClassName(){return"_SpatialWebAudioSubNode"}}async function de(s){return new he(s)}class he extends Jt{constructor(t){super(t),this.node=new StereoPannerNode(t._audioContext),this._pan=new f(t,this.node.pan)}dispose(){super.dispose(),this._pan.dispose()}get pan(){return this._pan.targetValue}set pan(t){this._pan.targetValue=t}get _inNode(){return this.node}get _outNode(){return this.node}getClassName(){return"_StereoWebAudioSubNode"}_connect(t){return super._connect(t)?(t._inNode&&this.node.connect(t._inNode),!0):!1}_disconnect(t){return super._disconnect(t)?(t._inNode&&this.node.disconnect(t._inNode),!0):!1}}class le{constructor(){this._createSubNodePromises={},this._isDisposed=!1,this._subNodes={},this._onSubNodeDisposed=t=>{const e=t;delete this._subNodes[e.name],this._onSubNodesChanged()}}callOnSubNode(t,e){const i=this.getSubNode(t);if(i){e(i);return}this._createSubNodePromisesResolvedAsync().then(()=>{const n=this.getSubNode(t);if(n){e(n);return}this.createAndAddSubNodeAsync(t).then(o=>{e(o)})})}createAndAddSubNodeAsync(t){var e;return(e=this._createSubNodePromises)[t]||(e[t]=this._createSubNode(t).then(i=>(this._addSubNode(i),i))),this._createSubNodePromises[t]}dispose(){this._isDisposed=!0;const t=Object.values(this._subNodes);for(const e of t)e.dispose();this._subNodes={},this._createSubNodePromises={}}getSubNode(t){return this._subNodes[t]??null}async removeSubNodeAsync(t){if(!t)return;await this._createSubNodePromisesResolvedAsync();const e=t.name;this._subNodes[e]&&delete this._subNodes[e],delete this._createSubNodePromises[e],this._onSubNodesChanged()}async _createSubNodePromisesResolvedAsync(){return await Promise.all(Object.values(this._createSubNodePromises))}_addSubNode(t){if(this._isDisposed){t.dispose();return}this._subNodes[t.name]=t,t.onDisposeObservable.addOnce(this._onSubNodeDisposed),this._onSubNodesChanged()}}async function ce(s){return new _e(s)}class _e extends Lt{constructor(t){super(t);const e=this.node=new GainNode(t._audioContext);this._volume=new f(t,e.gain)}dispose(){super.dispose(),this._volume.dispose()}get volume(){return this._volume.value}set volume(t){this.setVolume(t)}get _inNode(){return this.node}get _outNode(){return this.node}setVolume(t,e=null){this._volume.setTargetValue(t,e)}_connect(t){return super._connect(t)?(t._inNode&&this.node.connect(t._inNode),!0):!1}_disconnect(t){return super._disconnect(t)?(t._inNode&&this.node.disconnect(t._inNode),!0):!1}getClassName(){return"_VolumeWebAudioSubNode"}}async function fe(s){return new pe(s)}class pe extends $t{constructor(t){super(t),this._byteFrequencyData=null,this._floatFrequencyData=null,this._analyzerNode=new AnalyserNode(t._audioContext)}get fftSize(){return this._analyzerNode.fftSize}set fftSize(t){t!==this._analyzerNode.fftSize&&(this._analyzerNode.fftSize=t,this._clearArrays())}get _inNode(){return this._analyzerNode}get minDecibels(){return this._analyzerNode.minDecibels}set minDecibels(t){this._analyzerNode.minDecibels=t}get maxDecibels(){return this._analyzerNode.maxDecibels}set maxDecibels(t){this._analyzerNode.maxDecibels=t}get smoothing(){return this._analyzerNode.smoothingTimeConstant}set smoothing(t){this._analyzerNode.smoothingTimeConstant=t}dispose(){super.dispose(),this._clearArrays(),this._byteFrequencyData=null,this._floatFrequencyData=null,this._analyzerNode.disconnect()}getClassName(){return"_WebAudioAnalyzerSubNode"}getByteFrequencyData(){return(!this._byteFrequencyData||this._byteFrequencyData.length===0)&&(this._byteFrequencyData=new Uint8Array(this._analyzerNode.frequencyBinCount)),this._analyzerNode.getByteFrequencyData(this._byteFrequencyData),this._byteFrequencyData}getFloatFrequencyData(){return(!this._floatFrequencyData||this._floatFrequencyData.length===0)&&(this._floatFrequencyData=new Float32Array(this._analyzerNode.frequencyBinCount)),this._analyzerNode.getFloatFrequencyData(this._floatFrequencyData),this._floatFrequencyData}_clearArrays(){var t,e;(t=this._byteFrequencyData)==null||t.set(Ot()),(e=this._floatFrequencyData)==null||e.set(xt())}}class me extends le{constructor(t){super(),this._outputNode=null,this._owner=t}async initAsync(t){const e=Qt(t);if(e&&await this.createAndAddSubNodeAsync("Analyzer"),await this.createAndAddSubNodeAsync("Volume"),await this._createSubNodePromisesResolvedAsync(),e){const n=D(this);if(!n)throw new Error("No analyzer subnode.");n.setOptions(t)}const i=I(this);if(!i)throw new Error("No volume subnode.");if(i.setOptions(t),i.getClassName()!=="_VolumeWebAudioSubNode")throw new Error("Not a WebAudio subnode.");if(this._outputNode=i.node,this._outputNode&&this._downstreamNodes){const n=this._downstreamNodes.values();for(let o=n.next();!o.done;o=n.next()){const a=o.value._inNode;a&&this._outputNode.connect(a)}}}get _inNode(){return this._outputNode}get _outNode(){return this._outputNode}_createSubNode(t){switch(t){case"Analyzer":return fe(this._owner.engine);case"Volume":return ce(this._owner.engine);default:throw new Error(`Unknown subnode name: ${t}`)}}_onSubNodesChanged(){const t=D(this),e=I(this);t&&e&&e.connect(t)}}class rt extends me{constructor(){super(...arguments),this._rootNode=null,this._inputNode=null}async initAsync(t){var n,o;await super.initAsync(t);let e,i;(e=G(t))&&await this.createAndAddSubNodeAsync("Spatial"),(i=Xt(t))&&await this.createAndAddSubNodeAsync("Stereo"),await this._createSubNodePromisesResolvedAsync(),e&&((n=w(this))==null||n.setOptions(t)),i&&((o=lt(this))==null||o.setOptions(t))}get _inNode(){return this._inputNode}_createSubNode(t){try{return super._createSubNode(t)}catch{}switch(t){case"Spatial":return re(this._owner.engine);case"Stereo":return de(this._owner.engine);default:throw new Error(`Unknown subnode name: ${t}`)}}_onSubNodesChanged(){var a,r,d;super._onSubNodesChanged();const t=w(this),e=lt(this),i=I(this);if(t&&t.getClassName()!=="_SpatialWebAudioSubNode")throw new Error("Not a WebAudio subnode.");if(e&&e.getClassName()!=="_StereoWebAudioSubNode")throw new Error("Not a WebAudio subnode.");if(i&&i.getClassName()!=="_VolumeWebAudioSubNode")throw new Error("Not a WebAudio subnode.");t&&(t.disconnectAll(),i&&t.connect(i)),e&&(e.disconnectAll(),i&&e.connect(i)),t&&e?(this._rootNode=new GainNode(this._owner.engine._audioContext),this._rootNode.connect(t._outNode),this._rootNode.connect(e._outNode)):((a=this._rootNode)==null||a.disconnect(),this._rootNode=null);let n=null,o;if(this._rootNode?o=this._rootNode:(t?n=t:e?n=e:i&&(n=i),o=(n==null?void 0:n.node)??null),this._inputNode!==o){if(this._inputNode&&this._upstreamNodes){const l=this._upstreamNodes.values();for(let c=l.next();!c.done;c=l.next())(r=c.value._outNode)==null||r.disconnect(this._inputNode)}if(this._inputNode=o,o&&this._upstreamNodes){const l=this._upstreamNodes.values();for(let c=l.next();!c.done;c=l.next())(d=c.value._outNode)==null||d.connect(o)}}}}class ge extends Wt{constructor(t){super(),this._coneInnerAngle=u.coneInnerAngle,this._coneOuterAngle=u.coneOuterAngle,this._coneOuterVolume=u.coneOuterVolume,this._distanceModel=u.distanceModel,this._maxDistance=u.maxDistance,this._minDistance=u.minDistance,this._panningModel=u.panningModel,this._rolloffFactor=u.rolloffFactor;const e=w(t);e?(this._orientation=e.orientation.clone(),this._position=e.position.clone(),this._rotation=e.rotation.clone(),this._rotationQuaternion=e.rotationQuaternion.clone()):(this._orientation=u.orientation.clone(),this._position=u.position.clone(),this._rotation=u.rotation.clone(),this._rotationQuaternion=u.rotationQuaternion.clone(),t.createAndAddSubNodeAsync("Spatial")),this._subGraph=t}dispose(){this._subGraph.removeSubNodeAsync(w(this._subGraph))}get coneInnerAngle(){return this._coneInnerAngle}set coneInnerAngle(t){this._coneInnerAngle=t,x(this._subGraph,"coneInnerAngle",t)}get coneOuterAngle(){return this._coneOuterAngle}set coneOuterAngle(t){this._coneOuterAngle=t,x(this._subGraph,"coneOuterAngle",t)}get coneOuterVolume(){return this._coneOuterVolume}set coneOuterVolume(t){this._coneOuterVolume=t,x(this._subGraph,"coneOuterVolume",t)}get distanceModel(){return this._distanceModel}set distanceModel(t){this._distanceModel=t,x(this._subGraph,"distanceModel",t)}get isAttached(){var t;return((t=this._subGraph.getSubNode("Spatial"))==null?void 0:t.isAttached)??!1}get maxDistance(){return this._maxDistance}set maxDistance(t){t<=0&&(t=1e-6),this._maxDistance=t,x(this._subGraph,"maxDistance",t)}get minDistance(){return this._minDistance}set minDistance(t){this._minDistance=t,x(this._subGraph,"minDistance",t)}get orientation(){return this._orientation}set orientation(t){this._orientation=t,this._updateRotation()}get panningModel(){return this._panningModel}set panningModel(t){this._panningModel=t,x(this._subGraph,"panningModel",t)}get position(){return this._position}set position(t){this._position=t,this._updatePosition()}get rolloffFactor(){return this._rolloffFactor}set rolloffFactor(t){this._rolloffFactor=t,x(this._subGraph,"rolloffFactor",t)}get rotation(){return this._rotation}set rotation(t){this._rotation=t,this._updateRotation()}get rotationQuaternion(){return this._rotationQuaternion}set rotationQuaternion(t){this._rotationQuaternion=t,this._updateRotation()}attach(t,e=!1,i=3){var n;(n=w(this._subGraph))==null||n.attach(t,e,i)}detach(){var t;(t=w(this._subGraph))==null||t.detach()}update(){const t=w(this._subGraph);t&&(t.isAttached?t.update():(this._updatePosition(t),this._updateRotation(t)))}_updatePosition(t=null){if(!t&&(t=w(this._subGraph),!t))return;t.position.equalsWithEpsilon(this._position)||(t.position.copyFrom(this._position),t._updatePosition())}_updateRotation(t=null){!t&&(t=w(this._subGraph),!t)||(t.rotationQuaternion.equalsWithEpsilon(this._rotationQuaternion)?t.rotation.equalsWithEpsilon(this._rotation)?t.orientation.equalsWithEpsilon(this._orientation)||(t.orientation.copyFrom(this._orientation),t._updateRotation(),this._rotation.copyFrom(t.rotation),this._rotationQuaternion.copyFrom(t.rotationQuaternion)):(t.rotation.copyFrom(this._rotation),t._updateRotation(),this._orientation.copyFrom(t.orientation),this._rotationQuaternion.copyFrom(t.rotationQuaternion)):(t.rotationQuaternion.copyFrom(this._rotationQuaternion),t._updateRotation(),this._orientation.copyFrom(t.orientation),this._rotation.copyFrom(t.rotation)))}}class Et{constructor(t,e,i){if(this._autoUpdate=!0,this._lastUpdateTime=0,this.minUpdateTime=0,!e)return;this.minUpdateTime=i;const n=()=>{if(!this._autoUpdate)return;let o=!1;if(0<this.minUpdateTime){const a=wt.Now;this._lastUpdateTime&&a-this._lastUpdateTime<this.minUpdateTime*1e3&&(o=!0),this._lastUpdateTime=a}o||t.update(),requestAnimationFrame(n)};requestAnimationFrame(n)}dispose(){this._autoUpdate=!1}}class ut extends ge{constructor(t,e,i){super(t),this._updaterComponent=new Et(this,e,i)}get minUpdateTime(){return this._updaterComponent.minUpdateTime}set minUpdateTime(t){this._updaterComponent.minUpdateTime=t}dispose(){super.dispose(),this._updaterComponent.dispose(),this._updaterComponent=null}}class m extends Pt{constructor(t,e,i,n){super(t,i,n),this._stereo=null,this._webAudioNode=null,this._audioContext=this.engine._audioContext,this._webAudioNode=e,this._subGraph=new m._SubGraph(this)}async _initAsync(t){t.outBus?this.outBus=t.outBus:t.outBusAutoDefault!==!1&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(t),G(t)&&this._initSpatialProperty(),this.engine._addNode(this)}get _inNode(){return this._webAudioNode}get _outNode(){return this._subGraph._outNode}get stereo(){return this._stereo??(this._stereo=new at(this._subGraph))}dispose(){if(super.dispose(),this._webAudioNode){if(this._webAudioNode instanceof MediaStreamAudioSourceNode)for(const t of this._webAudioNode.mediaStream.getTracks())t.stop();this._webAudioNode.disconnect(),this._webAudioNode=null}this._stereo=null,this._subGraph.dispose(),this.engine._removeNode(this)}getClassName(){return"_WebAudioSoundSource"}_connect(t){var i;return super._connect(t)?(t._inNode&&((i=this._outNode)==null||i.connect(t._inNode)),!0):!1}_disconnect(t){var i;return super._disconnect(t)?(t._inNode&&((i=this._outNode)==null||i.disconnect(t._inNode)),!0):!1}_createSpatialProperty(t,e){return new ut(this._subGraph,t,e)}}m._SubGraph=class extends rt{get _downstreamNodes(){return this._owner._downstreamNodes??null}get _upstreamNodes(){return this._owner._upstreamNodes??null}_onSubNodesChanged(){var s,t;super._onSubNodesChanged(),(s=this._owner._inNode)==null||s.disconnect(),this._owner._subGraph._inNode&&((t=this._owner._inNode)==null||t.connect(this._owner._subGraph._inNode))}};const be=Object.freeze(Object.defineProperty({__proto__:null,_WebAudioSoundSource:m},Symbol.toStringTag,{value:"Module"}));class Vt extends Pt{constructor(t,e,i){super(t,e,i,3),this._newestInstance=null,this._privateInstances=new Set,this._state=1,this._instances=this._privateInstances,this.onEndedObservable=new y,this._onInstanceEnded=n=>{this._newestInstance===n&&(this._newestInstance=null),this._privateInstances.delete(n),this._instances.size===0&&(this._state=1,this.onEndedObservable.notifyObservers(this)),n.dispose()}}get activeInstancesCount(){return this._instances.size}get autoplay(){return this._options.autoplay}get currentTime(){const t=this._getNewestInstance();return t?t.currentTime:0}set currentTime(t){this.startOffset=t;const e=this._getNewestInstance();e&&(e.currentTime=t)}get loop(){return this._options.loop}set loop(t){this._options.loop=t}get maxInstances(){return this._options.maxInstances}set maxInstances(t){this._options.maxInstances=t}get startOffset(){return this._options.startOffset}set startOffset(t){this._options.startOffset=t}get state(){return this._state}dispose(){super.dispose(),this.stop(),this._newestInstance=null,this._privateInstances.clear(),this.onEndedObservable.clear()}pause(){const t=this._instances.values();for(let e=t.next();!e.done;e=t.next())e.value.pause();this._state=5}resume(){if(this._state!==5)return;const t=this._instances.values();for(let e=t.next();!e.done;e=t.next())e.value.resume();this._state=3}_beforePlay(t){if(this.state===5&&this._instances.size>0){this.resume();return}t.onEndedObservable.addOnce(this._onInstanceEnded),this._privateInstances.add(t),this._newestInstance=t}_afterPlay(t){this._state=t.state}_getNewestInstance(){if(this._instances.size===0)return null;if(!this._newestInstance){const t=this._instances.values();for(let e=t.next();!e.done;e=t.next())this._newestInstance=e.value}return this._newestInstance}_setState(t){this._state=t}_stopExcessInstances(){if(this.maxInstances<1/0){const t=Array.from(this._instances).filter(i=>i.state===3),e=t.length-this.maxInstances;for(let i=0;i<e;i++)t[i].stop()}}}class ye extends Vt{constructor(t,e,i){super(t,e,i)}get duration(){return this._options.duration}set duration(t){this._options.duration=t}get loopStart(){return this._options.loopStart}set loopStart(t){this._options.loopStart=t}get loopEnd(){return this._options.loopEnd}set loopEnd(t){this._options.loopEnd=t}get pitch(){return this._options.pitch}set pitch(t){this._options.pitch=t;const e=this._instances.values();for(let i=e.next();!i.done;i=e.next())i.value.pitch=t}get playbackRate(){return this._options.playbackRate}set playbackRate(t){this._options.playbackRate=t;const e=this._instances.values();for(let i=e.next();!i.done;i=e.next())i.value.playbackRate=t}play(t={}){if(this.state===5){this.resume();return}t.duration??(t.duration=this.duration),t.loop??(t.loop=this.loop),t.loopStart??(t.loopStart=this.loopStart),t.loopEnd??(t.loopEnd=this.loopEnd),t.startOffset??(t.startOffset=this.startOffset),t.volume??(t.volume=1),t.waitTime??(t.waitTime=0);const e=this._createInstance();this._beforePlay(e),e.play(t),this._afterPlay(e),this._stopExcessInstances()}stop(t={}){if(t.waitTime&&0<t.waitTime?this._setState(0):this._setState(1),!!this._instances)for(const e of Array.from(this._instances))e.stop(t)}}let Ae=1;class Se{constructor(t){this.name=`StaticSoundBuffer #${Ae++}`,this.engine=t}}class Mt extends ot{constructor(t){super(t.engine,2),this._state=1,this.onEndedObservable=new y,this.onErrorObservable=new y,this.onStateChangedObservable=new y,this._sound=t}get state(){return this._state}dispose(){super.dispose(),this.stop(),this.onEndedObservable.clear(),this.onStateChangedObservable.clear()}_setState(t){this._state!==t&&(this._state=t,this.onStateChangedObservable.notifyObservers(this),this._state===1&&this.onEndedObservable.notifyObservers(this))}}class Ce extends Mt{}class b extends ye{constructor(t,e,i){super(t,e,i),this._stereo=null,this._options={autoplay:i.autoplay??!1,duration:i.duration??0,loop:i.loop??!1,loopEnd:i.loopEnd??0,loopStart:i.loopStart??0,maxInstances:i.maxInstances??1/0,pitch:i.pitch??0,playbackRate:i.playbackRate??1,startOffset:i.startOffset??0},this._subGraph=new b._SubGraph(this)}async _initAsync(t,e){this._audioContext=this.engine._audioContext,t instanceof H?this._buffer=t:(typeof t=="string"||Array.isArray(t)||t instanceof ArrayBuffer||t instanceof AudioBuffer)&&(this._buffer=await this.engine.createSoundBufferAsync(t,e)),e.outBus?this.outBus=e.outBus:e.outBusAutoDefault!==!1&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(e),G(e)&&this._initSpatialProperty(),e.autoplay&&this.play(),this.engine._addSound(this)}get buffer(){return this._buffer}get _inNode(){return this._subGraph._inNode}get _outNode(){return this._subGraph._outNode}get stereo(){return this._stereo??(this._stereo=new at(this._subGraph))}async cloneAsync(t=null){const e=await this.engine.createSoundAsync(this.name,t!=null&&t.cloneBuffer?this.buffer.clone():this.buffer,this._options);return e.outBus=t!=null&&t.outBus?t.outBus:this.outBus,e}dispose(){super.dispose(),this._stereo=null,this._subGraph.dispose(),this.engine._removeSound(this)}getClassName(){return"_WebAudioStaticSound"}_createInstance(){return new Ne(this,this._options)}_connect(t){var i;return super._connect(t)?(t._inNode&&((i=this._outNode)==null||i.connect(t._inNode)),!0):!1}_disconnect(t){var i;return super._disconnect(t)?(t._inNode&&((i=this._outNode)==null||i.disconnect(t._inNode)),!0):!1}_createSpatialProperty(t,e){return new ut(this._subGraph,t,e)}_getOptions(){return this._options}}b._SubGraph=class extends rt{get _downstreamNodes(){return this._owner._downstreamNodes??null}get _upstreamNodes(){return this._owner._upstreamNodes??null}};class H extends Se{constructor(t){super(t)}async _initAsync(t,e){t instanceof AudioBuffer?this._audioBuffer=t:typeof t=="string"?await this._initFromUrlAsync(t):Array.isArray(t)?await this._initFromUrlsAsync(t,e.skipCodecCheck??!1):t instanceof ArrayBuffer&&await this._initFromArrayBufferAsync(t)}get channelCount(){return this._audioBuffer.numberOfChannels}get duration(){return this._audioBuffer.duration}get length(){return this._audioBuffer.length}get sampleRate(){return this._audioBuffer.sampleRate}clone(t=null){const e=new AudioBuffer({length:this._audioBuffer.length,numberOfChannels:this._audioBuffer.numberOfChannels,sampleRate:this._audioBuffer.sampleRate});for(let n=0;n<this._audioBuffer.numberOfChannels;n++)e.copyToChannel(this._audioBuffer.getChannelData(n),n);const i=new H(this.engine);return i._audioBuffer=e,i.name=t!=null&&t.name?t.name:this.name,i}async _initFromArrayBufferAsync(t){this._audioBuffer=await this.engine._audioContext.decodeAudioData(t)}async _initFromUrlAsync(t){t=U(t);const{data:e}=await oe(t);await this._initFromArrayBufferAsync(e)}async _initFromUrlsAsync(t,e){for(const i of t){if(e)await this._initFromUrlAsync(i);else{const n=i.match(ee),o=n==null?void 0:n.at(1);if(o&&this.engine.isFormatValid(o))try{await this._initFromUrlAsync(i)}catch{o&&0<o.length&&this.engine.flagInvalidFormat(o)}}if(this._audioBuffer)break}}}class Ne extends Ce{constructor(t,e){super(t),this._enginePlayTime=0,this._enginePauseTime=0,this._isConnected=!1,this._pitch=null,this._playbackRate=null,this._sourceNode=null,this._onEnded=()=>{this._enginePlayTime=0,this._state!==5&&this.onEndedObservable.notifyObservers(this),this._deinitSourceNode()},this._onEngineStateChanged=()=>{this.engine.state==="running"&&(this._options.loop&&this.state===2&&this.play(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))},this._options=e,this._volumeNode=new GainNode(t._audioContext),this._initSourceNode()}dispose(){var t,e;super.dispose(),(t=this._pitch)==null||t.dispose(),(e=this._playbackRate)==null||e.dispose(),this.stop(),this._deinitSourceNode(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged)}get currentTime(){if(this._state===1)return 0;const t=this._state===5?0:this.engine.currentTime-this._enginePlayTime;return this._enginePauseTime+t+this._options.startOffset}set currentTime(t){const e=this._state===2||this._state===3;if(e){const i=this._sourceNode;this._deinitSourceNode(),i==null||i.stop(),this._state=1}this.state===5&&(this._enginePauseTime=0),this._options.startOffset=t,e&&this.play()}get _outNode(){return this._volumeNode}set pitch(t){var e;(e=this._pitch)==null||e.setTargetValue(t)}set playbackRate(t){var e;(e=this._playbackRate)==null||e.setTargetValue(t)}get startTime(){return this._state===1?0:this._enginePlayTime}getClassName(){return"_WebAudioStaticSoundInstance"}play(t={}){var i;if(this._state===3)return;t.duration!==void 0&&(this._options.duration=t.duration),t.loop!==void 0&&(this._options.loop=t.loop),t.loopStart!==void 0&&(this._options.loopStart=t.loopStart),t.loopEnd!==void 0&&(this._options.loopEnd=t.loopEnd),t.startOffset!==void 0&&(this._options.startOffset=t.startOffset);let e=this._options.startOffset;this._state===5&&(e+=this._enginePauseTime,e%=this._sound.buffer.duration),this._enginePlayTime=this.engine.currentTime+(t.waitTime??0),this._volumeNode.gain.value=t.volume??1,this._initSourceNode(),this.engine.state==="running"?(this._setState(3),(i=this._sourceNode)==null||i.start(this._enginePlayTime,e,this._options.duration>0?this._options.duration:void 0)):this._options.loop&&(this._setState(2),this.engine.stateChangedObservable.add(this._onEngineStateChanged))}pause(){var e;if(this._state!==3&&this._state!==2)return;const t=this._state===3;this._setState(5),this._enginePauseTime+=this.engine.currentTime-this._enginePlayTime,t?(e=this._sourceNode)==null||e.stop():this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged),this._deinitSourceNode()}resume(){this._state===5&&this.play()}stop(t={}){var e;if(this._state!==1){if(this._state===3){const i=this.engine.currentTime+(t.waitTime??0);(e=this._sourceNode)==null||e.stop(i)}(t.waitTime===void 0||t.waitTime<=0)&&(this._setState(1),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))}}_connect(t){var i;return super._connect(t)?(t instanceof b&&t._inNode&&((i=this._outNode)==null||i.connect(t._inNode),this._isConnected=!0),!0):!1}_disconnect(t){var i;return super._disconnect(t)?(t instanceof b&&t._inNode&&((i=this._outNode)==null||i.disconnect(t._inNode),this._isConnected=!1),!0):!1}_deinitSourceNode(){if(this._sourceNode){if(this._isConnected&&!this._disconnect(this._sound))throw new Error("Disconnect failed");this._sourceNode.disconnect(this._volumeNode),this._sourceNode.removeEventListener("ended",this._onEnded),this._sourceNode=null}}_initSourceNode(){if(!this._sourceNode){if(this._sourceNode=new AudioBufferSourceNode(this._sound._audioContext,{buffer:this._sound.buffer._audioBuffer}),this._sourceNode.addEventListener("ended",this._onEnded,{once:!0}),this._sourceNode.connect(this._volumeNode),!this._connect(this._sound))throw new Error("Connect failed");this._pitch=new f(this.engine,this._sourceNode.detune),this._playbackRate=new f(this.engine,this._sourceNode.playbackRate)}const t=this._sourceNode;t.detune.value=this._sound.pitch,t.loop=this._options.loop,t.loopEnd=this._options.loopEnd,t.loopStart=this._options.loopStart,t.playbackRate.value=this._sound.playbackRate}}const gt=Object.freeze(Object.defineProperty({__proto__:null,_WebAudioStaticSound:b,_WebAudioStaticSoundBuffer:H},Symbol.toStringTag,{value:"Module"}));class we extends Vt{constructor(t,e,i){super(t,e,i),this._preloadedInstances=new Array}get preloadCount(){return this._options.preloadCount??1}get preloadCompletedCount(){return this._preloadedInstances.length}preloadInstanceAsync(){const t=this._createInstance();return this._addPreloadedInstance(t),t.preloadedPromise}async preloadInstancesAsync(t){for(let e=0;e<t;e++)this.preloadInstanceAsync();await Promise.all(this._preloadedInstances.map(async e=>await e.preloadedPromise))}play(t={}){if(this.state===5){this.resume();return}let e;this.preloadCompletedCount>0?(e=this._preloadedInstances[0],e.startOffset=this.startOffset,this._removePreloadedInstance(e)):e=this._createInstance();const i=()=>{e.state===3&&(this._stopExcessInstances(),e.onStateChangedObservable.removeCallback(i))};e.onStateChangedObservable.add(i),t.startOffset??(t.startOffset=this.startOffset),t.loop??(t.loop=this.loop),t.volume??(t.volume=1),this._beforePlay(e),e.play(t),this._afterPlay(e)}stop(){if(this._setState(1),!!this._instances)for(const t of Array.from(this._instances))t.stop()}_addPreloadedInstance(t){this._preloadedInstances.includes(t)||this._preloadedInstances.push(t)}_removePreloadedInstance(t){const e=this._preloadedInstances.indexOf(t);e!==-1&&this._preloadedInstances.splice(e,1)}}class ve extends Mt{constructor(t){super(t),this.onReadyObservable=new y,this.preloadedPromise=new Promise((e,i)=>{this._rejectPreloadedPromise=i,this._resolvePreloadedPromise=e}),this.onErrorObservable.add(this._rejectPreloadedPromise),this.onReadyObservable.add(this._resolvePreloadedPromise)}set startOffset(t){this._options.startOffset=t}dispose(){super.dispose(),this.onErrorObservable.clear(),this.onReadyObservable.clear(),this._resolvePreloadedPromise()}}class E extends we{constructor(t,e,i){super(t,e,i),this._stereo=null,this._options={autoplay:i.autoplay??!1,loop:i.loop??!1,maxInstances:i.maxInstances??1/0,preloadCount:i.preloadCount??1,startOffset:i.startOffset??0},this._subGraph=new E._SubGraph(this)}async _initAsync(t,e){const i=this.engine._audioContext;if(!(i instanceof AudioContext))throw new Error("Unsupported audio context type.");this._audioContext=i,this._source=t,e.outBus?this.outBus=e.outBus:e.outBusAutoDefault!==!1&&(await this.engine.isReadyPromise,this.outBus=this.engine.defaultMainBus),await this._subGraph.initAsync(e),G(e)&&this._initSpatialProperty(),this.preloadCount&&await this.preloadInstancesAsync(this.preloadCount),e.autoplay&&this.play(e),this.engine._addSound(this)}get _inNode(){return this._subGraph._inNode}get _outNode(){return this._subGraph._outNode}get stereo(){return this._stereo??(this._stereo=new at(this._subGraph))}dispose(){super.dispose(),this._stereo=null,this._subGraph.dispose(),this.engine._removeSound(this)}getClassName(){return"_WebAudioStreamingSound"}_createInstance(){return new Te(this,this._options)}_connect(t){var i;return super._connect(t)?(t._inNode&&((i=this._outNode)==null||i.connect(t._inNode)),!0):!1}_disconnect(t){var i;return super._disconnect(t)?(t._inNode&&((i=this._outNode)==null||i.disconnect(t._inNode)),!0):!1}_createSpatialProperty(t,e){return new ut(this._subGraph,t,e)}_getOptions(){return this._options}}E._SubGraph=class extends rt{get _downstreamNodes(){return this._owner._downstreamNodes??null}get _upstreamNodes(){return this._owner._upstreamNodes??null}};class Te extends ve{constructor(t,e){if(super(t),this._currentTimeChangedWhilePaused=!1,this._enginePlayTime=1/0,this._enginePauseTime=0,this._isReady=!1,this._isReadyPromise=new Promise((i,n)=>{this._resolveIsReadyPromise=i,this._rejectIsReadyPromise=n}),this._onCanPlayThrough=()=>{this._isReady=!0,this._resolveIsReadyPromise(this._mediaElement),this.onReadyObservable.notifyObservers(this)},this._onEnded=()=>{this._setState(1)},this._onError=i=>{this._setState(4),this.onErrorObservable.notifyObservers(i),this._rejectIsReadyPromise(i),this.dispose()},this._onEngineStateChanged=()=>{this.engine.state==="running"&&(this._options.loop&&this.state===2&&this.play(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged))},this._onUserGesture=()=>{this.play()},this._options=e,this._volumeNode=new GainNode(t._audioContext),typeof t._source=="string")this._initFromUrl(t._source);else if(Array.isArray(t._source))this._initFromUrls(t._source);else if(t._source instanceof HTMLMediaElement)this._initFromMediaElement(t._source);else throw new Error(`Invalid streaming sound source (${t._source}).`)}get currentTime(){if(this._state===1)return 0;const t=this._state===5?0:this.engine.currentTime-this._enginePlayTime;return this._enginePauseTime+t+this._options.startOffset}set currentTime(t){const e=this._state===2||this._state===3;e&&(this._mediaElement.pause(),this._state=1),this._options.startOffset=t,e?this.play({startOffset:t}):this._state===5&&(this._currentTimeChangedWhilePaused=!0)}get _outNode(){return this._volumeNode}get startTime(){return this._state===1?0:this._enginePlayTime}dispose(){var t;super.dispose(),this.stop(),(t=this._sourceNode)==null||t.disconnect(this._volumeNode),this._sourceNode=null,this._mediaElement.removeEventListener("error",this._onError),this._mediaElement.removeEventListener("ended",this._onEnded),this._mediaElement.removeEventListener("canplaythrough",this._onCanPlayThrough);for(const e of Array.from(this._mediaElement.children))this._mediaElement.removeChild(e);this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged),this.engine.userGestureObservable.removeCallback(this._onUserGesture)}play(t={}){if(this._state===3)return;t.loop!==void 0&&(this._options.loop=t.loop),this._mediaElement.loop=this._options.loop;let e=t.startOffset;this._currentTimeChangedWhilePaused?(e=this._options.startOffset,this._currentTimeChangedWhilePaused=!1):this._state===5&&(e=this.currentTime),e&&e>0&&(this._mediaElement.currentTime=e),this._volumeNode.gain.value=t.volume??1,this._play()}pause(){this._state!==2&&this._state!==3||(this._setState(5),this._enginePauseTime+=this.engine.currentTime-this._enginePlayTime,this._mediaElement.pause())}resume(){this._state===5?this.play():this._currentTimeChangedWhilePaused&&this.play()}stop(){this._state!==1&&this._stop()}getClassName(){return"_WebAudioStreamingSoundInstance"}_connect(t){var i;return super._connect(t)?(t instanceof E&&t._inNode&&((i=this._outNode)==null||i.connect(t._inNode)),!0):!1}_disconnect(t){var i;return super._disconnect(t)?(t instanceof E&&t._inNode&&((i=this._outNode)==null||i.disconnect(t._inNode)),!0):!1}_initFromMediaElement(t){if(k.SetCorsBehavior(t.currentSrc,t),t.controls=!1,t.loop=this._options.loop,t.preload="auto",t.addEventListener("canplaythrough",this._onCanPlayThrough,{once:!0}),t.addEventListener("ended",this._onEnded,{once:!0}),t.addEventListener("error",this._onError,{once:!0}),t.load(),this._sourceNode=new MediaElementAudioSourceNode(this._sound._audioContext,{mediaElement:t}),this._sourceNode.connect(this._volumeNode),!this._connect(this._sound))throw new Error("Connect failed");this._mediaElement=t}_initFromUrl(t){const e=Q.IsCustomRequestAvailable?ct(U(t)):U(t),i=new Audio(e);this._initFromMediaElement(i)}_initFromUrls(t){const e=new Audio;for(const i of t){const n=document.createElement("source");n.src=Q.IsCustomRequestAvailable?ct(U(i)):U(i),e.appendChild(n)}this._initFromMediaElement(e)}_play(){if(this._setState(2),!this._isReady){this._playWhenReady();return}if(this._state===2)if(this.engine.state==="running"){const t=this._mediaElement.play();this._enginePlayTime=this.engine.currentTime,this._setState(3),t.catch(()=>{this._setState(4),this._options.loop&&this.engine.userGestureObservable.addOnce(this._onUserGesture)})}else this._options.loop?this.engine.stateChangedObservable.add(this._onEngineStateChanged):(this.stop(),this._setState(4))}_playWhenReady(){this._isReadyPromise.then(()=>{this._play()}).catch(()=>{S.Error("Streaming sound instance failed to play"),this._setState(4)})}_stop(){this._mediaElement.pause(),this._onEnded(),this.engine.stateChangedObservable.removeCallback(this._onEngineStateChanged)}}const Oe=Object.freeze(Object.defineProperty({__proto__:null,_WebAudioStreamingSound:E},Symbol.toStringTag,{value:"Module"})),bt={duration:0,shape:"linear"},N={duration:0,startOffset:0,waitTime:0},yt={waitTime:0};function q(s){return s*Math.PI/180}function At(s){return s*180/Math.PI}class T{get name(){return this._soundV2.name}set name(t){this._soundV2.name=t}get autoplay(){return this._soundV2 instanceof m?!0:this._optionsV2.autoplay}set autoplay(t){this._optionsV2.autoplay=t}get loop(){return this._soundV2 instanceof m?!0:this._soundV2.loop}set loop(t){this._soundV2 instanceof m||this._soundV2&&(this._soundV2.loop=t)}get isPlaying(){var t;return this._soundV2 instanceof m?!0:((t=this._soundV2)==null?void 0:t.state)===3||!this.isReady()&&this._optionsV2.autoplay}get isPaused(){return this._soundV2 instanceof m?!1:this._soundV2.state===5}get maxDistance(){return this._optionsV2.spatialMaxDistance||100}set maxDistance(t){this._optionsV2.spatialMaxDistance=t,!this.useCustomAttenuation&&this._soundV2&&(this._initSpatial(),this._soundV2.spatial.maxDistance=t)}get distanceModel(){return this._optionsV2.spatialDistanceModel||"linear"}set distanceModel(t){this._optionsV2.spatialDistanceModel=t,this._soundV2&&(this._initSpatial(),this._soundV2.spatial.distanceModel=t)}get currentTime(){return this._soundV2 instanceof m?this._soundV2.engine.currentTime:this._soundV2.currentTime}get spatialSound(){var t;return((t=this._soundV2)==null?void 0:t._isSpatial)??!1}set spatialSound(t){this._soundV2&&(t?this._initSpatial():this._soundV2._isSpatial=!1)}get _onReady(){return this._onReadyObservable||(this._onReadyObservable=new y),this._onReadyObservable}constructor(t,e,i,n=null,o){if(this.useCustomAttenuation=!1,this.soundTrackId=-1,this.refDistance=1,this.rolloffFactor=1,this.metadata=null,this.onEndedObservable=new y,this._localDirection=new h(1,0,0),this._volume=1,this._isReadyToPlay=!1,this._isDirectional=!1,this._isOutputConnected=!1,this._url=null,this._onReadyObservable=null,this._onReadyToPlay=()=>{this._scene.mainSoundTrack.addSound(this),this._isReadyToPlay=!0,this._readyToPlayCallback(),this._onReadyObservable&&this._onReadyObservable.notifyObservers(),this._optionsV2.autoplay&&this.play()},this._onended=()=>{this.onended&&this.onended(),this.onEndedObservable.notifyObservers(this)},i=i||$.LastCreatedScene,!i)return;this._scene=i,T._SceneComponentInitialization(i),this._readyToPlayCallback=n||(()=>{}),this._customAttenuationFunction=(p,M,dt,Le,qe)=>M<dt?p*(1-M/dt):0,o=o||{};const a={analyzerEnabled:!1,autoplay:!1,duration:o.length||0,loop:o.loop||!1,loopEnd:0,loopStart:0,outBus:null,outBusAutoDefault:!1,playbackRate:o.playbackRate||1,pitch:0,skipCodecCheck:o.skipCodecCheck||!1,spatialDistanceModel:o.distanceModel,spatialEnabled:o.spatialSound,spatialMaxDistance:o.maxDistance,spatialMinDistance:o.refDistance,spatialRolloffFactor:o.rolloffFactor,stereoEnabled:!1,startOffset:o.offset||0,volume:o.volume??1};this._volume=o.volume??1,G(a)&&(a.spatialAutoUpdate=!1,a.spatialConeInnerAngle=u.coneInnerAngle,a.spatialConeOuterAngle=u.coneOuterAngle,a.spatialConeOuterVolume=u.coneOuterVolume,a.spatialMinUpdateTime=0,a.spatialOrientation=u.orientation.clone(),a.spatialPanningModel=this._scene.headphone?"HRTF":"equalpower",a.spatialPosition=u.position.clone(),a.spatialRotation=u.rotation.clone(),a.spatialRotationQuaternion=u.rotationQuaternion.clone(),a.spatialMaxDistance===void 0&&(a.spatialMaxDistance=100)),this._optionsV2={...a},this._optionsV2.autoplay=o.autoplay||!1,this.useCustomAttenuation=o.useCustomAttenuation??!1,this.useCustomAttenuation&&(a.spatialMaxDistance=Number.MAX_VALUE,a.volume=0);let r=(o==null?void 0:o.streaming)||!1;if(!_.audioEngine)return;const l=_.audioEngine._v2,c=()=>{if(r){const p={preloadCount:0,...a},M=new E(t,l,p);return M._initAsync(e,a).then(()=>{M.preloadInstancesAsync(1).then(this._onReadyToPlay)}),M}else{const p=new b(t,l,a);return p._initAsync(e,a).then(this._onReadyToPlay),p}};if(!e)this._soundV2=new b(t,l,a);else if(typeof e=="string")this._url=e,this._soundV2=c();else if(e instanceof ArrayBuffer)r=!1,this._soundV2=c();else if(e instanceof HTMLMediaElement)r=!0,this._soundV2=c();else if(e instanceof MediaStream){const p=new MediaStreamAudioSourceNode(l._audioContext,{mediaStream:e});this._soundV2=new m(t,p,l,a),this._soundV2._initAsync(a).then(this._onReadyToPlay)}else e instanceof AudioBuffer?(r=!1,this._soundV2=c()):Array.isArray(e)&&(this._soundV2=c());if(!this._soundV2){S.Error("Parameter must be a URL to the sound, an Array of URLs (.mp3 & .ogg) or an ArrayBuffer of the sound.");return}this._soundV2 instanceof m||this._soundV2.onEndedObservable.add(this._onended)}dispose(){this.isPlaying&&this.stop(),this._isReadyToPlay=!1,this.soundTrackId===-1?this._scene.mainSoundTrack.removeSound(this):this._scene.soundTracks&&this._scene.soundTracks[this.soundTrackId].removeSound(this),this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._connectedTransformNode=null),this._soundV2.dispose()}isReady(){return this._isReadyToPlay}getClassName(){return"Sound"}setAudioBuffer(t){this._isReadyToPlay||this._soundV2 instanceof b&&this._soundV2._initAsync(t,this._optionsV2).then(this._onReadyToPlay)}updateOptions(t){if(t){if(this.loop=t.loop??this.loop,this.maxDistance=t.maxDistance??this.maxDistance,this.useCustomAttenuation=t.useCustomAttenuation??this.useCustomAttenuation,this.rolloffFactor=t.rolloffFactor??this.rolloffFactor,this.refDistance=t.refDistance??this.refDistance,this.distanceModel=t.distanceModel??this.distanceModel,t.playbackRate!==void 0&&this.setPlaybackRate(t.playbackRate),t.spatialSound!==void 0&&(this.spatialSound=t.spatialSound),t.volume!==void 0&&this.setVolume(t.volume),this._soundV2 instanceof b){let e=!1;t.offset!==void 0&&(this._optionsV2.startOffset=t.offset,e=!0),t.length!==void 0&&(this._soundV2.duration=t.length,e=!0),e&&this.isPaused&&this.stop()}this._updateSpatialParameters()}}_updateSpatialParameters(){if(!this.spatialSound)return;const t=this._soundV2.spatial;this.useCustomAttenuation?(t.distanceModel="linear",t.minDistance=1,t.maxDistance=Number.MAX_VALUE,t.rolloffFactor=1,t.panningModel="equalpower"):(t.distanceModel=this.distanceModel,t.minDistance=this.refDistance,t.maxDistance=this.maxDistance,t.rolloffFactor=this.rolloffFactor,t.panningModel=this._optionsV2.spatialPanningModel||"equalpower")}switchPanningModelToHRTF(){this.spatialSound&&(this._initSpatial(),this._soundV2.spatial.panningModel="HRTF")}switchPanningModelToEqualPower(){this.spatialSound&&(this._initSpatial(),this._soundV2.spatial.panningModel="equalpower")}connectToSoundTrackAudioNode(t){const e=this._soundV2._outNode;e&&(this._isOutputConnected&&e.disconnect(),e.connect(t),this._isOutputConnected=!0)}setDirectionalCone(t,e,i){if(e<t){S.Error("setDirectionalCone(): outer angle of the cone must be superior or equal to the inner angle.");return}this._optionsV2.spatialConeInnerAngle=q(t),this._optionsV2.spatialConeOuterAngle=q(e),this._optionsV2.spatialConeOuterVolume=i,this._initSpatial(),this._soundV2.spatial.coneInnerAngle=this._optionsV2.spatialConeInnerAngle,this._soundV2.spatial.coneOuterAngle=this._optionsV2.spatialConeOuterAngle,this._soundV2.spatial.coneOuterVolume=i,this._isDirectional=!0,this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._optionsV2.startOffset,this._optionsV2.duration))}get directionalConeInnerAngle(){return At(typeof this._optionsV2.spatialConeInnerAngle=="number"?this._optionsV2.spatialConeInnerAngle:u.coneInnerAngle)}set directionalConeInnerAngle(t){if(t=q(t),t!=this._optionsV2.spatialConeInnerAngle){if(this.directionalConeOuterAngle<t){S.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");return}this._optionsV2.spatialConeInnerAngle=t,this.spatialSound&&(this._initSpatial(),this._soundV2.spatial.coneInnerAngle=t)}}get directionalConeOuterAngle(){return At(typeof this._optionsV2.spatialConeOuterAngle=="number"?this._optionsV2.spatialConeOuterAngle:u.coneOuterAngle)}set directionalConeOuterAngle(t){if(t=q(t),t!=this._optionsV2.spatialConeOuterAngle){if(t<this.directionalConeInnerAngle){S.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");return}this._optionsV2.spatialConeOuterAngle=t,this.spatialSound&&(this._initSpatial(),this._soundV2.spatial.coneOuterAngle=t)}}setPosition(t){this._optionsV2.spatialPosition&&t.equals(this._optionsV2.spatialPosition)||(this._optionsV2.spatialPosition||(this._optionsV2.spatialPosition=h.Zero()),this._optionsV2.spatialPosition.copyFrom(t),this.spatialSound&&!isNaN(t.x)&&!isNaN(t.y)&&!isNaN(t.z)&&(this._initSpatial(),this._soundV2.spatial.position=t))}setLocalDirectionToMesh(t){this._localDirection=t,this._connectedTransformNode&&this.isPlaying&&this._updateDirection()}_updateDirection(){if(!this._connectedTransformNode||!this.spatialSound)return;const t=this._connectedTransformNode.getWorldMatrix(),e=h.TransformNormal(this._localDirection,t);e.normalize(),this._initSpatial(),this._soundV2.spatial.orientation=e}_initSpatial(){this._soundV2._isSpatial=!0,this._optionsV2.spatialDistanceModel===void 0&&(this._optionsV2.spatialDistanceModel="linear",this._soundV2.spatial.distanceModel="linear"),this._optionsV2.spatialMaxDistance===void 0&&(this._optionsV2.spatialMaxDistance=100,this._soundV2.spatial.maxDistance=100)}updateDistanceFromListener(){if(this._soundV2._outNode&&this._connectedTransformNode&&this.useCustomAttenuation&&this._scene.activeCamera){const t=this._scene.audioListenerPositionProvider?this._connectedTransformNode.position.subtract(this._scene.audioListenerPositionProvider()).length():this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);this._soundV2.volume=this._customAttenuationFunction(this._volume,t,this.maxDistance,this.refDistance,this.rolloffFactor)}}setAttenuationFunction(t){this._customAttenuationFunction=t}play(t,e,i){const n=_.audioEngine;if(n==null||n.unlock(),!(this._soundV2 instanceof m)&&this._isReadyToPlay&&this._scene.audioEnabled){this._soundV2.state===5&&(t!==void 0||e!==void 0||i!==void 0)&&this._soundV2.stop();try{N.duration=i||0,N.startOffset=e!==void 0?e||this._optionsV2.startOffset:this._optionsV2.startOffset,N.waitTime=t||0,N.loop=void 0,N.loopStart=void 0,N.loopEnd=void 0,N.volume=void 0,n!=null&&n.unlocked?this._soundV2.play(N):setTimeout(()=>{this._soundV2.play(N)},500)}catch(o){S.Error("Error while trying to play audio: "+this.name+", "+o.message)}}}stop(t){this._soundV2&&(this._soundV2 instanceof m||(yt.waitTime=t||0,this._soundV2.stop(yt)))}pause(){this._soundV2&&(this._soundV2 instanceof m||this._soundV2.pause())}setVolume(t,e){if(!this.isReady()){this._onReady.addOnce(()=>{this.setVolume(t,e)});return}bt.duration=e||0,this._soundV2.setVolume(t,bt),this._volume=t}setPlaybackRate(t){this._soundV2 instanceof b&&(this._soundV2.playbackRate=t)}getPlaybackRate(){return this._soundV2 instanceof b?this._soundV2.playbackRate:1}getVolume(){return this._volume}attachToMesh(t){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null),this._connectedTransformNode=t,this.spatialSound||(this.spatialSound=!0,this.isPlaying&&this.loop&&(this.stop(),this.play(0,this._optionsV2.startOffset,this._optionsV2.duration))),this._onRegisterAfterWorldMatrixUpdate(this._connectedTransformNode),this._registerFunc=e=>this._onRegisterAfterWorldMatrixUpdate(e),this._connectedTransformNode.registerAfterWorldMatrixUpdate(this._registerFunc)}detachFromMesh(){this._connectedTransformNode&&this._registerFunc&&(this._connectedTransformNode.unregisterAfterWorldMatrixUpdate(this._registerFunc),this._registerFunc=null,this._connectedTransformNode=null)}_onRegisterAfterWorldMatrixUpdate(t){if(!t.getBoundingInfo)this.setPosition(t.absolutePosition);else{const i=t.getBoundingInfo();this.setPosition(i.boundingSphere.centerWorld)}this._isDirectional&&this.isPlaying&&this._updateDirection()}clone(){if(!(this._soundV2 instanceof b))return null;const t={autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,useCustomAttenuation:this.useCustomAttenuation,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel},e=new T(this.name+"_cloned",this._soundV2.buffer,this._scene,null,t);return e._optionsV2=this._optionsV2,this.useCustomAttenuation&&e.setAttenuationFunction(this._customAttenuationFunction),e}getAudioBuffer(){return this._soundV2 instanceof b?this._soundV2.buffer._audioBuffer:null}getSoundSource(){return null}getSoundGain(){return this._soundV2._outNode}serialize(){const t={name:this.name,url:this._url,autoplay:this.autoplay,loop:this.loop,volume:this._volume,spatialSound:this.spatialSound,maxDistance:this.maxDistance,rolloffFactor:this.rolloffFactor,refDistance:this.refDistance,distanceModel:this.distanceModel,playbackRate:this.getPlaybackRate(),panningModel:this._soundV2.spatial.panningModel,soundTrackId:this.soundTrackId,metadata:this.metadata};return this.spatialSound&&(this._connectedTransformNode&&(t.connectedMeshId=this._connectedTransformNode.id),t.position=this._soundV2.spatial.position.asArray(),t.refDistance=this.refDistance,t.distanceModel=this.distanceModel,t.isDirectional=this._isDirectional,t.localDirectionToMesh=this._localDirection.asArray(),t.coneInnerAngle=this.directionalConeInnerAngle,t.coneOuterAngle=this.directionalConeOuterAngle,t.coneOuterGain=this._soundV2.spatial.coneOuterVolume),t}static Parse(t,e,i,n){const o=t.name;let a;t.url?a=i+t.url:a=i+o;const r={autoplay:t.autoplay,loop:t.loop,volume:t.volume,spatialSound:t.spatialSound,maxDistance:t.maxDistance,rolloffFactor:t.rolloffFactor,refDistance:t.refDistance,distanceModel:t.distanceModel,playbackRate:t.playbackRate};let d;if(!n)d=new T(o,a,e,()=>{e.removePendingData(d)},r),e.addPendingData(d);else{const l=()=>{Ft(()=>n._isReadyToPlay,()=>{const c=n.getAudioBuffer();c&&d.setAudioBuffer(c),d._isReadyToPlay=!0,d.autoplay&&d.play(0,n._optionsV2.startOffset,n._optionsV2.duration)},void 0,300)};d=new T(o,new ArrayBuffer(0),e,null,r),l()}if(t.position){const l=h.FromArray(t.position);d.setPosition(l)}if(t.isDirectional&&(d.setDirectionalCone(t.coneInnerAngle||360,t.coneOuterAngle||360,t.coneOuterGain||0),t.localDirectionToMesh)){const l=h.FromArray(t.localDirectionToMesh);d.setLocalDirectionToMesh(l)}if(t.connectedMeshId){const l=e.getMeshById(t.connectedMeshId);l&&d.attachToMesh(l)}return t.metadata&&(d.metadata=t.metadata),d}}T._SceneComponentInitialization=s=>{throw kt("AudioSceneComponent")};Bt("BABYLON.Sound",T);class xe{constructor(t,e,i){if(this.loop=!1,this._coneInnerAngle=360,this._coneOuterAngle=360,this._volume=1,this.isPlaying=!1,this.isPaused=!1,this._sounds=[],this._weights=[],e.length!==i.length)throw new Error("Sounds length does not equal weights length");this.loop=t,this._weights=i;let n=0;for(const a of i)n+=a;const o=n>0?1/n:0;for(let a=0;a<this._weights.length;a++)this._weights[a]*=o;this._sounds=e;for(const a of this._sounds)a.onEndedObservable.add(()=>{this._onended()})}get directionalConeInnerAngle(){return this._coneInnerAngle}set directionalConeInnerAngle(t){if(t!==this._coneInnerAngle){if(this._coneOuterAngle<t){S.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");return}this._coneInnerAngle=t;for(const e of this._sounds)e.directionalConeInnerAngle=t}}get directionalConeOuterAngle(){return this._coneOuterAngle}set directionalConeOuterAngle(t){if(t!==this._coneOuterAngle){if(t<this._coneInnerAngle){S.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");return}this._coneOuterAngle=t;for(const e of this._sounds)e.directionalConeOuterAngle=t}}get volume(){return this._volume}set volume(t){if(t!==this._volume)for(const e of this._sounds)e.setVolume(t)}_onended(){this._currentIndex!==void 0&&(this._sounds[this._currentIndex].autoplay=!1),this.loop&&this.isPlaying?this.play():this.isPlaying=!1}pause(){this.isPlaying&&(this.isPaused=!0,this._currentIndex!==void 0&&this._sounds[this._currentIndex].pause())}stop(){this.isPlaying=!1,this._currentIndex!==void 0&&this._sounds[this._currentIndex].stop()}play(t){if(!this.isPaused){this.stop();const i=Math.random();let n=0;for(let o=0;o<this._weights.length;o++)if(n+=this._weights[o],i<=n){this._currentIndex=o;break}}const e=this._sounds[this._currentIndex??0];e.isReady()?e.play(0,this.isPaused?void 0:t):e.autoplay=!0,this.isPlaying=!0,this.isPaused=!1}}class Pe{constructor(t,e={}){this.id=-1,this._isInitialized=!1,t=t||$.LastCreatedScene,t&&(this._scene=t,this.soundCollection=[],this._options=e,!this._options.mainTrack&&this._scene.soundTracks&&(this._scene.soundTracks.push(this),this.id=this._scene.soundTracks.length-1))}_initializeSoundTrackAudioGraph(){var t;(t=_.audioEngine)!=null&&t.canUseWebAudio&&_.audioEngine.audioContext&&(this._outputAudioNode=_.audioEngine.audioContext.createGain(),this._outputAudioNode.connect(_.audioEngine.masterGain),this._options&&this._options.volume&&(this._outputAudioNode.gain.value=this._options.volume),this._isInitialized=!0)}dispose(){if(_.audioEngine&&_.audioEngine.canUseWebAudio){for(this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas();this.soundCollection.length;)this.soundCollection[0].dispose();this._outputAudioNode&&this._outputAudioNode.disconnect(),this._outputAudioNode=null}}addSound(t){var e;this._isInitialized||this._initializeSoundTrackAudioGraph(),(e=_.audioEngine)!=null&&e.canUseWebAudio&&this._outputAudioNode&&t.connectToSoundTrackAudioNode(this._outputAudioNode),t.soundTrackId!==void 0&&(t.soundTrackId===-1?this._scene.mainSoundTrack.removeSound(t):this._scene.soundTracks&&this._scene.soundTracks[t.soundTrackId].removeSound(t)),this.soundCollection.push(t),t.soundTrackId=this.id}removeSound(t){const e=this.soundCollection.indexOf(t);e!==-1&&this.soundCollection.splice(e,1)}setVolume(t){var e;(e=_.audioEngine)!=null&&e.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.gain.value=t)}switchPanningModelToHRTF(){var t;if((t=_.audioEngine)!=null&&t.canUseWebAudio)for(let e=0;e<this.soundCollection.length;e++)this.soundCollection[e].switchPanningModelToHRTF()}switchPanningModelToEqualPower(){var t;if((t=_.audioEngine)!=null&&t.canUseWebAudio)for(let e=0;e<this.soundCollection.length;e++)this.soundCollection[e].switchPanningModelToEqualPower()}connectToAnalyser(t){var e;this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser=t,(e=_.audioEngine)!=null&&e.canUseWebAudio&&this._outputAudioNode&&(this._outputAudioNode.disconnect(),this._connectedAnalyser.connectAudioNodes(this._outputAudioNode,_.audioEngine.masterGain))}}class De{constructor(t){this._mainBuses=new Set,this._sounds=new Set,this._soundsArray=null,this._nodes=new Set,this._defaultMainBus=null,this._parameterRampDuration=.01,typeof t.parameterRampDuration=="number"&&(this.parameterRampDuration=t.parameterRampDuration)}get defaultMainBus(){return this._mainBuses.size===0?null:(this._defaultMainBus||(this._defaultMainBus=Array.from(this._mainBuses)[0]),this._defaultMainBus)}get parameterRampDuration(){return this._parameterRampDuration}set parameterRampDuration(t){this._parameterRampDuration=Math.max(0,t)}get sounds(){return this._soundsArray||(this._soundsArray=Array.from(this._sounds)),this._soundsArray}dispose(){const t=this._nodes.values();for(let e=t.next();!e.done;e=t.next())e.value.dispose();this._mainBuses.clear(),this._nodes.clear(),this._sounds.clear(),this._disposeSoundsArray(),this._defaultMainBus=null}unlockAsync(){return this.resumeAsync()}_addMainBus(t){this._mainBuses.add(t),this._addNode(t)}_removeMainBus(t){this._mainBuses.delete(t),this._defaultMainBus=null,this._removeNode(t)}_addNode(t){this._nodes.add(t)}_removeNode(t){this._nodes.delete(t)}_addSound(t){this._disposeSoundsArray(),this._sounds.add(t),this._addNode(t)}_removeSound(t){this._disposeSoundsArray(),this._sounds.delete(t),this._removeNode(t)}_disposeSoundsArray(){this._soundsArray&&(this._soundsArray.length=0,this._soundsArray=null)}}const Ee={position:h.Zero(),rotation:h.Zero(),rotationQuaternion:new C};function Ve(s){return s.listenerEnabled||s.listenerMinUpdateTime!==void 0||s.listenerPosition!==void 0||s.listenerRotation!==void 0||s.listenerRotationQuaternion!==void 0}class Me{}class Re extends Me{constructor(){super(),this._attacherComponent=null,this._attacherComponent=new st(this)}get isAttached(){return this._attacherComponent!==null&&this._attacherComponent.isAttached}attach(t,e=!1,i=3){this._attacherComponent||(this._attacherComponent=new st(this)),this._attacherComponent.attach(t,e,i)}detach(){var t;(t=this._attacherComponent)==null||t.detach()}dispose(){var t;(t=this._attacherComponent)==null||t.dispose(),this._attacherComponent=null}setOptions(t){t.listenerMinUpdateTime!==void 0&&(this.minUpdateTime=t.listenerMinUpdateTime),t.listenerPosition&&(this.position=t.listenerPosition.clone()),t.listenerRotationQuaternion?this.rotationQuaternion=t.listenerRotationQuaternion.clone():t.listenerRotation?this.rotation=t.listenerRotation.clone():this.rotationQuaternion=Ee.rotationQuaternion.clone(),this.update()}}const et=B.Zero(),it=new C,St=h.Zero(),Ct=h.Zero();function Nt(s,t,e){const i=s._audioContext.listener;return i.forwardX&&i.forwardY&&i.forwardZ&&i.positionX&&i.positionY&&i.positionZ&&i.upX&&i.upY&&i.upZ?new Ie(s,t,e):new Fe(s,t,e)}class Rt extends Re{constructor(t,e,i){super(),this._lastPosition=h.Zero(),this._lastRotation=h.Zero(),this._lastRotationQuaternion=new C,this.position=h.Zero(),this.rotation=h.Zero(),this.rotationQuaternion=new C,this._listener=t._audioContext.listener,this.engine=t,this._updaterComponent=new Et(this,e,i)}dispose(){super.dispose(),this._updaterComponent.dispose(),this._updaterComponent=null}get minUpdateTime(){return this._updaterComponent.minUpdateTime}set minUpdateTime(t){this._updaterComponent.minUpdateTime=t}update(){var t;this.isAttached?(t=this._attacherComponent)==null||t.update():(this._updatePosition(),this._updateRotation())}_updatePosition(){this._lastPosition.equalsWithEpsilon(this.position)||(this._setWebAudioPosition(this.position),this._lastPosition.copyFrom(this.position))}_updateRotation(){if(!this._lastRotationQuaternion.equalsWithEpsilon(this.rotationQuaternion))it.copyFrom(this.rotationQuaternion),this._lastRotationQuaternion.copyFrom(this.rotationQuaternion);else if(!this._lastRotation.equalsWithEpsilon(this.rotation))C.FromEulerAnglesToRef(this.rotation.x,this.rotation.y,this.rotation.z,it),this._lastRotation.copyFrom(this.rotation);else return;B.FromQuaternionToRef(it,et),h.TransformNormalToRef(h.RightHandedForwardReadOnly,et,St),h.TransformNormalToRef(h.Up(),et,Ct),this._setWebAudioOrientation(St,Ct)}}class Ie extends Rt{constructor(t,e,i){super(t,e,i);const n=t._audioContext.listener;this._forwardX=new f(t,n.forwardX),this._forwardY=new f(t,n.forwardY),this._forwardZ=new f(t,n.forwardZ),this._positionX=new f(t,n.positionX),this._positionY=new f(t,n.positionY),this._positionZ=new f(t,n.positionZ),this._upX=new f(t,n.upX),this._upY=new f(t,n.upY),this._upZ=new f(t,n.upZ)}_setWebAudioPosition(t){this.isAttached&&(this._positionX.isRamping||this._positionY.isRamping||this._positionZ.isRamping)||(this._positionX.targetValue=t.x,this._positionY.targetValue=t.y,this._positionZ.targetValue=t.z)}_setWebAudioOrientation(t,e){this.isAttached&&(this._forwardX.isRamping||this._forwardY.isRamping||this._forwardZ.isRamping||this._upX.isRamping||this._upY.isRamping||this._upZ.isRamping)||(this._forwardX.targetValue=t.x,this._forwardY.targetValue=t.y,this._forwardZ.targetValue=t.z,this._upX.targetValue=e.x,this._upY.targetValue=e.y,this._upZ.targetValue=e.z)}}class Fe extends Rt{_setWebAudioPosition(t){this._listener.setPosition(t.x,t.y,t.z)}_setWebAudioOrientation(t,e){this._listener.setOrientation(t.x,t.y,t.z,e.x,e.y,e.z)}}class ke extends ot{constructor(t){super(t,1)}}class Ue extends ke{constructor(t){super(t),this._setGainNode(new GainNode(t._audioContext))}dispose(){super.dispose(),this._volume.dispose(),this._gainNode.disconnect(),this._destinationNode.disconnect()}get _inNode(){return this._gainNode}set _inNode(t){this._gainNode!==t&&this._setGainNode(t)}get volume(){return this._volume.targetValue}set volume(t){this._volume.targetValue=t}get _destinationNode(){return this.engine._audioDestination}getClassName(){return"_WebAudioMainOut"}setVolume(t,e=null){this._volume.setTargetValue(t,e)}_setGainNode(t){var e;this._gainNode!==t&&((e=this._gainNode)==null||e.disconnect(),t.connect(this._destinationNode),this._volume=new f(this.engine,t.gain),this._gainNode=t)}}class Be{constructor(t,e){var o,a;this._button=null,this._enabled=!0,this._style=null,this._onStateChanged=()=>{this._button&&(this._engine.state==="running"?this._hide():this._show())},this._engine=t;const i=e||((a=(o=$.LastCreatedEngine)==null?void 0:o.getInputElement())==null?void 0:a.parentElement)||document.body,n=((i==null?void 0:i.offsetTop)||0)+20;this._style=document.createElement("style"),this._style.appendChild(document.createTextNode(`.babylonUnmute{position:absolute;top:${n}px;margin-left:20px;height:40px;width:60px;background-color:rgba(51,51,51,0.7);background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2239%22%20height%3D%2232%22%20viewBox%3D%220%200%2039%2032%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M9.625%2018.938l-0.031%200.016h-4.953q-0.016%200-0.031-0.016v-12.453q0-0.016%200.031-0.016h4.953q0.031%200%200.031%200.016v12.453zM12.125%207.688l8.719-8.703v27.453l-8.719-8.719-0.016-0.047v-9.938zM23.359%207.875l1.406-1.406%204.219%204.203%204.203-4.203%201.422%201.406-4.219%204.219%204.219%204.203-1.484%201.359-4.141-4.156-4.219%204.219-1.406-1.422%204.219-4.203z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E");background-size:80%;background-repeat:no-repeat;background-position:center;background-position-y:4px;border:none;outline:none;transition:transform 0.125s ease-out;cursor:pointer;z-index:9999;}.babylonUnmute:hover{transform:scale(1.05)}`)),document.head.appendChild(this._style),this._button=document.createElement("button"),this._button.className="babylonUnmute",this._button.id="babylonUnmuteButton",this._button.addEventListener("click",()=>{this._engine.unlockAsync()}),i.appendChild(this._button),this._engine.stateChangedObservable.add(this._onStateChanged)}dispose(){var t,e;(t=this._button)==null||t.remove(),this._button=null,(e=this._style)==null||e.remove(),this._style=null,this._engine.stateChangedObservable.removeCallback(this._onStateChanged)}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?this._engine.state!=="running"&&this._show():this._hide()}_show(){!this._button||!this._enabled||(this._button.style.display="block")}_hide(){this._button&&(this._button.style.display="none")}}const Ge={aac:"audio/aac",ac3:"audio/ac3",flac:"audio/flac",m4a:"audio/mp4",mp3:'audio/mpeg; codecs="mp3"',mp4:"audio/mp4",ogg:'audio/ogg; codecs="vorbis"',wav:"audio/wav",webm:'audio/webm; codecs="vorbis"'};class ze extends De{constructor(t={}){super(t),this._audioContextStarted=!1,this._destinationNode=null,this._invalidFormats=new Set,this._isUpdating=!1,this._listener=null,this._listenerAutoUpdate=!0,this._listenerMinUpdateTime=0,this._pauseCalled=!1,this._resumeOnInteraction=!0,this._resumeOnPause=!0,this._resumeOnPauseRetryInterval=1e3,this._resumeOnPauseTimerId=null,this._resumePromise=null,this._silentHtmlAudio=null,this._unmuteUI=null,this._updateObservable=null,this._validFormats=new Set,this._volume=1,this._isUsingOfflineAudioContext=!1,this.isReadyPromise=new Promise(e=>{this._resolveIsReadyPromise=e}),this.stateChangedObservable=new y,this.userGestureObservable=new y,this._initAudioContextAsync=async()=>{this._audioContext.addEventListener("statechange",this._onAudioContextStateChange),this._mainOut=new Ue(this),this._mainOut.volume=this._volume,await this.createMainBusAsync("default")},this._onAudioContextStateChange=()=>{this.state==="running"&&(clearInterval(this._resumeOnPauseTimerId),this._audioContextStarted=!0,this._resumePromise=null),(this.state==="suspended"||this.state==="interrupted")&&this._audioContextStarted&&this._resumeOnPause&&!this._pauseCalled&&(clearInterval(this._resumeOnPauseTimerId),this._resumeOnPauseTimerId=setInterval(()=>{this.resumeAsync()},this._resumeOnPauseRetryInterval)),this.stateChangedObservable.notifyObservers(this.state)},this._onUserGestureAsync=async()=>{if(this._resumeOnInteraction&&await this._audioContext.resume(),!this._silentHtmlAudio){this._silentHtmlAudio=document.createElement("audio");const e=this._silentHtmlAudio;e.controls=!1,e.preload="auto",e.loop=!0,e.src="data:audio/wav;base64,UklGRjAAAABXQVZFZm10IBAAAAABAAEAgLsAAAB3AQACABAAZGF0YQwAAAAAAAEA/v8CAP//AQA=",e.play()}this.userGestureObservable.notifyObservers()},this._startUpdating=()=>{if(!this._isUpdating)if(this._isUpdating=!0,this.state==="running")this._update();else{const e=()=>{this.state==="running"&&(this._update(),this.stateChangedObservable.removeCallback(e))};this.stateChangedObservable.add(e)}},this._update=()=>{var e;(e=this._updateObservable)!=null&&e.hasObservers()?(this._updateObservable.notifyObservers(),requestAnimationFrame(this._update)):this._isUpdating=!1},typeof t.listenerAutoUpdate=="boolean"&&(this._listenerAutoUpdate=t.listenerAutoUpdate),typeof t.listenerMinUpdateTime=="number"&&(this._listenerMinUpdateTime=t.listenerMinUpdateTime),this._volume=t.volume??1,t.audioContext?(this._isUsingOfflineAudioContext=t.audioContext instanceof OfflineAudioContext,this._audioContext=t.audioContext):this._audioContext=new AudioContext,t.disableDefaultUI||(this._unmuteUI=new Be(this,t.defaultUIParentElement))}async _initAsync(t){this._resumeOnInteraction=typeof t.resumeOnInteraction=="boolean"?t.resumeOnInteraction:!0,this._resumeOnPause=typeof t.resumeOnPause=="boolean"?t.resumeOnPause:!0,this._resumeOnPauseRetryInterval=t.resumeOnPauseRetryInterval??1e3,document.addEventListener("click",this._onUserGestureAsync),await this._initAudioContextAsync(),Ve(t)&&(this._listener=Nt(this,this._listenerAutoUpdate,this._listenerMinUpdateTime),this._listener.setOptions(t)),this._resolveIsReadyPromise()}get currentTime(){return this._audioContext.currentTime??0}get _inNode(){return this._audioContext.destination}get mainOut(){return this._mainOut}get listener(){return this._listener??(this._listener=Nt(this,this._listenerAutoUpdate,this._listenerMinUpdateTime))}get state(){return this._isUsingOfflineAudioContext?"running":this._audioContext.state}get volume(){return this._volume}set volume(t){this._volume!==t&&(this._volume=t,this._mainOut&&(this._mainOut.volume=t))}get _audioDestination(){return this._destinationNode?this._destinationNode:this._destinationNode=this._audioContext.destination}set _audioDestination(t){this._destinationNode=t}get _unmuteUIEnabled(){return this._unmuteUI?this._unmuteUI.enabled:!1}set _unmuteUIEnabled(t){this._unmuteUI&&(this._unmuteUI.enabled=t)}async createBusAsync(t,e={}){const i=await R(()=>import("./webAudioBus-7GGmRMcj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43])),n=new i._WebAudioBus(t,this,e);return await n._initAsync(e),n}async createMainBusAsync(t,e={}){const i=await R(()=>import("./webAudioMainBus-DhWe-5w4.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43])),n=new i._WebAudioMainBus(t,this);return await n._initAsync(e),n}async createMicrophoneSoundSourceAsync(t,e){let i;try{i=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(n){throw new Error("Unable to access microphone: "+n,{cause:n})}return await this.createSoundSourceAsync(t,new MediaStreamAudioSourceNode(this._audioContext,{mediaStream:i}),{outBusAutoDefault:!1,...e})}async createSoundAsync(t,e,i={}){const n=await R(()=>Promise.resolve().then(()=>gt),void 0),o=new n._WebAudioStaticSound(t,this,i);return await o._initAsync(e,i),o}async createSoundBufferAsync(t,e={}){const i=await R(()=>Promise.resolve().then(()=>gt),void 0),n=new i._WebAudioStaticSoundBuffer(this);return await n._initAsync(t,e),n}async createSoundSourceAsync(t,e,i={}){const n=await R(()=>Promise.resolve().then(()=>be),void 0),o=new n._WebAudioSoundSource(t,e,this,i);return await o._initAsync(i),o}async createStreamingSoundAsync(t,e,i={}){const n=await R(()=>Promise.resolve().then(()=>Oe),void 0),o=new n._WebAudioStreamingSound(t,this,i);return await o._initAsync(e,i),o}dispose(){var t,e,i,n;super.dispose(),(t=this._listener)==null||t.dispose(),this._listener=null,this._audioContext.state!=="closed"&&!this._isUsingOfflineAudioContext&&this._audioContext.close(),document.removeEventListener("click",this._onUserGestureAsync),this._audioContext.removeEventListener("statechange",this._onAudioContextStateChange),(e=this._silentHtmlAudio)==null||e.remove(),(i=this._updateObservable)==null||i.clear(),this._updateObservable=null,(n=this._unmuteUI)==null||n.dispose(),this._unmuteUI=null,this.stateChangedObservable.clear()}flagInvalidFormat(t){this._invalidFormats.add(t)}isFormatValid(t){if(this._validFormats.has(t))return!0;if(this._invalidFormats.has(t))return!1;const e=Ge[t];return e===void 0?!1:new Audio().canPlayType(e)===""?(this._invalidFormats.add(t),!1):(this._validFormats.add(t),!0)}async pauseAsync(){await this._audioContext.suspend(),this._pauseCalled=!0}resumeAsync(){return this._pauseCalled=!1,this._resumePromise?this._resumePromise:(this._resumePromise=this._audioContext.resume(),this.stateChangedObservable.notifyObservers(this.state),this._resumePromise)}setVolume(t,e=null){if(this._mainOut)this._mainOut.setVolume(t,e);else throw new Error("Main output not initialized yet.")}_addMainBus(t){super._addMainBus(t)}_removeMainBus(t){super._removeMainBus(t)}_addNode(t){super._addNode(t)}_removeNode(t){super._removeNode(t)}_addSound(t){super._addSound(t)}_removeSound(t){super._removeSound(t)}_addUpdateObserver(t){this._updateObservable||(this._updateObservable=new y),this._updateObservable.add(t),this._startUpdating()}_removeUpdateObserver(t){this._updateObservable&&this._updateObservable.removeCallback(t)}}_.AudioEngineFactory=(s,t,e)=>new We(s,t,e);class We{get masterGain(){return this._masterGain}set masterGain(t){this._masterGain=this._v2.mainOut._inNode=t}get useCustomUnlockedButton(){return this._useCustomUnlockedButton}set useCustomUnlockedButton(t){this._useCustomUnlockedButton=t,this._v2._unmuteUIEnabled=!t}get audioContext(){return this._v2.state==="running"&&this._triggerRunningStateAsync(),this._v2._audioContext}constructor(t=null,e=null,i=null){this._tryToRun=!1,this._useCustomUnlockedButton=!1,this.canUseWebAudio=!0,this.WarnedWebAudioUnsupported=!1,this.isMP3supported=!1,this.isOGGsupported=!1,this.unlocked=!1,this.onAudioUnlockedObservable=new y,this.onAudioLockedObservable=new y;const n=new ze({audioContext:e||void 0,defaultUIParentElement:t!=null&&t.parentElement?t.parentElement:void 0});n._unmuteUIEnabled=!1,this._masterGain=new GainNode(n._audioContext),n._audioDestination=i,n.stateChangedObservable.add(o=>{o==="running"?(this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this)):(this.unlocked=!1,this.onAudioLockedObservable.notifyObservers(this))}),n._initAsync({resumeOnInteraction:!1}).then(()=>{const o=n.defaultMainBus._outNode;o&&(o.disconnect(n.mainOut._inNode),o.connect(this._masterGain)),n.mainOut._inNode=this._masterGain,n.stateChangedObservable.notifyObservers(n.state)}),this.isMP3supported=n.isFormatValid("mp3"),this.isOGGsupported=n.isFormatValid("ogg"),this._v2=n}lock(){this._v2._audioContext.suspend(),this._useCustomUnlockedButton||(this._v2._unmuteUIEnabled=!0)}unlock(){var t;if(((t=this._v2._audioContext)==null?void 0:t.state)==="running"){this.unlocked||(this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this));return}this._triggerRunningStateAsync()}_resumeAudioContextOnStateChange(){var t;(t=this._v2._audioContext)==null||t.addEventListener("statechange",()=>{var e;this.unlocked&&((e=this._v2._audioContext)==null?void 0:e.state)!=="running"&&this._resumeAudioContextAsync()},{once:!0,passive:!0,signal:AbortSignal.timeout(3e3)})}_resumeAudioContextAsync(){return this._v2._isUsingOfflineAudioContext?Promise.resolve():(this._v2._audioContext.state==="suspended"&&!this._useCustomUnlockedButton&&(this._v2._unmuteUIEnabled=!0),this._v2._audioContext.resume())}dispose(){this._v2.dispose(),this.onAudioUnlockedObservable.clear(),this.onAudioLockedObservable.clear()}getGlobalVolume(){return this.masterGain.gain.value}setGlobalVolume(t){this.masterGain.gain.value=t}connectToAnalyser(t){this._connectedAnalyser&&this._connectedAnalyser.stopDebugCanvas(),this._connectedAnalyser=t,this.masterGain.disconnect(),this._connectedAnalyser.connectAudioNodes(this.masterGain,this._v2._audioContext.destination)}async _triggerRunningStateAsync(){if(this._tryToRun){this._v2._audioContext.resume();return}this._tryToRun=!0,await this._resumeAudioContextAsync(),this._tryToRun=!1,this.unlocked=!0,this.onAudioUnlockedObservable.notifyObservers(this)}}Object.defineProperty(V.prototype,"mainSoundTrack",{get:function(){let s=this._getComponent(A.NAME_AUDIO);return s||(s=new g(this),this._addComponent(s)),this._mainSoundTrack||(this._mainSoundTrack=new Pe(this,{mainTrack:!0})),this._mainSoundTrack},enumerable:!0,configurable:!0});V.prototype.getSoundByName=function(s){let t;for(t=0;t<this.mainSoundTrack.soundCollection.length;t++)if(this.mainSoundTrack.soundCollection[t].name===s)return this.mainSoundTrack.soundCollection[t];if(this.soundTracks){for(let e=0;e<this.soundTracks.length;e++)for(t=0;t<this.soundTracks[e].soundCollection.length;t++)if(this.soundTracks[e].soundCollection[t].name===s)return this.soundTracks[e].soundCollection[t]}return null};Object.defineProperty(V.prototype,"audioEnabled",{get:function(){let s=this._getComponent(A.NAME_AUDIO);return s||(s=new g(this),this._addComponent(s)),s.audioEnabled},set:function(s){let t=this._getComponent(A.NAME_AUDIO);t||(t=new g(this),this._addComponent(t)),s?t.enableAudio():t.disableAudio()},enumerable:!0,configurable:!0});Object.defineProperty(V.prototype,"headphone",{get:function(){let s=this._getComponent(A.NAME_AUDIO);return s||(s=new g(this),this._addComponent(s)),s.headphone},set:function(s){let t=this._getComponent(A.NAME_AUDIO);t||(t=new g(this),this._addComponent(t)),s?t.switchAudioModeForHeadphones():t.switchAudioModeForNormalSpeakers()},enumerable:!0,configurable:!0});Object.defineProperty(V.prototype,"audioListenerPositionProvider",{get:function(){let s=this._getComponent(A.NAME_AUDIO);return s||(s=new g(this),this._addComponent(s)),s.audioListenerPositionProvider},set:function(s){let t=this._getComponent(A.NAME_AUDIO);if(t||(t=new g(this),this._addComponent(t)),s&&typeof s!="function")throw new Error("The value passed to [Scene.audioListenerPositionProvider] must be a function that returns a Vector3");t.audioListenerPositionProvider=s},enumerable:!0,configurable:!0});Object.defineProperty(V.prototype,"audioListenerRotationProvider",{get:function(){let s=this._getComponent(A.NAME_AUDIO);return s||(s=new g(this),this._addComponent(s)),s.audioListenerRotationProvider},set:function(s){let t=this._getComponent(A.NAME_AUDIO);if(t||(t=new g(this),this._addComponent(t)),s&&typeof s!="function")throw new Error("The value passed to [Scene.audioListenerRotationProvider] must be a function that returns a Vector3");t.audioListenerRotationProvider=s},enumerable:!0,configurable:!0});Object.defineProperty(V.prototype,"audioPositioningRefreshRate",{get:function(){let s=this._getComponent(A.NAME_AUDIO);return s||(s=new g(this),this._addComponent(s)),s.audioPositioningRefreshRate},set:function(s){let t=this._getComponent(A.NAME_AUDIO);t||(t=new g(this),this._addComponent(t)),t.audioPositioningRefreshRate=s},enumerable:!0,configurable:!0});class g{get audioEnabled(){return this._audioEnabled}get headphone(){return this._headphone}constructor(t){this.name=A.NAME_AUDIO,this._audioEnabled=!0,this._headphone=!1,this.audioPositioningRefreshRate=500,this.audioListenerPositionProvider=null,this.audioListenerRotationProvider=null,this._cachedCameraDirection=new h,this._cachedCameraPosition=new h,this._lastCheck=0,this._invertMatrixTemp=new B,this._cameraDirectionTemp=new h,t=t||$.LastCreatedScene,t&&(this.scene=t,t.soundTracks=[],t.sounds=[])}register(){this.scene._afterRenderStage.registerStep(A.STEP_AFTERRENDER_AUDIO,this,this._afterRender)}rebuild(){}serialize(t){if(t.sounds=[],this.scene.soundTracks)for(let e=0;e<this.scene.soundTracks.length;e++){const i=this.scene.soundTracks[e];for(let n=0;n<i.soundCollection.length;n++)t.sounds.push(i.soundCollection[n].serialize())}}addFromContainer(t){if(t.sounds)for(const e of t.sounds)e.play(),e.autoplay=!0,this.scene.mainSoundTrack.addSound(e)}removeFromContainer(t,e=!1){if(t.sounds)for(const i of t.sounds)i.stop(),i.autoplay=!1,this.scene.mainSoundTrack.removeSound(i),e&&i.dispose()}dispose(){const t=this.scene;if(t._mainSoundTrack&&t.mainSoundTrack.dispose(),t.soundTracks)for(let e=0;e<t.soundTracks.length;e++)t.soundTracks[e].dispose()}disableAudio(){const t=this.scene;this._audioEnabled=!1,_.audioEngine&&_.audioEngine.audioContext&&_.audioEngine.audioContext.suspend();let e;for(e=0;e<t.mainSoundTrack.soundCollection.length;e++)t.mainSoundTrack.soundCollection[e].pause();if(t.soundTracks)for(e=0;e<t.soundTracks.length;e++)for(let i=0;i<t.soundTracks[e].soundCollection.length;i++)t.soundTracks[e].soundCollection[i].pause()}enableAudio(){const t=this.scene;this._audioEnabled=!0,_.audioEngine&&_.audioEngine.audioContext&&_.audioEngine.audioContext.resume();let e;for(e=0;e<t.mainSoundTrack.soundCollection.length;e++)t.mainSoundTrack.soundCollection[e].isPaused&&t.mainSoundTrack.soundCollection[e].play();if(t.soundTracks)for(e=0;e<t.soundTracks.length;e++)for(let i=0;i<t.soundTracks[e].soundCollection.length;i++)t.soundTracks[e].soundCollection[i].isPaused&&t.soundTracks[e].soundCollection[i].play()}switchAudioModeForHeadphones(){const t=this.scene;if(this._headphone=!0,t.mainSoundTrack.switchPanningModelToHRTF(),t.soundTracks)for(let e=0;e<t.soundTracks.length;e++)t.soundTracks[e].switchPanningModelToHRTF()}switchAudioModeForNormalSpeakers(){const t=this.scene;if(this._headphone=!1,t.mainSoundTrack.switchPanningModelToEqualPower(),t.soundTracks)for(let e=0;e<t.soundTracks.length;e++)t.soundTracks[e].switchPanningModelToEqualPower()}_afterRender(){const t=wt.Now;if(this._lastCheck&&t-this._lastCheck<this.audioPositioningRefreshRate)return;this._lastCheck=t;const e=this.scene;if(!this._audioEnabled||!e._mainSoundTrack||!e.soundTracks||e._mainSoundTrack.soundCollection.length===0&&e.soundTracks.length===1)return;const i=_.audioEngine;if(i&&i.audioContext){let n=e.activeCamera;if(e.activeCameras&&e.activeCameras.length>0&&(n=e.activeCameras[0]),this.audioListenerPositionProvider){const a=this.audioListenerPositionProvider();i.audioContext.listener.setPosition(a.x||0,a.y||0,a.z||0)}else n?this._cachedCameraPosition.equals(n.globalPosition)||(this._cachedCameraPosition.copyFrom(n.globalPosition),i.audioContext.listener.setPosition(n.globalPosition.x,n.globalPosition.y,n.globalPosition.z)):i.audioContext.listener.setPosition(0,0,0);if(this.audioListenerRotationProvider){const a=this.audioListenerRotationProvider();i.audioContext.listener.setOrientation(a.x||0,a.y||0,a.z||0,0,1,0)}else n?(n.rigCameras&&n.rigCameras.length>0&&(n=n.rigCameras[0]),n.getViewMatrix().invertToRef(this._invertMatrixTemp),h.TransformNormalToRef(g._CameraDirection,this._invertMatrixTemp,this._cameraDirectionTemp),this._cameraDirectionTemp.normalize(),!isNaN(this._cameraDirectionTemp.x)&&!isNaN(this._cameraDirectionTemp.y)&&!isNaN(this._cameraDirectionTemp.z)&&(this._cachedCameraDirection.equals(this._cameraDirectionTemp)||(this._cachedCameraDirection.copyFrom(this._cameraDirectionTemp),i.audioContext.listener.setOrientation(this._cameraDirectionTemp.x,this._cameraDirectionTemp.y,this._cameraDirectionTemp.z,0,1,0)))):i.audioContext.listener.setOrientation(0,0,0,0,1,0);let o;for(o=0;o<e.mainSoundTrack.soundCollection.length;o++){const a=e.mainSoundTrack.soundCollection[o];a.useCustomAttenuation&&a.updateDistanceFromListener()}if(e.soundTracks)for(o=0;o<e.soundTracks.length;o++)for(let a=0;a<e.soundTracks[o].soundCollection.length;a++){const r=e.soundTracks[o].soundCollection[a];r.useCustomAttenuation&&r.updateDistanceFromListener()}}}}g._CameraDirection=new h(0,0,-1);T._SceneComponentInitialization=s=>{let t=s._getComponent(A.NAME_AUDIO);t||(t=new g(s),s._addComponent(t))};const Z="MSFT_audio_emitter";class It{constructor(t){this.name=Z,this._loader=t,this.enabled=this._loader.isExtensionUsed(Z)}dispose(){this._loader=null,this._clips=null,this._emitters=null}onLoading(){const t=this._loader.gltf.extensions;if(t&&t[this.name]){const e=t[this.name];this._clips=e.clips,this._emitters=e.emitters,O.Assign(this._clips),O.Assign(this._emitters)}}loadSceneAsync(t,e){return X.LoadExtensionAsync(t,e,this.name,async(i,n)=>{const o=new Array;o.push(this._loader.loadSceneAsync(t,e));for(const a of n.emitters){const r=O.Get(`${i}/emitters`,this._emitters,a);if(r.refDistance!=null||r.maxDistance!=null||r.rolloffFactor!=null||r.distanceModel!=null||r.innerAngle!=null||r.outerAngle!=null)throw new Error(`${i}: Direction or Distance properties are not allowed on emitters attached to a scene`);o.push(this._loadEmitterAsync(`${i}/emitters/${r.index}`,r))}await Promise.all(o)})}loadNodeAsync(t,e,i){return X.LoadExtensionAsync(t,e,this.name,async(n,o)=>{const a=new Array,r=await this._loader.loadNodeAsync(n,e,d=>{for(const l of o.emitters){const c=O.Get(`${n}/emitters`,this._emitters,l);a.push(this._loadEmitterAsync(`${n}/emitters/${c.index}`,c).then(()=>{for(const p of c._babylonSounds)p.attachToMesh(d),(c.innerAngle!=null||c.outerAngle!=null)&&(p.setLocalDirectionToMesh(h.Forward()),p.setDirectionalCone(2*k.ToDegrees(c.innerAngle==null?Math.PI:c.innerAngle),2*k.ToDegrees(c.outerAngle==null?Math.PI:c.outerAngle),0))}))}i(d)});return await Promise.all(a),r})}loadAnimationAsync(t,e){return X.LoadExtensionAsync(t,e,this.name,async(i,n)=>{const o=await this._loader.loadAnimationAsync(t,e),a=new Array;O.Assign(n.events);for(const r of n.events)a.push(this._loadAnimationEventAsync(`${i}/events/${r.index}`,t,e,r,o));return await Promise.all(a),o})}_loadClipAsync(t,e){if(e._objectURL)return e._objectURL;let i;if(e.uri)i=this._loader.loadUriAsync(t,e,e.uri);else{const n=O.Get(`${t}/bufferView`,this._loader.gltf.bufferViews,e.bufferView);i=this._loader.loadBufferViewAsync(`/bufferViews/${n.index}`,n)}return e._objectURL=i.then(n=>{const o=Ut(n);return URL.createObjectURL(new Blob([o],{type:e.mimeType}))}),e._objectURL}_loadEmitterAsync(t,e){if(e._babylonSounds=e._babylonSounds||[],!e._babylonData){const i=new Array,n=e.name||`emitter${e.index}`,o={loop:!1,autoplay:!1,volume:e.volume==null?1:e.volume};for(let r=0;r<e.clips.length;r++){const d=`/extensions/${this.name}/clips`,l=O.Get(d,this._clips,e.clips[r].clip);i.push(this._loadClipAsync(`${d}/${e.clips[r].clip}`,l).then(c=>{const p=e._babylonSounds[r]=new T(n,c,this._loader.babylonScene,null,o);p.refDistance=e.refDistance||1,p.maxDistance=e.maxDistance||256,p.rolloffFactor=e.rolloffFactor||1,p.distanceModel=e.distanceModel||"exponential"}))}const a=Promise.all(i).then(()=>{const r=e.clips.map(l=>l.weight||1),d=new xe(e.loop||!1,e._babylonSounds,r);e.innerAngle&&(d.directionalConeInnerAngle=2*k.ToDegrees(e.innerAngle)),e.outerAngle&&(d.directionalConeOuterAngle=2*k.ToDegrees(e.outerAngle)),e.volume&&(d.volume=e.volume),e._babylonData.sound=d});e._babylonData={loaded:a}}return e._babylonData.loaded}_getEventAction(t,e,i,n,o){switch(i){case"play":return a=>{const r=(o||0)+(a-n);e.play(r)};case"stop":return()=>{e.stop()};case"pause":return()=>{e.pause()};default:throw new Error(`${t}: Unsupported action ${i}`)}}_loadAnimationEventAsync(t,e,i,n,o){if(o.targetedAnimations.length==0)return Promise.resolve();const a=o.targetedAnimations[0],r=n.emitter,d=O.Get(`/extensions/${this.name}/emitters`,this._emitters,r);return this._loadEmitterAsync(t,d).then(()=>{const l=d._babylonData.sound;if(l){const c=new nt(n.time,this._getEventAction(t,l,n.action,n.time,n.startOffset));a.animation.addEvent(c),o.onAnimationGroupEndObservable.add(()=>{l.stop()}),o.onAnimationGroupPauseObservable.add(()=>{l.pause()})}})}}Gt(Z);zt(Z,!0,s=>new It(s));const ei=Object.freeze(Object.defineProperty({__proto__:null,MSFT_audio_emitter:It},Symbol.toStringTag,{value:"Module"}));export{Ht as A,ei as M,G as _,at as a,ut as b,rt as c,me as d};
|
assets/MSFT_lod-Cdx3a5qt.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{O as u}from"./math.vector-C1xyPDEl.js";import{G as p,D as O,A as c}from"./glTFLoader-BPeiodqB.js";import{u as g,r as b}from"./dynamic-BUKysMyT.js";import"./math.scalar.functions-DkeaWAWz.js";import"./index-Bx1QoKVU.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const _="MSFT_lod";class x{constructor(e){var s;this.name=_,this.order=100,this.maxLODsToLoad=10,this.onNodeLODsLoadedObservable=new u,this.onMaterialLODsLoadedObservable=new u,this._bufferLODs=new Array,this._nodeIndexLOD=null,this._nodeSignalLODs=new Array,this._nodePromiseLODs=new Array,this._nodeBufferLODs=new Array,this._materialIndexLOD=null,this._materialSignalLODs=new Array,this._materialPromiseLODs=new Array,this._materialBufferLODs=new Array,this._loader=e,this.maxLODsToLoad=((s=this._loader.parent.extensionOptions[_])==null?void 0:s.maxLODsToLoad)??this.maxLODsToLoad,this.enabled=this._loader.isExtensionUsed(_)}dispose(){this._loader=null,this._nodeIndexLOD=null,this._nodeSignalLODs.length=0,this._nodePromiseLODs.length=0,this._nodeBufferLODs.length=0,this._materialIndexLOD=null,this._materialSignalLODs.length=0,this._materialPromiseLODs.length=0,this._materialBufferLODs.length=0,this.onMaterialLODsLoadedObservable.clear(),this.onNodeLODsLoadedObservable.clear()}onReady(){for(let e=0;e<this._nodePromiseLODs.length;e++){const s=Promise.all(this._nodePromiseLODs[e]).then(()=>{e!==0&&(this._loader.endPerformanceCounter(`Node LOD ${e}`),this._loader.log(`Loaded node LOD ${e}`)),this.onNodeLODsLoadedObservable.notifyObservers(e),e!==this._nodePromiseLODs.length-1&&(this._loader.startPerformanceCounter(`Node LOD ${e+1}`),this._loadBufferLOD(this._nodeBufferLODs,e+1),this._nodeSignalLODs[e]&&this._nodeSignalLODs[e].resolve())});this._loader._completePromises.push(s)}for(let e=0;e<this._materialPromiseLODs.length;e++){const s=Promise.all(this._materialPromiseLODs[e]).then(()=>{e!==0&&(this._loader.endPerformanceCounter(`Material LOD ${e}`),this._loader.log(`Loaded material LOD ${e}`)),this.onMaterialLODsLoadedObservable.notifyObservers(e),e!==this._materialPromiseLODs.length-1&&(this._loader.startPerformanceCounter(`Material LOD ${e+1}`),this._loadBufferLOD(this._materialBufferLODs,e+1),this._materialSignalLODs[e]&&this._materialSignalLODs[e].resolve())});this._loader._completePromises.push(s)}}loadSceneAsync(e,s){const t=this._loader.loadSceneAsync(e,s);return this._loadBufferLOD(this._bufferLODs,0),t}loadNodeAsync(e,s,t){return p.LoadExtensionAsync(e,s,this.name,async(i,a)=>{let n;const d=this._getLODs(i,s,this._loader.gltf.nodes,a.ids);this._loader.logOpen(`${i}`);for(let o=0;o<d.length;o++){const l=d[o];o!==0&&(this._nodeIndexLOD=o,this._nodeSignalLODs[o]=this._nodeSignalLODs[o]||new O);const r=m=>{t(m),m.setEnabled(!1)},h=this._loader.loadNodeAsync(`/nodes/${l.index}`,l,r).then(m=>{if(o!==0){const L=d[o-1];L._babylonTransformNode&&(this._disposeTransformNode(L._babylonTransformNode),delete L._babylonTransformNode)}return m.setEnabled(!0),m});this._nodePromiseLODs[o]=this._nodePromiseLODs[o]||[],o===0?n=h:(this._nodeIndexLOD=null,this._nodePromiseLODs[o].push(h))}return this._loader.logClose(),await n})}_loadMaterialAsync(e,s,t,i,a){return this._nodeIndexLOD?null:p.LoadExtensionAsync(e,s,this.name,async(n,d)=>{let o;const l=this._getLODs(n,s,this._loader.gltf.materials,d.ids);this._loader.logOpen(`${n}`);for(let r=0;r<l.length;r++){const h=l[r];r!==0&&(this._materialIndexLOD=r);const m=this._loader._loadMaterialAsync(`/materials/${h.index}`,h,t,i,L=>{r===0&&a(L)}).then(L=>{if(r!==0){a(L);const f=l[r-1]._data;f[i]&&(this._disposeMaterials([f[i].babylonMaterial]),delete f[i])}return L});this._materialPromiseLODs[r]=this._materialPromiseLODs[r]||[],r===0?o=m:(this._materialIndexLOD=null,this._materialPromiseLODs[r].push(m))}return this._loader.logClose(),await o})}_loadUriAsync(e,s,t){if(this._nodeIndexLOD!==null){this._loader.log("deferred");const i=this._nodeIndexLOD-1;return this._nodeSignalLODs[i]=this._nodeSignalLODs[i]||new O,this._nodeSignalLODs[this._nodeIndexLOD-1].promise.then(async()=>await this._loader.loadUriAsync(e,s,t))}else if(this._materialIndexLOD!==null){this._loader.log("deferred");const i=this._materialIndexLOD-1;return this._materialSignalLODs[i]=this._materialSignalLODs[i]||new O,this._materialSignalLODs[i].promise.then(async()=>await this._loader.loadUriAsync(e,s,t))}return null}loadBufferAsync(e,s,t,i){if(this._loader.parent.useRangeRequests&&!s.uri){if(!this._loader.bin)throw new Error(`${e}: Uri is missing or the binary glTF is missing its binary chunk`);const a=async(n,d)=>{const o=t,l=o+i-1;let r=n[d];return r?(r.start=Math.min(r.start,o),r.end=Math.max(r.end,l)):(r={start:o,end:l,loaded:new O},n[d]=r),await r.loaded.promise.then(h=>new Uint8Array(h.buffer,h.byteOffset+t-r.start,i))};return this._loader.log("deferred"),this._nodeIndexLOD!==null?a(this._nodeBufferLODs,this._nodeIndexLOD):this._materialIndexLOD!==null?a(this._materialBufferLODs,this._materialIndexLOD):a(this._bufferLODs,0)}return null}_loadBufferLOD(e,s){const t=e[s];t&&(this._loader.log(`Loading buffer range [${t.start}-${t.end}]`),this._loader.bin.readAsync(t.start,t.end-t.start+1).then(i=>{t.loaded.resolve(i)},i=>{t.loaded.reject(i)}))}_getLODs(e,s,t,i){if(this.maxLODsToLoad<=0)throw new Error("maxLODsToLoad must be greater than zero");const a=[];for(let n=i.length-1;n>=0;n--)if(a.push(c.Get(`${e}/ids/${i[n]}`,t,i[n])),a.length===this.maxLODsToLoad)return a;return a.push(s),a}_disposeTransformNode(e){const s=[],t=e.material;t&&s.push(t);for(const a of e.getChildMeshes())a.material&&s.push(a.material);e.dispose();const i=s.filter(a=>this._loader.babylonScene.meshes.every(n=>n.material!=a));this._disposeMaterials(i)}_disposeMaterials(e){const s={};for(const t of e){for(const i of t.getActiveTextures())s[i.uniqueId]=i;t.dispose()}for(const t in s)for(const i of this._loader.babylonScene.materials)i.hasTexture(s[t])&&delete s[t];for(const t in s)s[t].dispose()}}g(_);b(_,!0,D=>new x(D));export{x as MSFT_lod};
|
assets/MSFT_minecraftMesh-BBQMzJvK.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as n}from"./glTFLoader-BPeiodqB.js";import{u as d,r as a}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const i="MSFT_minecraftMesh";class h{constructor(t){this.name=i,this._loader=t,this.enabled=this._loader.isExtensionUsed(i)}dispose(){this._loader=null}loadMaterialPropertiesAsync(t,p,r){return n.LoadExtraAsync(t,p,this.name,async(e,m)=>{if(m){if(!this._loader._pbrMaterialImpl)throw new Error(`${e}: Material type not supported`);const s=this._loader.loadMaterialPropertiesAsync(t,p,r);return r.needAlphaBlending()&&(r.forceDepthWrite=!0,r.separateCullingPass=!0),r.backFaceCulling=r.forceDepthWrite,r.twoSidedLighting=!0,await s}})}}d(i);a(i,!0,o=>new h(o));export{h as MSFT_minecraftMesh};
|
assets/MSFT_sRGBFactors-UWXoGqn-.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as n}from"./glTFLoader-BPeiodqB.js";import{u as c,r as l}from"./dynamic-BUKysMyT.js";import"./index-Bx1QoKVU.js";import"./math.vector-C1xyPDEl.js";import"./math.scalar.functions-DkeaWAWz.js";import"./math.color-CzLaKyb6.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./bufferUtils-DTRdUD8L.js";import"./mesh-Fj-9677A.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./cameraInputsManager-WrTH9PVf.js";import"./deviceInputEvents-BTza-zoR.js";import"./bone-B35odufe.js";import"./skeleton-BVUVDN0a.js";import"./rawTexture-Cp8_XuDs.js";import"./animation-IftAdLIx.js";import"./sceneLoader-CutT-qCn.js";import"./scene-gn_hoGMy.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";import"./assetContainer-DOnbxwKX.js";import"./instancedMesh-Cz-e1Hca.js";import"./light-DT53MGnW.js";import"./objectModelMapping-DWcnlpHl.js";const t="MSFT_sRGBFactors";class d{constructor(o){this.name=t,this._loader=o,this.enabled=this._loader.isExtensionUsed(t)}dispose(){this._loader=null}loadMaterialPropertiesAsync(o,p,i){return n.LoadExtraAsync(o,p,this.name,async(u,m)=>{if(m){const r=this._loader._getOrCreateMaterialAdapter(i),a=this._loader.loadMaterialPropertiesAsync(o,p,i),s=i.getScene().getEngine().useExactSrgbConversions;return r.baseColorTexture||r.baseColor.toLinearSpaceToRef(r.baseColor,s),r.specularColorTexture||r.specularColor.toLinearSpaceToRef(r.specularColor,s),await a}})}}c(t);l(t,!0,e=>new d(e));export{d as MSFT_sRGBFactors};
|
assets/abstractAudioBus-D0ySXXLP.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{A as o}from"./MSFT_audio_emitter-Dn8xGnZi.js";class A extends o{constructor(s,t){super(s,t,3)}}export{A};
|
assets/abstractEngine.cubeTexture-C895Ky-E.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{A as x,R as v,g as A,a as R}from"./decorators.serialization-C7d7ykGG.js";import{L as G}from"./bufferUtils-DTRdUD8L.js";import{_ as W}from"./engine-DaBDhQ20.js";function b(e){const i=e.split("?")[0],t=i.lastIndexOf(".");return t>-1?i.substring(t).toLowerCase():""}x.prototype._partialLoadFile=function(e,i,t,n,r=null){const s=a=>{t[i]=a,t._internalCount++,t._internalCount===6&&n(t)},l=(a,f)=>{r&&a&&r(a.status+" "+a.statusText,f)};this._loadFile(e,s,void 0,void 0,!0,l)};x.prototype._cascadeLoadFiles=function(e,i,t,n=null){const r=[];r._internalCount=0;for(let s=0;s<6;s++)this._partialLoadFile(t[s],s,r,i,n)};x.prototype._cascadeLoadImgs=function(e,i,t,n,r=null,s){const l=[];l._internalCount=0;for(let a=0;a<6;a++)this._partialLoadImg(n[a],a,l,e,i,t,r,s)};x.prototype._partialLoadImg=function(e,i,t,n,r,s,l=null,a){const f=v();A(e,p=>{t[i]=p,t._internalCount++,n&&n.removePendingData(f),t._internalCount===6&&s&&s(r,t)},(p,h)=>{n&&n.removePendingData(f),l&&l(p,h)},n?n.offlineProvider:null,a),n&&n.addPendingData(f)};x.prototype.createCubeTextureBase=function(e,i,t,n,r=null,s=null,l,a=null,f=!1,m=0,L=0,p=null,h=null,C=null,P=!1,g=null){const o=p||new R(this,7);o.isCube=!0,o.url=e,o.generateMipMaps=!n,o._lodGenerationScale=m,o._lodGenerationOffset=L,o._useSRGBBuffer=!!P&&this._caps.supportSRGBBuffers&&(this.version>1||this.isWebGPU||!!n),o!==p&&(o.label=e.substring(0,60)),this._doNotHandleContextLost||(o._extension=a,o._files=t,o._buffer=g);const T=e;this._transformTextureUrl&&!p&&(e=this._transformTextureUrl(e));const I=a??b(e),y=W(I),_=(u,d)=>{o.dispose(),s?s(u,d):u&&G.Warn(u)},D=(u,d)=>{e===T?u&&_(u.status+" "+u.statusText,d):(G.Warn(`Failed to load ${e}, falling back to the ${T}`),this.createCubeTextureBase(T,i,t,!!n,r,_,l,a,f,m,L,o,h,C,P,g))};if(y)y.then(u=>{const d=c=>{h&&h(o,c),u.loadCubeData(c,o,f,r,(w,F)=>{_(w,F)})};g?d(g):t&&t.length===6?u.supportCascades?this._cascadeLoadFiles(i,c=>d(c.map(w=>new Uint8Array(w))),t,_):_("Textures type does not support cascades."):this._loadFile(e,c=>d(new Uint8Array(c)),void 0,i?i.offlineProvider||null:void 0,!0,D)});else{if(!t||t.length===0)throw new Error("Cannot load cubemap because files were not defined, or the correct loader was not found.");this._cascadeLoadImgs(i,o,(u,d)=>{C&&C(u,d)},t,_)}return this._internalTexturesCache.push(o),o};
|
assets/animation-IftAdLIx.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{T as d,M as y,Q as h,V as M,a as v}from"./math.vector-C1xyPDEl.js";import{Color3 as E,Color4 as p}from"./math.color-CzLaKyb6.js";import{L as V,e as S,R as Y}from"./math.scalar.functions-DkeaWAWz.js";import{N as m}from"./node-C-Iu0ALa.js";import{S as k}from"./baseTexture-CgAggsey.js";import{S as b,W as F}from"./decorators.serialization-C7d7ykGG.js";class _{constructor(n,e,s){this.name=n,this.from=e,this.to=s}clone(){return new _(this.name,this.from,this.to)}}const D=Object.freeze(new h(0,0,0,0)),w=Object.freeze(M.Zero()),K=Object.freeze(v.Zero()),U=Object.freeze(k.Zero()),z=Object.freeze(E.Black()),Q=Object.freeze(new p(0,0,0,0)),g={key:0,repeatCount:0,loopMode:2};class a{static _PrepareAnimation(n,e,s,o,t,i,r,c){let l;if(!isNaN(parseFloat(t))&&isFinite(t)?l=a.ANIMATIONTYPE_FLOAT:t instanceof h?l=a.ANIMATIONTYPE_QUATERNION:t instanceof M?l=a.ANIMATIONTYPE_VECTOR3:t instanceof v?l=a.ANIMATIONTYPE_VECTOR2:t instanceof E?l=a.ANIMATIONTYPE_COLOR3:t instanceof p?l=a.ANIMATIONTYPE_COLOR4:t instanceof k&&(l=a.ANIMATIONTYPE_SIZE),l==null)return null;const T=new a(n,e,s,l,r),u=[{frame:0,value:t},{frame:o,value:i}];return T.setKeys(u),c!==void 0&&T.setEasingFunction(c),T}static CreateAnimation(n,e,s,o){const t=new a(n+"Animation",n,s,e,a.ANIMATIONLOOPMODE_CONSTANT);return t.setEasingFunction(o),t}static CreateAndStartAnimation(n,e,s,o,t,i,r,c,l,T,u){const O=a._PrepareAnimation(n,s,o,t,i,r,c,l);return!O||(e.getScene&&(u=e.getScene()),!u)?null:u.beginDirectAnimation(e,[O],0,t,O.loopMode!==a.ANIMATIONLOOPMODE_CONSTANT,1,T)}static CreateAndStartHierarchyAnimation(n,e,s,o,t,i,r,c,l,T,u){const O=a._PrepareAnimation(n,o,t,i,r,c,l,T);return O?e.getScene().beginDirectHierarchyAnimation(e,s,[O],0,i,O.loopMode===1,1,u):null}static CreateMergeAndStartAnimation(n,e,s,o,t,i,r,c,l,T){const u=a._PrepareAnimation(n,s,o,t,i,r,c,l);return u?(e.animations.push(u),e.getScene().beginAnimation(e,0,t,u.loopMode===1,1,T)):null}static MakeAnimationAdditive(n,e,s,o=!1,t){let i;typeof e=="object"?i=e:i={referenceFrame:e??0,range:s,cloneOriginalAnimation:o,clonedAnimationName:t};let r=n;if(i.cloneOriginalAnimation&&(r=n.clone(),r.name=i.clonedAnimationName||r.name),!r._keys.length)return r;const c=i.referenceFrame&&i.referenceFrame>=0?i.referenceFrame:0;let l=0;const T=r._keys[0];let u=r._keys.length-1;const O=r._keys[u],f={referenceValue:T.value,referencePosition:d.Vector3[0],referenceQuaternion:d.Quaternion[0],referenceScaling:d.Vector3[1],keyPosition:d.Vector3[2],keyQuaternion:d.Quaternion[1],keyScaling:d.Vector3[3]};let I=T.frame,P=O.frame;if(i.range){const N=r.getRange(i.range);N&&(I=N.from,P=N.to)}else I=i.fromFrame??I,P=i.toFrame??P;if(I!==T.frame&&(l=r.createKeyForFrame(I)),P!==O.frame&&(u=r.createKeyForFrame(P)),r._keys.length===1){const N=r._getKeyValue(r._keys[0]);f.referenceValue=N.clone?N.clone():N}else if(c<=T.frame){const N=r._getKeyValue(T.value);f.referenceValue=N.clone?N.clone():N}else if(c>=O.frame){const N=r._getKeyValue(O.value);f.referenceValue=N.clone?N.clone():N}else{g.key=0;const N=r._interpolate(c,g);f.referenceValue=N.clone?N.clone():N}r.dataType===a.ANIMATIONTYPE_QUATERNION?f.referenceValue.normalize().conjugateInPlace():r.dataType===a.ANIMATIONTYPE_MATRIX&&(f.referenceValue.decompose(f.referenceScaling,f.referenceQuaternion,f.referencePosition),f.referenceQuaternion.normalize().conjugateInPlace());let R=Number.MAX_VALUE;const L=i.clipKeys?[]:null;for(let N=l;N<=u;N++){let A=r._keys[N];if((L||i.cloneOriginalAnimation)&&(A={frame:A.frame,value:A.value.clone?A.value.clone():A.value,inTangent:A.inTangent,outTangent:A.outTangent,interpolation:A.interpolation,lockedTangent:A.lockedTangent,easingFunction:A.easingFunction},L&&(R===Number.MAX_VALUE&&(R=A.frame),A.frame-=R,L.push(A))),!(N&&r.dataType!==a.ANIMATIONTYPE_FLOAT&&A.value===T.value))switch(r.dataType){case a.ANIMATIONTYPE_MATRIX:A.value.decompose(f.keyScaling,f.keyQuaternion,f.keyPosition),f.keyPosition.subtractInPlace(f.referencePosition),f.keyScaling.divideInPlace(f.referenceScaling),f.referenceQuaternion.multiplyToRef(f.keyQuaternion,f.keyQuaternion),y.ComposeToRef(f.keyScaling,f.keyQuaternion,f.keyPosition,A.value);break;case a.ANIMATIONTYPE_QUATERNION:f.referenceValue.multiplyToRef(A.value,A.value);break;case a.ANIMATIONTYPE_VECTOR2:case a.ANIMATIONTYPE_VECTOR3:case a.ANIMATIONTYPE_COLOR3:case a.ANIMATIONTYPE_COLOR4:A.value.subtractToRef(f.referenceValue,A.value);break;case a.ANIMATIONTYPE_SIZE:A.value.width-=f.referenceValue.width,A.value.height-=f.referenceValue.height;break;default:A.value-=f.referenceValue}}return L&&r.setKeys(L,!0),r}static TransitionTo(n,e,s,o,t,i,r,c=null,l=!0,T){if(r<=0)return s[n]=e,c&&c(),null;const u=t*(r/1e3);return i.setKeys(T??[{frame:0,value:s[n].clone?s[n].clone():s[n]},{frame:u,value:e}]),s.animations||(s.animations=[]),s.animations.push(i),o.beginAnimation(s,0,u,!1,1,c??void 0,void 0,l)}get runtimeAnimations(){return this._runtimeAnimations}get hasRunningRuntimeAnimations(){for(const n of this._runtimeAnimations)if(!n.isStopped())return!0;return!1}constructor(n,e,s,o,t,i){this.name=n,this.targetProperty=e,this.framePerSecond=s,this.dataType=o,this.loopMode=t,this.enableBlending=i,this._easingFunction=null,this._runtimeAnimations=new Array,this._events=new Array,this.blendingSpeed=.01,this._ranges={},this._coreAnimation=null,this.targetPropertyPath=e.split("."),this.dataType=o,this.loopMode=t===void 0?a.ANIMATIONLOOPMODE_CYCLE:t,this.uniqueId=a._UniqueIdGenerator++}toString(n){let e="Name: "+this.name+", property: "+this.targetProperty;if(e+=", datatype: "+["Float","Vector3","Quaternion","Matrix","Color3","Vector2"][this.dataType],e+=", nKeys: "+(this._keys?this._keys.length:"none"),e+=", nRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),n){e+=", Ranges: {";let s=!0;for(const o in this._ranges)s&&(e+=", ",s=!1),e+=o;e+="}"}return e}addEvent(n){this._events.push(n),this._events.sort((e,s)=>e.frame-s.frame)}removeEvents(n){for(let e=0;e<this._events.length;e++)this._events[e].frame===n&&(this._events.splice(e,1),e--)}getEvents(){return this._events}createRange(n,e,s){this._ranges[n]||(this._ranges[n]=new _(n,e,s))}deleteRange(n,e=!0){const s=this._ranges[n];if(s){if(e){const o=s.from,t=s.to;for(let i=this._keys.length-1;i>=0;i--)this._keys[i].frame>=o&&this._keys[i].frame<=t&&this._keys.splice(i,1)}this._ranges[n]=null}}getRange(n){return this._ranges[n]}getKeys(){return this._keys}getHighestFrame(){let n=0;for(let e=0,s=this._keys.length;e<s;e++)n<this._keys[e].frame&&(n=this._keys[e].frame);return n}getEasingFunction(){return this._easingFunction}setEasingFunction(n){this._easingFunction=n}floatInterpolateFunction(n,e,s){return V(n,e,s)}floatInterpolateFunctionWithTangents(n,e,s,o,t){return S(n,e,s,o,t)}quaternionInterpolateFunction(n,e,s){return h.Slerp(n,e,s)}quaternionInterpolateFunctionWithTangents(n,e,s,o,t){return h.Hermite(n,e,s,o,t).normalize()}vector3InterpolateFunction(n,e,s){return M.Lerp(n,e,s)}vector3InterpolateFunctionWithTangents(n,e,s,o,t){return M.Hermite(n,e,s,o,t)}vector2InterpolateFunction(n,e,s){return v.Lerp(n,e,s)}vector2InterpolateFunctionWithTangents(n,e,s,o,t){return v.Hermite(n,e,s,o,t)}sizeInterpolateFunction(n,e,s){return k.Lerp(n,e,s)}color3InterpolateFunction(n,e,s){return E.Lerp(n,e,s)}color3InterpolateFunctionWithTangents(n,e,s,o,t){return E.Hermite(n,e,s,o,t)}color4InterpolateFunction(n,e,s){return p.Lerp(n,e,s)}color4InterpolateFunctionWithTangents(n,e,s,o,t){return p.Hermite(n,e,s,o,t)}_getKeyValue(n){return typeof n=="function"?n():n}evaluate(n){return g.key=0,this._interpolate(n,g)}_interpolate(n,e,s=!1){if(e.loopMode===a.ANIMATIONLOOPMODE_CONSTANT&&e.repeatCount>0)return e.highLimitValue.clone?e.highLimitValue.clone():e.highLimitValue;const o=this._keys;let t;if(this._coreAnimation)t=this._coreAnimation._key;else{const I=o.length;for(t=e.key;t>=0&&n<o[t].frame;)--t;for(;t+1<=I-1&&n>=o[t+1].frame;)++t;if(e.key=t,t<0)return s?void 0:this._getKeyValue(o[0].value);if(t+1>I-1)return s?void 0:this._getKeyValue(o[I-1].value);this._key=t}const i=o[t],r=o[t+1];if(s&&(n===i.frame||n===r.frame))return;const c=this._getKeyValue(i.value),l=this._getKeyValue(r.value);if(i.interpolation===1)return r.frame>n?c:l;const T=i.outTangent!==void 0&&r.inTangent!==void 0,u=r.frame-i.frame;let O=(n-i.frame)/u;const f=i.easingFunction||this.getEasingFunction();switch(f&&(O=f.ease(O)),this.dataType){case a.ANIMATIONTYPE_FLOAT:{const I=T?this.floatInterpolateFunctionWithTangents(c,i.outTangent*u,l,r.inTangent*u,O):this.floatInterpolateFunction(c,l,O);switch(e.loopMode){case a.ANIMATIONLOOPMODE_CYCLE:case a.ANIMATIONLOOPMODE_CONSTANT:case a.ANIMATIONLOOPMODE_YOYO:return I;case a.ANIMATIONLOOPMODE_RELATIVE:case a.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return(e.offsetValue??0)*e.repeatCount+I}break}case a.ANIMATIONTYPE_QUATERNION:{const I=T?this.quaternionInterpolateFunctionWithTangents(c,i.outTangent.scale(u),l,r.inTangent.scale(u),O):this.quaternionInterpolateFunction(c,l,O);switch(e.loopMode){case a.ANIMATIONLOOPMODE_CYCLE:case a.ANIMATIONLOOPMODE_CONSTANT:case a.ANIMATIONLOOPMODE_YOYO:return I;case a.ANIMATIONLOOPMODE_RELATIVE:case a.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return I.addInPlace((e.offsetValue||D).scale(e.repeatCount))}return I}case a.ANIMATIONTYPE_VECTOR3:{const I=T?this.vector3InterpolateFunctionWithTangents(c,i.outTangent.scale(u),l,r.inTangent.scale(u),O):this.vector3InterpolateFunction(c,l,O);switch(e.loopMode){case a.ANIMATIONLOOPMODE_CYCLE:case a.ANIMATIONLOOPMODE_CONSTANT:case a.ANIMATIONLOOPMODE_YOYO:return I;case a.ANIMATIONLOOPMODE_RELATIVE:case a.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return I.add((e.offsetValue||w).scale(e.repeatCount))}break}case a.ANIMATIONTYPE_VECTOR2:{const I=T?this.vector2InterpolateFunctionWithTangents(c,i.outTangent.scale(u),l,r.inTangent.scale(u),O):this.vector2InterpolateFunction(c,l,O);switch(e.loopMode){case a.ANIMATIONLOOPMODE_CYCLE:case a.ANIMATIONLOOPMODE_CONSTANT:case a.ANIMATIONLOOPMODE_YOYO:return I;case a.ANIMATIONLOOPMODE_RELATIVE:case a.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return I.add((e.offsetValue||K).scale(e.repeatCount))}break}case a.ANIMATIONTYPE_SIZE:{switch(e.loopMode){case a.ANIMATIONLOOPMODE_CYCLE:case a.ANIMATIONLOOPMODE_CONSTANT:case a.ANIMATIONLOOPMODE_YOYO:return this.sizeInterpolateFunction(c,l,O);case a.ANIMATIONLOOPMODE_RELATIVE:case a.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return this.sizeInterpolateFunction(c,l,O).add((e.offsetValue||U).scale(e.repeatCount))}break}case a.ANIMATIONTYPE_COLOR3:{const I=T?this.color3InterpolateFunctionWithTangents(c,i.outTangent.scale(u),l,r.inTangent.scale(u),O):this.color3InterpolateFunction(c,l,O);switch(e.loopMode){case a.ANIMATIONLOOPMODE_CYCLE:case a.ANIMATIONLOOPMODE_CONSTANT:case a.ANIMATIONLOOPMODE_YOYO:return I;case a.ANIMATIONLOOPMODE_RELATIVE:case a.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return I.add((e.offsetValue||z).scale(e.repeatCount))}break}case a.ANIMATIONTYPE_COLOR4:{const I=T?this.color4InterpolateFunctionWithTangents(c,i.outTangent.scale(u),l,r.inTangent.scale(u),O):this.color4InterpolateFunction(c,l,O);switch(e.loopMode){case a.ANIMATIONLOOPMODE_CYCLE:case a.ANIMATIONLOOPMODE_CONSTANT:case a.ANIMATIONLOOPMODE_YOYO:return I;case a.ANIMATIONLOOPMODE_RELATIVE:case a.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return I.add((e.offsetValue||Q).scale(e.repeatCount))}break}case a.ANIMATIONTYPE_MATRIX:{switch(e.loopMode){case a.ANIMATIONLOOPMODE_CYCLE:case a.ANIMATIONLOOPMODE_CONSTANT:case a.ANIMATIONLOOPMODE_YOYO:return a.AllowMatricesInterpolation?this.matrixInterpolateFunction(c,l,O,e.workValue):c;case a.ANIMATIONLOOPMODE_RELATIVE:case a.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return c}break}}return 0}matrixInterpolateFunction(n,e,s,o){return a.AllowMatrixDecomposeForInterpolation?o?(y.DecomposeLerpToRef(n,e,s,o),o):y.DecomposeLerp(n,e,s):o?(y.LerpToRef(n,e,s,o),o):y.Lerp(n,e,s)}clone(n=!1){const e=new a(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed,this._keys&&e.setKeys(this._keys,!1,n),this._ranges){e._ranges={};for(const s in this._ranges){const o=this._ranges[s];o&&(e._ranges[s]=o.clone())}}return e}setKeys(n,e=!1,s=!1){if(e)this._keys=n;else if(this._keys=n.slice(0),s)for(let o=0;o<this._keys.length;o++){const t=this._keys[o];this._keys[o]={frame:t.frame,value:t.value.clone?t.value.clone():t.value,inTangent:t.inTangent&&t.inTangent.clone?t.inTangent.clone():t.inTangent,outTangent:t.outTangent&&t.outTangent.clone?t.outTangent.clone():t.outTangent,interpolation:t.interpolation,lockedTangent:t.lockedTangent,easingFunction:t.easingFunction}}}createKeyForFrame(n){g.key=0;const e=this._interpolate(n,g,!0);if(!e)return this._keys[g.key].frame===n?g.key:g.key+1;const s={frame:n,value:e.clone?e.clone():e};return this._keys.splice(g.key+1,0,s),g.key+1}serialize(){const n={};n.name=this.name,n.property=this.targetProperty,n.framePerSecond=this.framePerSecond,n.dataType=this.dataType,n.loopBehavior=this.loopMode,n.enableBlending=this.enableBlending,n.blendingSpeed=this.blendingSpeed;const e=this.dataType;n.keys=[];const s=this.getKeys();for(let o=0;o<s.length;o++){const t=s[o],i={};switch(i.frame=t.frame,e){case a.ANIMATIONTYPE_FLOAT:i.values=[t.value],t.inTangent!==void 0&&i.values.push(t.inTangent),t.outTangent!==void 0&&(t.inTangent===void 0&&i.values.push(void 0),i.values.push(t.outTangent)),t.interpolation!==void 0&&(t.inTangent===void 0&&i.values.push(void 0),t.outTangent===void 0&&i.values.push(void 0),i.values.push(t.interpolation));break;case a.ANIMATIONTYPE_QUATERNION:case a.ANIMATIONTYPE_MATRIX:case a.ANIMATIONTYPE_VECTOR3:case a.ANIMATIONTYPE_COLOR3:case a.ANIMATIONTYPE_COLOR4:i.values=t.value.asArray(),t.inTangent!=null&&i.values.push(t.inTangent.asArray()),t.outTangent!=null&&(t.inTangent===void 0&&i.values.push(void 0),i.values.push(t.outTangent.asArray())),t.interpolation!==void 0&&(t.inTangent===void 0&&i.values.push(void 0),t.outTangent===void 0&&i.values.push(void 0),i.values.push(t.interpolation));break}n.keys.push(i)}n.ranges=[];for(const o in this._ranges){const t=this._ranges[o];if(!t)continue;const i={};i.name=o,i.from=t.from,i.to=t.to,n.ranges.push(i)}return n}static _UniversalLerp(n,e,s){const o=n.constructor;return o.Lerp?o.Lerp(n,e,s):o.Slerp?o.Slerp(n,e,s):n.toFixed?n*(1-s)+s*e:e}static Parse(n){const e=new a(n.name,n.property,n.framePerSecond,n.dataType,n.loopBehavior),s=n.dataType,o=[];let t,i;for(n.enableBlending&&(e.enableBlending=n.enableBlending),n.blendingSpeed&&(e.blendingSpeed=n.blendingSpeed),i=0;i<n.keys.length;i++){const r=n.keys[i];let c,l,T;switch(s){case a.ANIMATIONTYPE_FLOAT:t=r.values[0],r.values.length>=2&&(c=r.values[1]),r.values.length>=3&&(l=r.values[2]),r.values.length>=4&&(T=r.values[3]);break;case a.ANIMATIONTYPE_QUATERNION:if(t=h.FromArray(r.values),r.values.length>=8){const O=h.FromArray(r.values.slice(4,8));O.equals(h.Zero())||(c=O)}if(r.values.length>=12){const O=h.FromArray(r.values.slice(8,12));O.equals(h.Zero())||(l=O)}r.values.length>=13&&(T=r.values[12]);break;case a.ANIMATIONTYPE_MATRIX:t=y.FromArray(r.values),r.values.length>=17&&(T=r.values[16]);break;case a.ANIMATIONTYPE_COLOR3:t=E.FromArray(r.values),r.values[3]&&(c=E.FromArray(r.values[3])),r.values[4]&&(l=E.FromArray(r.values[4])),r.values[5]&&(T=r.values[5]);break;case a.ANIMATIONTYPE_COLOR4:t=p.FromArray(r.values),r.values[4]&&(c=p.FromArray(r.values[4])),r.values[5]&&(l=p.FromArray(r.values[5])),r.values[6]&&(T=p.FromArray(r.values[6]));break;case a.ANIMATIONTYPE_VECTOR3:default:t=M.FromArray(r.values),r.values[3]&&(c=M.FromArray(r.values[3])),r.values[4]&&(l=M.FromArray(r.values[4])),r.values[5]&&(T=r.values[5]);break}const u={};u.frame=r.frame,u.value=t,c!=null&&(u.inTangent=c),l!=null&&(u.outTangent=l),T!=null&&(u.interpolation=T),o.push(u)}if(e.setKeys(o),n.ranges)for(i=0;i<n.ranges.length;i++)t=n.ranges[i],e.createRange(t.name,t.from,t.to);return e}static AppendSerializedAnimations(n,e){b.AppendSerializedAnimations(n,e)}static async ParseFromFileAsync(n,e){return await new Promise((s,o)=>{const t=new F;t.addEventListener("readystatechange",()=>{if(t.readyState==4)if(t.status==200){let i=JSON.parse(t.responseText);if(i.animations&&(i=i.animations),i.length){const r=[];for(const c of i)r.push(this.Parse(c));s(r)}else{const r=this.Parse(i);n&&(r.name=n),s(r)}}else o("Unable to load the animation")}),t.open("GET",e),t.send()})}static async ParseFromSnippetAsync(n){return await new Promise((e,s)=>{const o=new F;o.addEventListener("readystatechange",()=>{if(o.readyState==4)if(o.status==200){const t=JSON.parse(JSON.parse(o.responseText).jsonPayload);if(t.animations){const i=JSON.parse(t.animations),r=[];for(const c of i.animations){const l=this.Parse(c);l.snippetId=n,r.push(l)}e(r)}else{const i=JSON.parse(t.animation),r=this.Parse(i);r.snippetId=n,e(r)}}else s("Unable to load the snippet "+n)}),o.open("GET",this.SnippetUrl+"/"+n.replace(/#/g,"/")),o.send()})}}a._UniqueIdGenerator=0;a.AllowMatricesInterpolation=!1;a.AllowMatrixDecomposeForInterpolation=!0;a.SnippetUrl="https://snippet.babylonjs.com";a.ANIMATIONTYPE_FLOAT=0;a.ANIMATIONTYPE_VECTOR3=1;a.ANIMATIONTYPE_QUATERNION=2;a.ANIMATIONTYPE_MATRIX=3;a.ANIMATIONTYPE_COLOR3=4;a.ANIMATIONTYPE_COLOR4=7;a.ANIMATIONTYPE_VECTOR2=5;a.ANIMATIONTYPE_SIZE=6;a.ANIMATIONLOOPMODE_RELATIVE=0;a.ANIMATIONLOOPMODE_CYCLE=1;a.ANIMATIONLOOPMODE_CONSTANT=2;a.ANIMATIONLOOPMODE_YOYO=4;a.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT=5;a.CreateFromSnippetAsync=a.ParseFromSnippetAsync;Y("BABYLON.Animation",a);m._AnimationRangeFactory=(C,n,e)=>new _(C,n,e);export{a as A,Q as _,_ as a,z as b,U as c,K as d,w as e,D as f};
|
assets/animationGroup-BP7VB8mY.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{A,_ as x,b as E,c as R,d as M,e as N,f as B}from"./animation-IftAdLIx.js";import{M as F,Q as S,O as P,T,V as C,E as k}from"./math.vector-C1xyPDEl.js";import{P as D,T as w}from"./decorators.serialization-C7d7ykGG.js";import{B as W}from"./bone-B35odufe.js";import{S as K,U}from"./scene-gn_hoGMy.js";import"./math.color-CzLaKyb6.js";import"./math.scalar.functions-DkeaWAWz.js";import"./node-C-Iu0ALa.js";import"./bufferUtils-DTRdUD8L.js";import"./baseTexture-CgAggsey.js";import"./tools-D01N7ptR.js";import"./smartArray-CO6iJ0u5.js";import"./lightConstants-B1TSTh-k.js";import"./sceneComponent-Dflhczui.js";import"./math.plane-Ce_75-g5.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./renderingManager-CiY2OUrf.js";import"./deviceInputEvents-BTza-zoR.js";import"./perfCounter-DusmGz8t.js";class Y{get currentFrame(){return this._currentFrame}get weight(){return this._weight}get currentValue(){return this._currentValue}get targetPath(){return this._targetPath}get target(){return this._currentActiveTarget}get isAdditive(){return this._host&&this._host.isAdditive}constructor(t,e,i,n){if(this._events=new Array,this._currentFrame=0,this._originalValue=new Array,this._originalBlendValue=null,this._offsetsCache={},this._highLimitsCache={},this._stopped=!1,this._blendingFactor=0,this._currentValue=null,this._currentActiveTarget=null,this._directTarget=null,this._targetPath="",this._weight=1,this._absoluteFrameOffset=0,this._previousElapsedTime=0,this._yoyoDirection=1,this._previousAbsoluteFrame=0,this._targetIsArray=!1,this._coreRuntimeAnimation=null,this._animation=e,this._target=t,this._scene=i,this._host=n,this._activeTargets=[],e._runtimeAnimations.push(this),this._animationState={key:0,repeatCount:0,loopMode:this._getCorrectLoopMode()},this._animation.dataType===A.ANIMATIONTYPE_MATRIX&&(this._animationState.workValue=F.Zero()),this._keys=this._animation.getKeys(),this._minFrame=this._keys[0].frame,this._maxFrame=this._keys[this._keys.length-1].frame,this._minFrame!==0){const a={frame:0,value:this._keys[0].value};this._keys.splice(0,0,a)}if(this._target instanceof Array){let a=0;for(const o of this._target)this._preparePath(o,a),this._getOriginalValues(a),a++;this._targetIsArray=!0}else this._preparePath(this._target),this._getOriginalValues(),this._targetIsArray=!1,this._directTarget=this._activeTargets[0];const s=e.getEvents();if(s&&s.length>0)for(const a of s)this._events.push(a._clone());this._enableBlending=t&&t.animationPropertiesOverride?t.animationPropertiesOverride.enableBlending:this._animation.enableBlending}_preparePath(t,e=0){const i=this._animation.targetPropertyPath;if(i.length>1){let n=t;for(let s=0;s<i.length-1;s++){const a=i[s];if(n=n[a],n===void 0)throw new Error(`Invalid property (${a}) in property path (${i.join(".")})`)}this._targetPath=i[i.length-1],this._activeTargets[e]=n}else this._targetPath=i[0],this._activeTargets[e]=t;if(this._activeTargets[e][this._targetPath]===void 0)throw new Error(`Invalid property (${this._targetPath}) in property path (${i.join(".")})`)}get animation(){return this._animation}reset(t=!1){if(t)if(this._target instanceof Array){let e=0;for(const i of this._target)this._originalValue[e]!==void 0&&this._setValue(i,this._activeTargets[e],this._originalValue[e],-1,e),e++}else this._originalValue[0]!==void 0&&this._setValue(this._target,this._directTarget,this._originalValue[0],-1,0);this._offsetsCache={},this._highLimitsCache={},this._currentFrame=0,this._blendingFactor=0;for(let e=0;e<this._events.length;e++)this._events[e].isDone=!1}isStopped(){return this._stopped}dispose(){const t=this._animation.runtimeAnimations.indexOf(this);t>-1&&this._animation.runtimeAnimations.splice(t,1)}setValue(t,e){if(this._targetIsArray){for(let i=0;i<this._target.length;i++){const n=this._target[i];this._setValue(n,this._activeTargets[i],t,e,i)}return}this._setValue(this._target,this._directTarget,t,e,0)}_getOriginalValues(t=0){let e;const i=this._activeTargets[t];i.getLocalMatrix&&this._targetPath==="_matrix"?e=i.getLocalMatrix():e=i[this._targetPath],e&&e.clone?this._originalValue[t]=e.clone():this._originalValue[t]=e}_registerTargetForLateAnimationBinding(t,e){const i=t.target;this._scene._registeredForLateAnimationBindings.pushNoDuplicate(i),i._lateAnimationHolders||(i._lateAnimationHolders={}),i._lateAnimationHolders[t.targetPath]||(i._lateAnimationHolders[t.targetPath]={totalWeight:0,totalAdditiveWeight:0,animations:[],additiveAnimations:[],originalValue:e}),t.isAdditive?(i._lateAnimationHolders[t.targetPath].additiveAnimations.push(t),i._lateAnimationHolders[t.targetPath].totalAdditiveWeight+=t.weight):(i._lateAnimationHolders[t.targetPath].animations.push(t),i._lateAnimationHolders[t.targetPath].totalWeight+=t.weight)}_setValue(t,e,i,n,s){if(this._currentActiveTarget=e,this._weight=n,this._enableBlending&&this._blendingFactor<=1){if(!this._originalBlendValue){const o=e[this._targetPath];o.clone?this._originalBlendValue=o.clone():this._originalBlendValue=o}this._originalBlendValue.m?A.AllowMatrixDecomposeForInterpolation?this._currentValue?F.DecomposeLerpToRef(this._originalBlendValue,i,this._blendingFactor,this._currentValue):this._currentValue=F.DecomposeLerp(this._originalBlendValue,i,this._blendingFactor):this._currentValue?F.LerpToRef(this._originalBlendValue,i,this._blendingFactor,this._currentValue):this._currentValue=F.Lerp(this._originalBlendValue,i,this._blendingFactor):this._currentValue=A._UniversalLerp(this._originalBlendValue,i,this._blendingFactor);const a=t&&t.animationPropertiesOverride?t.animationPropertiesOverride.blendingSpeed:this._animation.blendingSpeed;this._blendingFactor+=a}else this._currentValue?this._currentValue.copyFrom?this._currentValue.copyFrom(i):this._currentValue=i:i!=null&&i.clone?this._currentValue=i.clone():this._currentValue=i;n!==-1?this._registerTargetForLateAnimationBinding(this,this._originalValue[s]):this._animationState.loopMode===A.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT?this._currentValue.addToRef?this._currentValue.addToRef(this._originalValue[s],e[this._targetPath]):e[this._targetPath]=this._originalValue[s]+this._currentValue:e[this._targetPath]=this._currentValue,t.markAsDirty&&t.markAsDirty(this._animation.targetProperty)}_getCorrectLoopMode(){return this._target&&this._target.animationPropertiesOverride?this._target.animationPropertiesOverride.loopMode:this._animation.loopMode}goToFrame(t,e=-1){const i=this._animation.getKeys();t<i[0].frame?t=i[0].frame:t>i[i.length-1].frame&&(t=i[i.length-1].frame);const n=this._events;if(n.length)for(let a=0;a<n.length;a++)n[a].onlyOnce||(n[a].isDone=n[a].frame<t);this._currentFrame=t;const s=this._animation._interpolate(t,this._animationState);this.setValue(s,e)}_prepareForSpeedRatioChange(t){const e=this._previousElapsedTime*(this._animation.framePerSecond*t)/1e3;this._absoluteFrameOffset=this._previousAbsoluteFrame-e}animate(t,e,i,n,s,a=-1){const o=this._animation,r=o.targetPropertyPath;if(!r||r.length<1)return this._stopped=!0,!1;let l=!0,u;const c=this._events;let g;if(this._coreRuntimeAnimation)g=i-e,u=this._coreRuntimeAnimation.currentFrame,this._currentFrame=u,this._animationState.repeatCount=this._coreRuntimeAnimation._animationState.repeatCount,this._animationState.highLimitValue=this._coreRuntimeAnimation._animationState.highLimitValue,this._animationState.offsetValue=this._coreRuntimeAnimation._animationState.offsetValue;else{(e<this._minFrame||e>this._maxFrame)&&(e=this._minFrame),(i<this._minFrame||i>this._maxFrame)&&(i=this._maxFrame),g=i-e;let _,m=t*(o.framePerSecond*s)/1e3+this._absoluteFrameOffset,b=0,O=!1;const v=n&&this._animationState.loopMode===A.ANIMATIONLOOPMODE_YOYO;if(v){const f=(m-e)/g,p=Math.sin(f*Math.PI);m=Math.abs(p)*g+e;const L=p>=0?1:-1;this._yoyoDirection!==L&&(O=!0),this._yoyoDirection=L}if(this._previousElapsedTime=t,this._previousAbsoluteFrame=m,!n&&i>=e&&(m>=g&&s>0||m<=0&&s<0))l=!1,b=o.evaluate(i);else if(!n&&e>=i&&(m<=g&&s<0||m>=0&&s>0))l=!1,b=o.evaluate(e);else if(this._animationState.loopMode!==A.ANIMATIONLOOPMODE_CYCLE){const f=i.toString()+e.toString();if(!this._offsetsCache[f]){this._animationState.repeatCount=0,this._animationState.loopMode=A.ANIMATIONLOOPMODE_CYCLE;const p=o._interpolate(e,this._animationState),y=o._interpolate(i,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),o.dataType){case A.ANIMATIONTYPE_FLOAT:this._offsetsCache[f]=y-p;break;case A.ANIMATIONTYPE_QUATERNION:this._offsetsCache[f]=y.subtract(p);break;case A.ANIMATIONTYPE_VECTOR3:this._offsetsCache[f]=y.subtract(p);break;case A.ANIMATIONTYPE_VECTOR2:this._offsetsCache[f]=y.subtract(p);break;case A.ANIMATIONTYPE_SIZE:this._offsetsCache[f]=y.subtract(p);break;case A.ANIMATIONTYPE_COLOR3:this._offsetsCache[f]=y.subtract(p);break}this._highLimitsCache[f]=y}b=this._highLimitsCache[f],_=this._offsetsCache[f]}if(_===void 0)switch(o.dataType){case A.ANIMATIONTYPE_FLOAT:_=0;break;case A.ANIMATIONTYPE_QUATERNION:_=B;break;case A.ANIMATIONTYPE_VECTOR3:_=N;break;case A.ANIMATIONTYPE_VECTOR2:_=M;break;case A.ANIMATIONTYPE_SIZE:_=R;break;case A.ANIMATIONTYPE_COLOR3:_=E;break;case A.ANIMATIONTYPE_COLOR4:_=x;break}if(this._host&&this._host.syncRoot){const f=this._host.syncRoot,p=(f.masterFrame-f.fromFrame)/(f.toFrame-f.fromFrame);u=e+g*p}else m>0&&e>i||m<0&&e<i?u=l&&g!==0?i+m%g:e:u=l&&g!==0?e+m%g:i;if(!v&&(s>0&&this.currentFrame>u||s<0&&this.currentFrame<u)||v&&O){this._onLoop();for(let f=0;f<c.length;f++)c[f].onlyOnce||(c[f].isDone=!1);this._animationState.key=s>0?0:o.getKeys().length-1}this._currentFrame=u,this._animationState.repeatCount=g===0?0:m/g>>0,this._animationState.highLimitValue=b,this._animationState.offsetValue=_}const d=o._interpolate(u,this._animationState);if(this.setValue(d,a),c.length){for(let _=0;_<c.length;_++)if(g>=0&&u>=c[_].frame&&c[_].frame>=e||g<0&&u<=c[_].frame&&c[_].frame<=e){const m=c[_];m.isDone||(m.onlyOnce&&(c.splice(_,1),_--),m.isDone=!0,m.action(u))}}return l||(this._stopped=!0),l}}class I{get syncRoot(){return this._syncRoot}get masterFrame(){return this._runtimeAnimations.length===0?0:this._runtimeAnimations[0].currentFrame}get weight(){return this._weight}set weight(t){if(t===-1){this._weight=-1;return}this._weight=Math.min(Math.max(t,0),1)}get speedRatio(){return this._speedRatio}set speedRatio(t){for(let e=0;e<this._runtimeAnimations.length;e++)this._runtimeAnimations[e]._prepareForSpeedRatioChange(t);this._speedRatio=t,this._goToFrame!==null&&this.goToFrame(this._goToFrame)}get elapsedTime(){return this._localDelayOffset===null?0:this._scene._animationTime-this._localDelayOffset}constructor(t,e,i=0,n=100,s=!1,a=1,o,r,l,u=!1,c=0){this.target=e,this.fromFrame=i,this.toFrame=n,this.loopAnimation=s,this.onAnimationEnd=o,this.onAnimationLoop=l,this.isAdditive=u,this.playOrder=c,this._localDelayOffset=null,this._pausedDelay=null,this._manualJumpDelay=null,this._runtimeAnimations=new Array,this._paused=!1,this._speedRatio=1,this._weight=-1,this._previousWeight=-1,this._syncRoot=null,this._frameToSyncFromJump=null,this._goToFrame=null,this.disposeOnEnd=!0,this.animationStarted=!1,this.onAnimationEndObservable=new P,this.onAnimationLoopObservable=new P,this._scene=t,r&&this.appendAnimations(e,r),this._speedRatio=a,t._activeAnimatables.push(this)}syncWith(t){if(this._syncRoot=t,t){const e=this._scene._activeAnimatables.indexOf(this);e>-1&&(this._scene._activeAnimatables.splice(e,1),this._scene._activeAnimatables.push(this))}return this}getAnimations(){return this._runtimeAnimations}appendAnimations(t,e){for(let i=0;i<e.length;i++){const n=e[i],s=new Y(t,n,this._scene,this);s._onLoop=()=>{this.onAnimationLoopObservable.notifyObservers(this),this.onAnimationLoop&&this.onAnimationLoop()},this._runtimeAnimations.push(s)}}getAnimationByTargetProperty(t){const e=this._runtimeAnimations;for(let i=0;i<e.length;i++)if(e[i].animation.targetProperty===t)return e[i].animation;return null}getRuntimeAnimationByTargetProperty(t){const e=this._runtimeAnimations;for(let i=0;i<e.length;i++)if(e[i].animation.targetProperty===t)return e[i];return null}reset(){const t=this._runtimeAnimations;for(let e=0;e<t.length;e++)t[e].reset(!0);this._localDelayOffset=null,this._pausedDelay=null}enableBlending(t){const e=this._runtimeAnimations;for(let i=0;i<e.length;i++)e[i].animation.enableBlending=!0,e[i].animation.blendingSpeed=t}disableBlending(){const t=this._runtimeAnimations;for(let e=0;e<t.length;e++)t[e].animation.enableBlending=!1}goToFrame(t,e=!1){const i=this._runtimeAnimations;if(i[0]){const n=i[0].animation.framePerSecond;this._frameToSyncFromJump=this._frameToSyncFromJump??i[0].currentFrame;const s=this.speedRatio===0?0:(t-this._frameToSyncFromJump)/n*1e3/this.speedRatio;this._manualJumpDelay=-s}for(let n=0;n<i.length;n++)i[n].goToFrame(t,e?this._weight:-1);this._goToFrame=t}get paused(){return this._paused}pause(){this._paused||(this._paused=!0)}restart(){this._paused=!1}_raiseOnAnimationEnd(){this.onAnimationEnd&&this.onAnimationEnd(),this.onAnimationEndObservable.notifyObservers(this)}stop(t,e,i=!1,n=!1){if(t||e){const s=this._scene._activeAnimatables.indexOf(this);if(s>-1){const a=this._runtimeAnimations;for(let o=a.length-1;o>=0;o--){const r=a[o];t&&r.animation.name!=t||e&&!e(r.target)||(r.dispose(),a.splice(o,1))}a.length==0&&(i||this._scene._activeAnimatables.splice(s,1),n||this._raiseOnAnimationEnd())}}else{const s=this._scene._activeAnimatables.indexOf(this);if(s>-1){i||this._scene._activeAnimatables.splice(s,1);const a=this._runtimeAnimations;for(let o=0;o<a.length;o++)a[o].dispose();this._runtimeAnimations.length=0,n||this._raiseOnAnimationEnd()}}}async waitAsync(){return await new Promise(t=>{this.onAnimationEndObservable.add(()=>{t(this)},void 0,void 0,this,!0)})}_animate(t){if(this._paused)return this.animationStarted=!1,this._pausedDelay===null&&(this._pausedDelay=t),!0;if(this._localDelayOffset===null?(this._localDelayOffset=t,this._pausedDelay=null):this._pausedDelay!==null&&(this._localDelayOffset+=t-this._pausedDelay,this._pausedDelay=null),this._manualJumpDelay!==null&&(this._localDelayOffset+=this.speedRatio<0?-this._manualJumpDelay:this._manualJumpDelay,this._manualJumpDelay=null,this._frameToSyncFromJump=null),this._goToFrame=null,!I.ProcessPausedAnimatables&&this._weight===0&&this._previousWeight===0)return!0;this._previousWeight=this._weight;let e=!1;const i=this._runtimeAnimations;let n;for(n=0;n<i.length;n++){const a=i[n].animate(t-this._localDelayOffset,this.fromFrame,this.toFrame,this.loopAnimation,this._speedRatio,this._weight);e=e||a}if(this.animationStarted=e,!e){if(this.disposeOnEnd)for(n=this._scene._activeAnimatables.indexOf(this),this._scene._activeAnimatables.splice(n,1),n=0;n<i.length;n++)i[n].dispose();this._raiseOnAnimationEnd(),this.disposeOnEnd&&(this.onAnimationEnd=null,this.onAnimationLoop=null,this.onAnimationLoopObservable.clear(),this.onAnimationEndObservable.clear())}return e}}I.ProcessPausedAnimatables=!1;function z(h){if(h.totalWeight===0&&h.totalAdditiveWeight===0)return h.originalValue;let t=1;const e=T.Vector3[0],i=T.Vector3[1],n=T.Quaternion[0];let s=0;const a=h.animations[0],o=h.originalValue;let r,l=!1;if(h.totalWeight<1)r=1-h.totalWeight,o.decompose(i,n,e);else{if(s=1,t=h.totalWeight,r=a.weight/t,r==1)if(h.totalAdditiveWeight)l=!0;else return a.currentValue;a.currentValue.decompose(i,n,e)}if(!l){i.scaleInPlace(r),e.scaleInPlace(r),n.scaleInPlace(r);for(let c=s;c<h.animations.length;c++){const g=h.animations[c];if(g.weight===0)continue;r=g.weight/t;const d=T.Vector3[2],_=T.Vector3[3],m=T.Quaternion[1];g.currentValue.decompose(_,m,d),_.scaleAndAddToRef(r,i),m.scaleAndAddToRef(S.Dot(n,m)>0?r:-r,n),d.scaleAndAddToRef(r,e)}n.normalize()}for(let c=0;c<h.additiveAnimations.length;c++){const g=h.additiveAnimations[c];if(g.weight===0)continue;const d=T.Vector3[2],_=T.Vector3[3],m=T.Quaternion[1];g.currentValue.decompose(_,m,d),_.multiplyToRef(i,_),C.LerpToRef(i,_,g.weight,i),n.multiplyToRef(m,m),S.SlerpToRef(n,m,g.weight,n),d.scaleAndAddToRef(g.weight,e)}const u=a?a._animationState.workValue:T.Matrix[0].clone();return F.ComposeToRef(i,n,e,u),u}function H(h,t){if(h.totalWeight===0&&h.totalAdditiveWeight===0)return t;const e=h.animations[0],i=h.originalValue;let n=t;if(h.totalWeight===0&&h.totalAdditiveWeight>0)n.copyFrom(i);else if(h.animations.length===1){if(S.SlerpToRef(i,e.currentValue,Math.min(1,h.totalWeight),n),h.totalAdditiveWeight===0)return n}else if(h.animations.length>1){let s=1,a,o;if(h.totalWeight<1){const l=1-h.totalWeight;a=[],o=[],a.push(i),o.push(l)}else{if(h.animations.length===2&&(S.SlerpToRef(h.animations[0].currentValue,h.animations[1].currentValue,h.animations[1].weight/h.totalWeight,t),h.totalAdditiveWeight===0))return t;a=[],o=[],s=h.totalWeight}for(let l=0;l<h.animations.length;l++){const u=h.animations[l];a.push(u.currentValue),o.push(u.weight/s)}let r=0;for(let l=0;l<a.length;){if(!l){S.SlerpToRef(a[l],a[l+1],o[l+1]/(o[l]+o[l+1]),t),n=t,r=o[l]+o[l+1],l+=2;continue}r+=o[l],S.SlerpToRef(n,a[l],o[l]/r,n),l++}}for(let s=0;s<h.additiveAnimations.length;s++){const a=h.additiveAnimations[s];a.weight!==0&&(n.multiplyToRef(a.currentValue,T.Quaternion[0]),S.SlerpToRef(n,T.Quaternion[0],a.weight,n))}return n}function X(h){if(h._registeredForLateAnimationBindings.length){for(let t=0;t<h._registeredForLateAnimationBindings.length;t++){const e=h._registeredForLateAnimationBindings.data[t];for(const i in e._lateAnimationHolders){const n=e._lateAnimationHolders[i],s=n.animations[0],a=n.originalValue;if(a==null)continue;const o=A.AllowMatrixDecomposeForInterpolation&&a.m;let r=e[i];if(o)r=z(n);else if(a.w!==void 0)r=H(n,r||S.Identity());else{let u=0,c=1;const g=s&&s._animationState.loopMode===A.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT;if(n.totalWeight<1)g?r=a.clone?a.clone():a:s&&a.scale?r=a.scale(1-n.totalWeight):s?r=a*(1-n.totalWeight):a.clone?r=a.clone():r=a;else if(s){c=n.totalWeight;const d=s.weight/c;d!==1?s.currentValue.scale?r=s.currentValue.scale(d):r=s.currentValue*d:r=s.currentValue,g&&(r.addToRef?r.addToRef(a,r):r+=a),u=1}for(let d=u;d<n.animations.length;d++){const _=n.animations[d],m=_.weight/c;if(m)_.currentValue.scaleAndAddToRef?_.currentValue.scaleAndAddToRef(m,r):r+=_.currentValue*m;else continue}for(let d=0;d<n.additiveAnimations.length;d++){const _=n.additiveAnimations[d],m=_.weight;if(m)_.currentValue.scaleAndAddToRef?_.currentValue.scaleAndAddToRef(m,r):r+=_.currentValue*m;else continue}}e[i]=r}e._lateAnimationHolders={}}h._registeredForLateAnimationBindings.reset()}}function J(h,t){t&&(t.prototype.copyAnimationRange=function(e,i,n,s=!1,a=null){this.animations.length===0&&(this.animations.push(new A(this.name,"_matrix",e.animations[0].framePerSecond,A.ANIMATIONTYPE_MATRIX,0)),this.animations[0].setKeys([]));const o=e.animations[0].getRange(i);if(!o)return!1;const r=o.from,l=o.to,u=e.animations[0].getKeys(),c=e.length,g=e.getParent(),d=this.getParent(),_=s&&g&&c&&this.length&&c!==this.length,m=_&&d&&g?d.length/g.length:1,b=s&&!d&&a&&(a.x!==1||a.y!==1||a.z!==1),O=this.animations[0].getKeys();let v,f,p;for(let y=0,L=u.length;y<L;y++)v=u[y],v.frame>=r&&v.frame<=l&&(s?(p=v.value.clone(),_?(f=p.getTranslation(),p.setTranslation(f.scaleInPlace(m))):b&&a?(f=p.getTranslation(),p.setTranslation(f.multiplyInPlace(a))):p=v.value):p=v.value,O.push({frame:v.frame+n,value:p}));return this.animations[0].createRange(i,r+n,l+n),!0}),h&&(h.prototype._animate=function(e){if(!this.animationsEnabled)return;const i=D.Now;if(!this._animationTimeLast){if(this._pendingData.length>0)return;this._animationTimeLast=i}this.deltaTime=e!==void 0?e:this.useConstantAnimationDeltaTime?16:(i-this._animationTimeLast)*this.animationTimeScale,this._animationTimeLast=i;const n=this._activeAnimatables;if(n.length===0)return;this._animationTime+=this.deltaTime;const s=this._animationTime;for(let a=0;a<n.length;a++){const o=n[a];!o._animate(s)&&o.disposeOnEnd&&a--}X(this)},h.prototype.sortActiveAnimatables=function(){this._activeAnimatables.sort((e,i)=>e.playOrder-i.playOrder)},h.prototype.beginWeightedAnimation=function(e,i,n,s=1,a,o=1,r,l,u,c,g=!1){const d=this.beginAnimation(e,i,n,a,o,r,l,!1,u,c,g);return d.weight=s,d},h.prototype.beginAnimation=function(e,i,n,s,a=1,o,r,l=!0,u,c,g=!1){if(a<0){const _=i;i=n,n=_,a=-a}i>n&&(a=-a),l&&this.stopAnimation(e,void 0,u),r||(r=new I(this,e,i,n,s,a,o,void 0,c,g));const d=u?u(e):!0;if(e.animations&&d&&r.appendAnimations(e,e.animations),e.getAnimatables){const _=e.getAnimatables();for(let m=0;m<_.length;m++)this.beginAnimation(_[m],i,n,s,a,o,r,l,u,c)}return r.reset(),r},h.prototype.beginHierarchyAnimation=function(e,i,n,s,a,o=1,r,l,u=!0,c,g,d=!1){const _=e.getDescendants(i),m=[];m.push(this.beginAnimation(e,n,s,a,o,r,l,u,c,void 0,d));for(const b of _)m.push(this.beginAnimation(b,n,s,a,o,r,l,u,c,void 0,d));return m},h.prototype.beginDirectAnimation=function(e,i,n,s,a,o=1,r,l,u=!1){if(o<0){const g=n;n=s,s=g,o=-o}return n>s&&(o=-o),new I(this,e,n,s,a,o,r,i,l,u)},h.prototype.beginDirectHierarchyAnimation=function(e,i,n,s,a,o,r,l,u,c=!1){const g=e.getDescendants(i),d=[];d.push(this.beginDirectAnimation(e,n,s,a,o,r,l,u,c));for(const _ of g)d.push(this.beginDirectAnimation(_,n,s,a,o,r,l,u,c));return d},h.prototype.getAnimatableByTarget=function(e){for(let i=0;i<this._activeAnimatables.length;i++)if(this._activeAnimatables[i].target===e)return this._activeAnimatables[i];return null},h.prototype.getAllAnimatablesByTarget=function(e){const i=[];for(let n=0;n<this._activeAnimatables.length;n++)this._activeAnimatables[n].target===e&&i.push(this._activeAnimatables[n]);return i},h.prototype.stopAnimation=function(e,i,n){const s=this.getAllAnimatablesByTarget(e);for(const a of s)a.stop(i,n)},h.prototype.stopAllAnimations=function(){if(this._activeAnimatables){for(let e=0;e<this._activeAnimatables.length;e++)this._activeAnimatables[e].stop(void 0,void 0,!0);this._activeAnimatables.length=0}for(const e of this.animationGroups)e.stop()})}J(K,W);class q{getClassName(){return"TargetedAnimation"}constructor(t){this.parent=t,this.uniqueId=U.UniqueId}serialize(){const t={};return t.animation=this.animation.serialize(),t.targetId=this.target.id,t.targetUniqueId=this.target.uniqueId,t}}class V{get mask(){return this._mask}set mask(t){this._mask!==t&&(this._mask=t,this.syncWithMask(!0))}syncWithMask(t=!1){if(!this.mask&&!t){this._numActiveAnimatables=this._targetedAnimations.length;return}this._numActiveAnimatables=0;for(let e=0;e<this._animatables.length;++e){const i=this._animatables[e];!this.mask||this.mask.disabled||this.mask.retainsTarget(i.target.name)?(this._numActiveAnimatables++,i.paused&&i.restart()):i.paused||i.pause()}}removeUnmaskedAnimations(){if(!(!this.mask||this.mask.disabled)){for(let t=0;t<this._animatables.length;++t){const e=this._animatables[t];this.mask.retainsTarget(e.target.name)||(e.stop(),this._animatables.splice(t,1),--t)}for(let t=0;t<this._targetedAnimations.length;t++){const e=this._targetedAnimations[t];this.mask.retainsTarget(e.target.name)||(this._targetedAnimations.splice(t,1),--t)}}}get from(){return this._from}set from(t){if(this._from!==t){this._from=t;for(let e=0;e<this._animatables.length;e++){const i=this._animatables[e];i.fromFrame=this._from}}}get to(){return this._to}set to(t){if(this._to!==t){this._to=t;for(let e=0;e<this._animatables.length;e++){const i=this._animatables[e];i.toFrame=this._to}}}get isStarted(){return this._isStarted}get isPlaying(){return this._isStarted&&!this._isPaused}get speedRatio(){return this._speedRatio}set speedRatio(t){if(this._speedRatio!==t){this._speedRatio=t;for(let e=0;e<this._animatables.length;e++){const i=this._animatables[e];i.speedRatio=this._speedRatio}}}get loopAnimation(){return this._loopAnimation}set loopAnimation(t){if(this._loopAnimation!==t){this._loopAnimation=t;for(let e=0;e<this._animatables.length;e++){const i=this._animatables[e];i.loopAnimation=this._loopAnimation}}}get isAdditive(){return this._isAdditive}set isAdditive(t){if(this._isAdditive!==t){this._isAdditive=t;for(let e=0;e<this._animatables.length;e++){const i=this._animatables[e];i.isAdditive=this._isAdditive}}}get weight(){return this._weight}set weight(t){this._weight!==t&&(this._weight=t,this.setWeightForAllAnimatables(this._weight))}get targetedAnimations(){return this._targetedAnimations}get animatables(){return this._animatables}get children(){return this._targetedAnimations}get playOrder(){return this._playOrder}set playOrder(t){if(this._playOrder!==t&&(this._playOrder=t,this._animatables.length>0)){for(let e=0;e<this._animatables.length;e++)this._animatables[e].playOrder=this._playOrder;this._scene.sortActiveAnimatables()}}get enableBlending(){return this._enableBlending}set enableBlending(t){if(this._enableBlending!==t&&(this._enableBlending=t,t!==null))for(let e=0;e<this._targetedAnimations.length;++e)this._targetedAnimations[e].animation.enableBlending=t}get blendingSpeed(){return this._blendingSpeed}set blendingSpeed(t){if(this._blendingSpeed!==t&&(this._blendingSpeed=t,t!==null))for(let e=0;e<this._targetedAnimations.length;++e)this._targetedAnimations[e].animation.blendingSpeed=t}getLength(t,e){t=t??this._from,e=e??this._to;const i=this.targetedAnimations[0].animation.framePerSecond*this._speedRatio;return(e-t)/i}static MergeAnimationGroups(t,e=!0,i=!1,n){if(t.length===0)return null;n=n??t[0].weight;let s=Number.MAX_VALUE,a=-Number.MAX_VALUE;if(i)for(const r of t)r.from<s&&(s=r.from),r.to>a&&(a=r.to);const o=new V(t[0].name+"_merged",t[0]._scene,n);for(const r of t){i&&r.normalize(s,a);for(const l of r.targetedAnimations)o.addTargetedAnimation(l.animation,l.target);e&&r.dispose()}return o}getScene(){return this._scene}constructor(t,e=null,i=-1,n=0){this.name=t,this._targetedAnimations=new Array,this._animatables=new Array,this._from=Number.MAX_VALUE,this._to=-Number.MAX_VALUE,this._speedRatio=1,this._loopAnimation=!1,this._isAdditive=!1,this._weight=-1,this._playOrder=0,this._enableBlending=null,this._blendingSpeed=null,this._numActiveAnimatables=0,this._shouldStart=!0,this._parentContainer=null,this.onAnimationEndObservable=new P,this.onAnimationLoopObservable=new P,this.onAnimationGroupLoopObservable=new P,this.onAnimationGroupEndObservable=new P,this.onAnimationGroupPauseObservable=new P,this.onAnimationGroupPlayObservable=new P,this.metadata=null,this._mask=null,this._animationLoopFlags=[],this._scene=e||k.LastCreatedScene,this._weight=i,this._playOrder=n,this.uniqueId=this._scene.getUniqueId(),this._scene.addAnimationGroup(this)}addTargetedAnimation(t,e){const i=new q(this);i.animation=t,i.target=e;const n=t.getKeys();return this._from>n[0].frame&&(this._from=n[0].frame),this._to<n[n.length-1].frame&&(this._to=n[n.length-1].frame),this._enableBlending!==null&&(t.enableBlending=this._enableBlending),this._blendingSpeed!==null&&(t.blendingSpeed=this._blendingSpeed),this._targetedAnimations.push(i),this._shouldStart=!0,i}removeTargetedAnimation(t){for(let e=this._targetedAnimations.length-1;e>-1;e--)this._targetedAnimations[e].animation===t&&this._targetedAnimations.splice(e,1)}normalize(t=null,e=null){t==null&&(t=this._from),e==null&&(e=this._to);for(let i=0;i<this._targetedAnimations.length;i++){const s=this._targetedAnimations[i].animation.getKeys(),a=s[0],o=s[s.length-1];if(a.frame>t){const r={frame:t,value:a.value,inTangent:a.inTangent,outTangent:a.outTangent,interpolation:a.interpolation};s.splice(0,0,r)}if(o.frame<e){const r={frame:e,value:o.value,inTangent:o.inTangent,outTangent:o.outTangent,interpolation:o.interpolation};s.push(r)}}return this._from=t,this._to=e,this}_processLoop(t,e,i){t.onAnimationLoop=()=>{this.onAnimationLoopObservable.notifyObservers(e),!this._animationLoopFlags[i]&&(this._animationLoopFlags[i]=!0,this._animationLoopCount++,this._animationLoopCount===this._numActiveAnimatables&&(this.onAnimationGroupLoopObservable.notifyObservers(this),this._animationLoopCount=0,this._animationLoopFlags.length=0))}}start(t=!1,e=1,i,n,s){if(this._isStarted||this._targetedAnimations.length===0)return this;this._loopAnimation=t,this._shouldStart=!1,this._animationLoopCount=0,this._animationLoopFlags.length=0;for(let a=0;a<this._targetedAnimations.length;a++){const o=this._targetedAnimations[a],r=this._scene.beginDirectAnimation(o.target,[o.animation],i!==void 0?i:this._from,n!==void 0?n:this._to,t,e,void 0,void 0,s!==void 0?s:this._isAdditive);r.weight=this._weight,r.playOrder=this._playOrder,r.onAnimationEnd=()=>{this.onAnimationEndObservable.notifyObservers(o),this._checkAnimationGroupEnded(r)},this._processLoop(r,o,a),this._animatables.push(r)}return this.syncWithMask(),this._scene.sortActiveAnimatables(),this._speedRatio=e,this._isStarted=!0,this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this}pause(){if(!this._isStarted)return this;this._isPaused=!0;for(let t=0;t<this._animatables.length;t++)this._animatables[t].pause();return this.onAnimationGroupPauseObservable.notifyObservers(this),this}play(t){return this.isStarted&&this._animatables.length&&!this._shouldStart?(t!==void 0&&(this.loopAnimation=t),this.restart()):(this.stop(),this.start(t,this._speedRatio)),this}reset(){if(!this._isStarted)return this.play(),this.goToFrame(0),this.stop(!0),this;for(let t=0;t<this._animatables.length;t++)this._animatables[t].reset();return this}restart(){if(!this._isStarted)return this;for(let t=0;t<this._animatables.length;t++)this._animatables[t].restart();return this.syncWithMask(),this._isPaused=!1,this.onAnimationGroupPlayObservable.notifyObservers(this),this}stop(t=!1){if(!this._isStarted)return this;const e=this._animatables.slice();for(let n=0;n<e.length;n++)e[n].stop(void 0,void 0,!0,t);let i=0;for(let n=0;n<this._scene._activeAnimatables.length;n++){const s=this._scene._activeAnimatables[n];s._runtimeAnimations.length>0?this._scene._activeAnimatables[i++]=s:t&&this._checkAnimationGroupEnded(s,t)}return this._scene._activeAnimatables.length=i,this._isStarted=!1,this}setWeightForAllAnimatables(t){for(let e=0;e<this._animatables.length;e++){const i=this._animatables[e];i.weight=t}return this}syncAllAnimationsWith(t){for(let e=0;e<this._animatables.length;e++)this._animatables[e].syncWith(t);return this}goToFrame(t,e=!1){if(!this._isStarted)return this;for(let i=0;i<this._animatables.length;i++)this._animatables[i].goToFrame(t,e);return this}getCurrentFrame(){var t;return((t=this.animatables[0])==null?void 0:t.masterFrame)||0}dispose(){if(this.isStarted&&this.stop(),this._targetedAnimations.length=0,this._animatables.length=0,this._scene.removeAnimationGroup(this),this._parentContainer){const t=this._parentContainer.animationGroups.indexOf(this);t>-1&&this._parentContainer.animationGroups.splice(t,1),this._parentContainer=null}this.onAnimationEndObservable.clear(),this.onAnimationGroupEndObservable.clear(),this.onAnimationGroupPauseObservable.clear(),this.onAnimationGroupPlayObservable.clear(),this.onAnimationLoopObservable.clear(),this.onAnimationGroupLoopObservable.clear()}_checkAnimationGroupEnded(t,e=!1){const i=this._animatables.indexOf(t);i>-1&&this._animatables.splice(i,1),this._animatables.length===this._targetedAnimations.length-this._numActiveAnimatables&&(this._isStarted=!1,e||this.onAnimationGroupEndObservable.notifyObservers(this),this._animatables.length=0)}clone(t,e,i=!1,n=!1){const s=new V(t||this.name,this._scene,this._weight,this._playOrder);s._from=this.from,s._to=this.to,s._speedRatio=this.speedRatio,s._loopAnimation=this.loopAnimation,s._isAdditive=this.isAdditive,s._enableBlending=this.enableBlending,s._blendingSpeed=this.blendingSpeed,s.metadata=this.metadata,s.mask=this.mask;for(const a of this._targetedAnimations)s.addTargetedAnimation(i?a.animation.clone(n):a.animation,e?e(a.target):a.target);return s}serialize(){const t={};t.name=this.name,t.from=this.from,t.to=this.to,t.speedRatio=this.speedRatio,t.loopAnimation=this.loopAnimation,t.isAdditive=this.isAdditive,t.weight=this.weight,t.playOrder=this.playOrder,t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed,t.targetedAnimations=[];for(let e=0;e<this.targetedAnimations.length;e++){const i=this.targetedAnimations[e];t.targetedAnimations[e]=i.serialize()}return w&&w.HasTags(this)&&(t.tags=w.GetTags(this)),this.metadata&&(t.metadata=this.metadata),t}static Parse(t,e,i){const n=new V(t.name,e,t.weight,t.playOrder);for(let s=0;s<t.targetedAnimations.length;s++){const a=t.targetedAnimations[s],o=A.Parse(a.animation),r=i?i(a):a.animation.property==="influence"?e.getMorphTargetById(a.targetId):e.getNodeById(a.targetId);r&&n.addTargetedAnimation(o,r)}return w&&w.AddTagsTo(n,t.tags),t.from!==null&&t.to!==null&&n.normalize(t.from,t.to),t.speedRatio!==void 0&&(n._speedRatio=t.speedRatio),t.loopAnimation!==void 0&&(n._loopAnimation=t.loopAnimation),t.isAdditive!==void 0&&(n._isAdditive=t.isAdditive),t.weight!==void 0&&(n._weight=t.weight),t.playOrder!==void 0&&(n._playOrder=t.playOrder),t.enableBlending!==void 0&&(n._enableBlending=t.enableBlending),t.blendingSpeed!==void 0&&(n._blendingSpeed=t.blendingSpeed),t.metadata!==void 0&&(n.metadata=t.metadata),n}static MakeAnimationAdditive(t,e,i,n=!1,s){let a;typeof e=="object"?a=e:a={referenceFrame:e,range:i,cloneOriginalAnimationGroup:n,clonedAnimationName:s};let o=t;a.cloneOriginalAnimationGroup&&(o=t.clone(a.clonedAnimationGroupName||o.name));const r=o.targetedAnimations;for(let l=0;l<r.length;l++){const u=r[l];u.animation=A.MakeAnimationAdditive(u.animation,a)}if(o.isAdditive=!0,a.clipKeys){let l=Number.MAX_VALUE,u=-Number.MAX_VALUE;const c=o.targetedAnimations;for(let g=0;g<c.length;g++){const m=c[g].animation.getKeys();l>m[0].frame&&(l=m[0].frame),u<m[m.length-1].frame&&(u=m[m.length-1].frame)}o._from=l,o._to=u}return o}static ClipKeys(t,e,i,n,s){const a=t.clone(n||t.name);return V.ClipKeysInPlace(a,e,i,s)}static ClipKeysInPlace(t,e,i,n){return V.ClipInPlace(t,e,i,n,!1)}static ClipFrames(t,e,i,n,s){const a=t.clone(n||t.name);return V.ClipFramesInPlace(a,e,i,s)}static ClipFramesInPlace(t,e,i,n){return V.ClipInPlace(t,e,i,n,!0)}static ClipInPlace(t,e,i,n,s=!1){let a=Number.MAX_VALUE,o=-Number.MAX_VALUE;const r=t.targetedAnimations;for(let l=0;l<r.length;l++){const u=r[l],c=n?u.animation:u.animation.clone();s&&(c.createKeyForFrame(e),c.createKeyForFrame(i));const g=c.getKeys(),d=[];let _=Number.MAX_VALUE;for(let m=0;m<g.length;m++){const b=g[m];if(!s&&m>=e&&m<=i||s&&b.frame>=e&&b.frame<=i){const O={frame:b.frame,value:b.value.clone?b.value.clone():b.value,inTangent:b.inTangent,outTangent:b.outTangent,interpolation:b.interpolation,lockedTangent:b.lockedTangent};_===Number.MAX_VALUE&&(_=O.frame),O.frame-=_,d.push(O)}}if(d.length===0){r.splice(l,1),l--;continue}a>d[0].frame&&(a=d[0].frame),o<d[d.length-1].frame&&(o=d[d.length-1].frame),c.setKeys(d,!0),u.animation=c}return t._from=a,t._to=o,t}getClassName(){return"AnimationGroup"}toString(t){let e="Name: "+this.name;return e+=", type: "+this.getClassName(),t&&(e+=", from: "+this._from,e+=", to: "+this._to,e+=", isStarted: "+this._isStarted,e+=", speedRatio: "+this._speedRatio,e+=", targetedAnimations length: "+this._targetedAnimations.length,e+=", animatables length: "+this._animatables),e}}export{V as AnimationGroup,q as TargetedAnimation};
|
assets/arcRotateCamera-CpjmrbYn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{_ as r,s as h,a as U,b as H,c as K}from"./bufferUtils-DTRdUD8L.js";import{O as X,V as l,M as w,T as v,a as L,Q as F}from"./math.vector-C1xyPDEl.js";import{E as I,C as N,R as G}from"./math.scalar.functions-DkeaWAWz.js";import{N as q}from"./node-C-Iu0ALa.js";import{M as V,C as b}from"./mesh-Fj-9677A.js";import{P as m,K as Q,E as j}from"./deviceInputEvents-BTza-zoR.js";import{P as x}from"./decorators.serialization-C7d7ykGG.js";import{B as J,E as Z,a as $}from"./easing-Wc0jPSIm.js";import{A as T}from"./animation-IftAdLIx.js";import{C as z,a as tt,T as it}from"./cameraInputsManager-WrTH9PVf.js";import{T as B}from"./tools-D01N7ptR.js";import{P as et}from"./math.plane-Ce_75-g5.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./math.color-CzLaKyb6.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./smartArray-CO6iJ0u5.js";import"./math.viewport-CgkTt1RS.js";import"./sceneComponent-Dflhczui.js";import"./lightConstants-B1TSTh-k.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./index-Bx1QoKVU.js";import"./math.axis-Ck7JfPPj.js";import"./material-CrEsrP1R.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./math.path-DFucxaHn.js";class st{constructor(){this._zoomStopsAnimation=!1,this._idleRotationSpeed=.05,this._idleRotationWaitTime=2e3,this._idleRotationSpinupTime=2e3,this.targetAlpha=null,this._attachedCamera=null,this._isPointerDown=!1,this._lastFrameTime=null,this._lastInteractionTime=-1/0,this._cameraRotationSpeed=0,this._lastFrameRadius=0}get name(){return"AutoRotation"}set zoomStopsAnimation(t){this._zoomStopsAnimation=t}get zoomStopsAnimation(){return this._zoomStopsAnimation}set idleRotationSpeed(t){this._idleRotationSpeed=t}get idleRotationSpeed(){return this._idleRotationSpeed}set idleRotationWaitTime(t){this._idleRotationWaitTime=t}get idleRotationWaitTime(){return this._idleRotationWaitTime}set idleRotationSpinupTime(t){this._idleRotationSpinupTime=t}get idleRotationSpinupTime(){return this._idleRotationSpinupTime}get rotationInProgress(){return Math.abs(this._cameraRotationSpeed)>0}get attachedNode(){return this._attachedCamera}init(){}attach(t){this._attachedCamera=t;const i=this._attachedCamera.getScene();this._onPrePointerObservableObserver=i.onPrePointerObservable.add(e=>{if(e.type===m.POINTERDOWN){this._isPointerDown=!0;return}e.type===m.POINTERUP&&(this._isPointerDown=!1)}),this._onAfterCheckInputsObserver=t.onAfterCheckInputsObservable.add(()=>{if(this._reachTargetAlpha())return;const e=x.Now;let s=0;this._lastFrameTime!=null&&(s=e-this._lastFrameTime),this._lastFrameTime=e,this._applyUserInteraction();const n=e-this._lastInteractionTime-this._idleRotationWaitTime,o=Math.max(Math.min(n/this._idleRotationSpinupTime,1),0);this._cameraRotationSpeed=this._idleRotationSpeed*o,this._attachedCamera&&(this._attachedCamera.alpha-=this._cameraRotationSpeed*(s/1e3))})}detach(){if(!this._attachedCamera)return;const t=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&t.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._attachedCamera=null,this._lastFrameTime=null}resetLastInteractionTime(t){this._lastInteractionTime=t??x.Now}_reachTargetAlpha(){return this._attachedCamera&&this.targetAlpha?Math.abs(this._attachedCamera.alpha-this.targetAlpha)<I:!1}_userIsZooming(){return this._attachedCamera?this._attachedCamera.inertialRadiusOffset!==0:!1}_shouldAnimationStopForInteraction(){if(!this._attachedCamera)return!1;let t=!1;return this._lastFrameRadius===this._attachedCamera.radius&&this._attachedCamera.inertialRadiusOffset!==0&&(t=!0),this._lastFrameRadius=this._attachedCamera.radius,this._zoomStopsAnimation?t:this._userIsZooming()}_applyUserInteraction(){this._userIsMoving()&&!this._shouldAnimationStopForInteraction()&&(this._lastInteractionTime=x.Now)}_userIsMoving(){return this._attachedCamera?this._attachedCamera.inertialAlphaOffset!==0||this._attachedCamera.inertialBetaOffset!==0||this._attachedCamera.inertialRadiusOffset!==0||this._attachedCamera.inertialPanningX!==0||this._attachedCamera.inertialPanningY!==0||this._isPointerDown:!1}}class S{constructor(){this.transitionDuration=450,this.lowerRadiusTransitionRange=2,this.upperRadiusTransitionRange=-2,this._autoTransitionRange=!1,this._attachedCamera=null,this._radiusIsAnimating=!1,this._radiusBounceTransition=null,this._animatables=new Array}get name(){return"Bouncing"}get autoTransitionRange(){return this._autoTransitionRange}set autoTransitionRange(t){if(this._autoTransitionRange===t)return;this._autoTransitionRange=t;const i=this._attachedCamera;i&&(t?this._onMeshTargetChangedObserver=i.onMeshTargetChangedObservable.add(e=>{if(e&&(e.computeWorldMatrix(!0),e.getBoundingInfo)){const s=e.getBoundingInfo().diagonalLength;this.lowerRadiusTransitionRange=s*.05,this.upperRadiusTransitionRange=s*.05}}):this._onMeshTargetChangedObserver&&i.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver))}get attachedNode(){return this._attachedCamera}init(){}attach(t){this._attachedCamera=t,this._onAfterCheckInputsObserver=t.onAfterCheckInputsObservable.add(()=>{this._attachedCamera&&(this._isRadiusAtLimit(this._attachedCamera.lowerRadiusLimit)&&this._applyBoundRadiusAnimation(this.lowerRadiusTransitionRange),this._isRadiusAtLimit(this._attachedCamera.upperRadiusLimit)&&this._applyBoundRadiusAnimation(this.upperRadiusTransitionRange))})}detach(){this._attachedCamera&&(this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null)}_isRadiusAtLimit(t){return this._attachedCamera?this._attachedCamera.radius===t&&!this._radiusIsAnimating:!1}_applyBoundRadiusAnimation(t){if(!this._attachedCamera)return;this._radiusBounceTransition||(S.EasingFunction.setEasingMode(S.EasingMode),this._radiusBounceTransition=T.CreateAnimation("radius",T.ANIMATIONTYPE_FLOAT,60,S.EasingFunction)),this._cachedWheelPrecision=this._attachedCamera.wheelPrecision,this._attachedCamera.wheelPrecision=1/0,this._attachedCamera.inertialRadiusOffset=0,this.stopAllAnimations(),this._radiusIsAnimating=!0;const i=T.TransitionTo("radius",this._attachedCamera.radius+t,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusBounceTransition,this.transitionDuration,()=>this._clearAnimationLocks());i&&this._animatables.push(i)}_clearAnimationLocks(){this._radiusIsAnimating=!1,this._attachedCamera&&(this._attachedCamera.wheelPrecision=this._cachedWheelPrecision)}stopAllAnimations(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0].onAnimationEnd=null,this._animatables[0].stop(),this._animatables.shift()}}S.EasingFunction=new J(.3);S.EasingMode=Z.EASINGMODE_EASEOUT;class f{constructor(){this.onTargetFramingAnimationEndObservable=new X,this._mode=f.FitFrustumSidesMode,this._radiusScale=1,this._positionScale=.5,this._defaultElevation=.3,this._elevationReturnTime=1500,this._elevationReturnWaitTime=1e3,this._zoomStopsAnimation=!1,this._framingTime=1500,this.autoCorrectCameraLimitsAndSensibility=!0,this._attachedCamera=null,this._isPointerDown=!1,this._lastInteractionTime=-1/0,this._animatables=new Array,this._betaIsAnimating=!1}get name(){return"Framing"}set mode(t){this._mode=t}get mode(){return this._mode}set radiusScale(t){this._radiusScale=t}get radiusScale(){return this._radiusScale}set positionScale(t){this._positionScale=t}get positionScale(){return this._positionScale}set defaultElevation(t){this._defaultElevation=t}get defaultElevation(){return this._defaultElevation}set elevationReturnTime(t){this._elevationReturnTime=t}get elevationReturnTime(){return this._elevationReturnTime}set elevationReturnWaitTime(t){this._elevationReturnWaitTime=t}get elevationReturnWaitTime(){return this._elevationReturnWaitTime}set zoomStopsAnimation(t){this._zoomStopsAnimation=t}get zoomStopsAnimation(){return this._zoomStopsAnimation}set framingTime(t){this._framingTime=t}get framingTime(){return this._framingTime}get attachedNode(){return this._attachedCamera}init(){}attach(t){this._attachedCamera=t;const i=this._attachedCamera.getScene();f.EasingFunction.setEasingMode(f.EasingMode),this._onPrePointerObservableObserver=i.onPrePointerObservable.add(e=>{if(e.type===m.POINTERDOWN){this._isPointerDown=!0;return}e.type===m.POINTERUP&&(this._isPointerDown=!1)}),this._onMeshTargetChangedObserver=t.onMeshTargetChangedObservable.add(e=>{e&&e.getBoundingInfo&&this.zoomOnMesh(e,void 0,()=>{this.onTargetFramingAnimationEndObservable.notifyObservers()})}),this._onAfterCheckInputsObserver=t.onAfterCheckInputsObservable.add(()=>{this._applyUserInteraction(),this._maintainCameraAboveGround()})}detach(){if(!this._attachedCamera)return;const t=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&t.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null}zoomOnMesh(t,i=!1,e=null){t.computeWorldMatrix(!0);const s=t.getBoundingInfo().boundingBox;this.zoomOnBoundingInfo(s.minimumWorld,s.maximumWorld,i,e)}zoomOnMeshHierarchy(t,i=!1,e=null){t.computeWorldMatrix(!0);const s=t.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(s.min,s.max,i,e)}zoomOnMeshesHierarchy(t,i=!1,e=null){const s=new l(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new l(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let o=0;o<t.length;o++){const c=t[o].getHierarchyBoundingVectors(!0);l.CheckExtends(c.min,s,n),l.CheckExtends(c.max,s,n)}this.zoomOnBoundingInfo(s,n,i,e)}zoomOnBoundingInfo(t,i,e=!1,s=null){let n;if(!this._attachedCamera)return!1;const o=t.y,c=i.y,a=o+(c-o)*this._positionScale,_=i.subtract(t).scale(.5);if(!isFinite(a))return!1;if(e)n=new l(0,a,0);else{const y=t.add(_);n=new l(y.x,a,y.z)}this._vectorTransition||(this._vectorTransition=T.CreateAnimation("target",T.ANIMATIONTYPE_VECTOR3,60,f.EasingFunction)),this._betaIsAnimating=!0;let p=T.TransitionTo("target",n,this._attachedCamera,this._attachedCamera.getScene(),60,this._vectorTransition,this._framingTime);p&&this._animatables.push(p);let O=0;if(this._mode===f.FitFrustumSidesMode){const y=this._calculateLowerRadiusFromModelBoundingSphere(t,i);this.autoCorrectCameraLimitsAndSensibility&&(this._attachedCamera.lowerRadiusLimit=_.length()+this._attachedCamera.minZ),O=y}else this._mode===f.IgnoreBoundsSizeMode&&(O=this._calculateLowerRadiusFromModelBoundingSphere(t,i),this.autoCorrectCameraLimitsAndSensibility&&this._attachedCamera.lowerRadiusLimit===null&&(this._attachedCamera.lowerRadiusLimit=this._attachedCamera.minZ));if(this.autoCorrectCameraLimitsAndSensibility){const y=i.subtract(t).length();this._attachedCamera.panningSensibility=5e3/y,this._attachedCamera.wheelPrecision=100/O}return this._radiusTransition||(this._radiusTransition=T.CreateAnimation("radius",T.ANIMATIONTYPE_FLOAT,60,f.EasingFunction)),p=T.TransitionTo("radius",O,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusTransition,this._framingTime,()=>{this.stopAllAnimations(),s&&s(),this._attachedCamera&&this._attachedCamera.useInputToRestoreState&&this._attachedCamera.storeState()}),p&&this._animatables.push(p),!0}_calculateLowerRadiusFromModelBoundingSphere(t,i){const e=this._attachedCamera;if(!e)return 0;let s=e._calculateLowerRadiusFromModelBoundingSphere(t,i,this._radiusScale);return e.lowerRadiusLimit&&this._mode===f.IgnoreBoundsSizeMode&&(s=s<e.lowerRadiusLimit?e.lowerRadiusLimit:s),e.upperRadiusLimit&&(s=s>e.upperRadiusLimit?e.upperRadiusLimit:s),s}_maintainCameraAboveGround(){if(this._elevationReturnTime<0)return;const t=x.Now-this._lastInteractionTime,i=Math.PI*.5-this._defaultElevation,e=Math.PI*.5;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>e&&t>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=T.CreateAnimation("beta",T.ANIMATIONTYPE_FLOAT,60,f.EasingFunction));const s=T.TransitionTo("beta",i,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,()=>{this._clearAnimationLocks(),this.stopAllAnimations()});s&&this._animatables.push(s)}}_clearAnimationLocks(){this._betaIsAnimating=!1}_applyUserInteraction(){this.isUserIsMoving&&(this._lastInteractionTime=x.Now,this.stopAllAnimations(),this._clearAnimationLocks())}stopAllAnimations(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0]&&(this._animatables[0].onAnimationEnd=null,this._animatables[0].stop()),this._animatables.shift()}get isUserIsMoving(){return this._attachedCamera?this._attachedCamera.inertialAlphaOffset!==0||this._attachedCamera.inertialBetaOffset!==0||this._attachedCamera.inertialRadiusOffset!==0||this._attachedCamera.inertialPanningX!==0||this._attachedCamera.inertialPanningY!==0||this._isPointerDown:!1}}f.EasingFunction=new $;f.EasingMode=Z.EASINGMODE_EASEINOUT;f.IgnoreBoundsSizeMode=0;f.FitFrustumSidesMode=1;class W{constructor(){this._currentMousePointerIdDown=-1,this.buttons=[0,1,2]}attachControl(t){t=B.BackCompatCameraNoPreventDefault(arguments);const i=this.camera.getEngine(),e=i.getInputElement();let s=0,n=null;this._pointA=null,this._pointB=null,this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._pointerInput=c=>{var O,y;const a=c.event,_=a.pointerType==="touch";if(c.type!==m.POINTERMOVE&&this.buttons.indexOf(a.button)===-1)return;const p=a.target;if(this._altKey=a.altKey,this._ctrlKey=a.ctrlKey,this._metaKey=a.metaKey,this._shiftKey=a.shiftKey,this._buttonsPressed=a.buttons,i.isPointerLock){const A=a.movementX,C=a.movementY;this.onTouch(null,A,C),this._pointA=null,this._pointB=null}else{if(c.type!==m.POINTERDOWN&&c.type!==m.POINTERDOUBLETAP&&_&&((O=this._pointA)==null?void 0:O.pointerId)!==a.pointerId&&((y=this._pointB)==null?void 0:y.pointerId)!==a.pointerId)return;if(c.type===m.POINTERDOWN&&(this._currentMousePointerIdDown===-1||_)){try{p==null||p.setPointerCapture(a.pointerId)}catch{}if(this._pointA===null)this._pointA={x:a.clientX,y:a.clientY,pointerId:a.pointerId,type:a.pointerType,button:a.button};else if(this._pointB===null)this._pointB={x:a.clientX,y:a.clientY,pointerId:a.pointerId,type:a.pointerType,button:a.button};else return;this._currentMousePointerIdDown===-1&&!_&&(this._currentMousePointerIdDown=a.pointerId),this.onButtonDown(a),t||(a.preventDefault(),e&&e.focus())}else if(c.type===m.POINTERDOUBLETAP)this.onDoubleTap(a.pointerType);else if(c.type===m.POINTERUP&&(this._currentMousePointerIdDown===a.pointerId||_)){try{p==null||p.releasePointerCapture(a.pointerId)}catch{}_||(this._pointB=null),i._badOS?this._pointA=this._pointB=null:this._pointB&&this._pointA&&this._pointA.pointerId==a.pointerId?(this._pointA=this._pointB,this._pointB=null):this._pointA&&this._pointB&&this._pointB.pointerId==a.pointerId?this._pointB=null:this._pointA=this._pointB=null,(s!==0||n)&&(this.onMultiTouch(this._pointA,this._pointB,s,0,n,null),s=0,n=null),this._currentMousePointerIdDown=-1,this.onButtonUp(a),t||a.preventDefault()}else if(c.type===m.POINTERMOVE){if(t||a.preventDefault(),this._pointA&&this._pointB===null){const A=a.clientX-this._pointA.x,C=a.clientY-this._pointA.y;this._pointA.x=a.clientX,this._pointA.y=a.clientY,this.onTouch(this._pointA,A,C)}else if(this._pointA&&this._pointB){const A=this._pointA.pointerId===a.pointerId?this._pointA:this._pointB;A.x=a.clientX,A.y=a.clientY;const C=this._pointA.x-this._pointB.x,E=this._pointA.y-this._pointB.y,M=C*C+E*E,Y={x:(this._pointA.x+this._pointB.x)/2,y:(this._pointA.y+this._pointB.y)/2,pointerId:a.pointerId,type:c.type};this.onMultiTouch(this._pointA,this._pointB,s,M,n,Y),n=Y,s=M}}}},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,m.POINTERDOWN|m.POINTERUP|m.POINTERMOVE|m.POINTERDOUBLETAP),this._onLostFocus=()=>{this._pointA=this._pointB=null,s=0,n=null,this.onLostFocus()},this._contextMenuBind=c=>this.onContextMenu(c),e&&e.addEventListener("contextmenu",this._contextMenuBind,!1);const o=this.camera.getScene().getEngine().getHostWindow();o&&B.RegisterTopRootEvents(o,[{name:"blur",handler:this._onLostFocus}])}detachControl(){if(this._onLostFocus){const t=this.camera.getScene().getEngine().getHostWindow();t&&B.UnregisterTopRootEvents(t,[{name:"blur",handler:this._onLostFocus}])}if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._contextMenuBind){const t=this.camera.getScene().getEngine().getInputElement();t&&t.removeEventListener("contextmenu",this._contextMenuBind)}this._onLostFocus=null}this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._currentMousePointerIdDown=-1}getClassName(){return"BaseCameraPointersInput"}getSimpleName(){return"pointers"}onDoubleTap(t){}onTouch(t,i,e){}onMultiTouch(t,i,e,s,n,o){}onContextMenu(t){t.preventDefault()}onButtonDown(t){}onButtonUp(t){}onLostFocus(){}}r([h()],W.prototype,"buttons",void 0);class k extends W{constructor(){super(...arguments),this.pinchZoom=!0,this.multiTouchPanning=!0,this.multiTouchPanAndZoom=!0,this._isPinching=!1,this._twoFingerActivityCount=0,this._shouldStartPinchZoom=!1}_computePinchZoom(t,i){}_computeMultiTouchPanning(t,i){}onMultiTouch(t,i,e,s,n,o){e===0&&n===null||s===0&&o===null||(this.multiTouchPanAndZoom?(this._computePinchZoom(e,s),this._computeMultiTouchPanning(n,o)):this.multiTouchPanning&&this.pinchZoom?(this._twoFingerActivityCount++,this._isPinching||this._shouldStartPinchZoom?(this._computePinchZoom(e,s),this._isPinching=!0):this._computeMultiTouchPanning(n,o)):this.multiTouchPanning?this._computeMultiTouchPanning(n,o):this.pinchZoom&&this._computePinchZoom(e,s))}onButtonUp(t){this._twoFingerActivityCount=0,this._isPinching=!1}onLostFocus(){this._twoFingerActivityCount=0,this._isPinching=!1}}r([h()],k.prototype,"pinchZoom",void 0);r([h()],k.prototype,"multiTouchPanning",void 0);r([h()],k.prototype,"multiTouchPanAndZoom",void 0);class R extends k{constructor(){super(...arguments),this.buttons=[0,1,2],this.angularSensibilityX=1e3,this.angularSensibilityY=1e3,this.pinchPrecision=12,this.pinchDeltaPercentage=0,this.useNaturalPinchZoom=!1,this.panningSensibility=1e3,this.pinchInwards=!0,this._isPanClick=!1}getClassName(){return"ArcRotateCameraPointersInput"}_computeMultiTouchPanning(t,i){if(this.panningSensibility!==0&&t&&i){const e=i.x-t.x,s=i.y-t.y;this.camera.inertialPanningX+=-e/this.panningSensibility,this.camera.inertialPanningY+=s/this.panningSensibility}}_computePinchZoom(t,i){const e=this.camera.radius||R.MinimumRadiusForPinch;this.useNaturalPinchZoom?this.camera.radius=e*Math.sqrt(t)/Math.sqrt(i):this.pinchDeltaPercentage?this.camera.inertialRadiusOffset+=(i-t)*.001*e*this.pinchDeltaPercentage:this.camera.inertialRadiusOffset+=(i-t)/(this.pinchPrecision*(this.pinchInwards?1:-1)*(this.angularSensibilityX+this.angularSensibilityY)/2)}onTouch(t,i,e){this.panningSensibility!==0&&(this._ctrlKey&&this.camera._useCtrlForPanning||this._isPanClick)?(this.camera.inertialPanningX+=-i/this.panningSensibility,this.camera.inertialPanningY+=e/this.panningSensibility):(this.camera.inertialAlphaOffset-=i/this.angularSensibilityX,this.camera.inertialBetaOffset-=e/this.angularSensibilityY)}onDoubleTap(){this.camera.useInputToRestoreState&&this.camera.restoreState()}onMultiTouch(t,i,e,s,n,o){this._shouldStartPinchZoom=this._twoFingerActivityCount<20&&Math.abs(Math.sqrt(s)-Math.sqrt(e))>this.camera.pinchToPanMaxDistance,super.onMultiTouch(t,i,e,s,n,o)}onButtonDown(t){this._isPanClick=t.button===this.camera._panningMouseButton,super.onButtonDown(t)}onButtonUp(t){super.onButtonUp(t)}onLostFocus(){this._isPanClick=!1,super.onLostFocus()}}R.MinimumRadiusForPinch=.001;r([h()],R.prototype,"buttons",void 0);r([h()],R.prototype,"angularSensibilityX",void 0);r([h()],R.prototype,"angularSensibilityY",void 0);r([h()],R.prototype,"pinchPrecision",void 0);r([h()],R.prototype,"pinchDeltaPercentage",void 0);r([h()],R.prototype,"useNaturalPinchZoom",void 0);r([h()],R.prototype,"panningSensibility",void 0);z.ArcRotateCameraPointersInput=R;class P{constructor(){this.keysUp=[38],this.keysDown=[40],this.keysLeft=[37],this.keysRight=[39],this.keysReset=[220],this.panningSensibility=50,this.zoomingSensibility=25,this.useAltToZoom=!0,this.angularSpeed=.01,this._keys=new Array}attachControl(t){t=B.BackCompatCameraNoPreventDefault(arguments),!this._onCanvasBlurObserver&&(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(i=>{const e=i.event;if(!e.metaKey){if(i.type===Q.KEYDOWN)this._ctrlPressed=e.ctrlKey,this._altPressed=e.altKey,(this.keysUp.indexOf(e.keyCode)!==-1||this.keysDown.indexOf(e.keyCode)!==-1||this.keysLeft.indexOf(e.keyCode)!==-1||this.keysRight.indexOf(e.keyCode)!==-1||this.keysReset.indexOf(e.keyCode)!==-1)&&(this._keys.indexOf(e.keyCode)===-1&&this._keys.push(e.keyCode),e.preventDefault&&(t||e.preventDefault()));else if(this.keysUp.indexOf(e.keyCode)!==-1||this.keysDown.indexOf(e.keyCode)!==-1||this.keysLeft.indexOf(e.keyCode)!==-1||this.keysRight.indexOf(e.keyCode)!==-1||this.keysReset.indexOf(e.keyCode)!==-1){const s=this._keys.indexOf(e.keyCode);s>=0&&this._keys.splice(s,1),e.preventDefault&&(t||e.preventDefault())}}}))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){if(this._onKeyboardObserver){const t=this.camera;for(let i=0;i<this._keys.length;i++){const e=this._keys[i];this.keysLeft.indexOf(e)!==-1?this._ctrlPressed&&this.camera._useCtrlForPanning?t.inertialPanningX-=1/this.panningSensibility:t.inertialAlphaOffset-=this.angularSpeed:this.keysUp.indexOf(e)!==-1?this._ctrlPressed&&this.camera._useCtrlForPanning?t.inertialPanningY+=1/this.panningSensibility:this._altPressed&&this.useAltToZoom?t.inertialRadiusOffset+=1/this.zoomingSensibility:t.inertialBetaOffset-=this.angularSpeed:this.keysRight.indexOf(e)!==-1?this._ctrlPressed&&this.camera._useCtrlForPanning?t.inertialPanningX+=1/this.panningSensibility:t.inertialAlphaOffset+=this.angularSpeed:this.keysDown.indexOf(e)!==-1?this._ctrlPressed&&this.camera._useCtrlForPanning?t.inertialPanningY-=1/this.panningSensibility:this._altPressed&&this.useAltToZoom?t.inertialRadiusOffset-=1/this.zoomingSensibility:t.inertialBetaOffset+=this.angularSpeed:this.keysReset.indexOf(e)!==-1&&t.useInputToRestoreState&&t.restoreState()}}}getClassName(){return"ArcRotateCameraKeyboardMoveInput"}getSimpleName(){return"keyboard"}}r([h()],P.prototype,"keysUp",void 0);r([h()],P.prototype,"keysDown",void 0);r([h()],P.prototype,"keysLeft",void 0);r([h()],P.prototype,"keysRight",void 0);r([h()],P.prototype,"keysReset",void 0);r([h()],P.prototype,"panningSensibility",void 0);r([h()],P.prototype,"zoomingSensibility",void 0);r([h()],P.prototype,"useAltToZoom",void 0);r([h()],P.prototype,"angularSpeed",void 0);z.ArcRotateCameraKeyboardMoveInput=P;const at=40;class D{constructor(){this.wheelPrecision=3,this.zoomToMouseLocation=!1,this.wheelDeltaPercentage=0,this.customComputeDeltaFromMouseWheel=null,this._viewOffset=new l(0,0,0),this._globalOffset=new l(0,0,0),this._inertialPanning=l.Zero()}_computeDeltaFromMouseWheelLegacyEvent(t,i){let e;const s=t*.01*this.wheelDeltaPercentage*i;return t>0?e=s/(1+this.wheelDeltaPercentage):e=s*(1+this.wheelDeltaPercentage),e}attachControl(t){t=B.BackCompatCameraNoPreventDefault(arguments),this._wheel=i=>{if(i.type!==m.POINTERWHEEL)return;const e=i.event;let s;const n=e.deltaMode===j.DOM_DELTA_LINE?at:1,o=-(e.deltaY*n);if(this.customComputeDeltaFromMouseWheel)s=this.customComputeDeltaFromMouseWheel(o,this,e);else if(this.wheelDeltaPercentage){if(s=this._computeDeltaFromMouseWheelLegacyEvent(o,this.camera.radius),s>0){let c=this.camera.radius,a=this.camera.inertialRadiusOffset+s;for(let _=0;_<20&&!(c<=a||Math.abs(a*this.camera.inertia)<.001);_++)c-=a,a*=this.camera.inertia;c=N(c,0,Number.MAX_VALUE),s=this._computeDeltaFromMouseWheelLegacyEvent(o,c)}}else s=o/(this.wheelPrecision*40);s&&(this.zoomToMouseLocation?(this._hitPlane||this._updateHitPlane(),this._zoomToMouse(s)):this.camera.inertialRadiusOffset+=s),e.preventDefault&&(t||e.preventDefault())},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,m.POINTERWHEEL),this.zoomToMouseLocation&&this._inertialPanning.setAll(0)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null)}checkInputs(){if(!this.zoomToMouseLocation)return;const t=this.camera;0+t.inertialAlphaOffset+t.inertialBetaOffset+t.inertialRadiusOffset&&(this._updateHitPlane(),t.target.addInPlace(this._inertialPanning),this._inertialPanning.scaleInPlace(t.inertia),this._zeroIfClose(this._inertialPanning))}getClassName(){return"ArcRotateCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}_updateHitPlane(){const t=this.camera,i=t.target.subtract(t.position);this._hitPlane=et.FromPositionAndNormal(t.target,i)}_getPosition(){const t=this.camera,i=t.getScene(),e=i.createPickingRay(i.pointerX,i.pointerY,w.Identity(),t,!1);(t.targetScreenOffset.x!==0||t.targetScreenOffset.y!==0)&&(this._viewOffset.set(t.targetScreenOffset.x,t.targetScreenOffset.y,0),t.getViewMatrix().invertToRef(t._cameraTransformMatrix),this._globalOffset=l.TransformNormal(this._viewOffset,t._cameraTransformMatrix),e.origin.addInPlace(this._globalOffset));let s=0;return this._hitPlane&&(s=e.intersectsPlane(this._hitPlane)??0),e.origin.addInPlace(e.direction.scaleInPlace(s))}_zoomToMouse(t){const i=this.camera,e=1-i.inertia;if(i.lowerRadiusLimit){const a=i.lowerRadiusLimit??0;i.radius-(i.inertialRadiusOffset+t)/e<a&&(t=(i.radius-a)*e-i.inertialRadiusOffset)}if(i.upperRadiusLimit){const a=i.upperRadiusLimit??0;i.radius-(i.inertialRadiusOffset+t)/e>a&&(t=(i.radius-a)*e-i.inertialRadiusOffset)}const n=t/e/i.radius,o=this._getPosition(),c=v.Vector3[6];o.subtractToRef(i.target,c),c.scaleInPlace(n),c.scaleInPlace(e),this._inertialPanning.addInPlace(c),i.inertialRadiusOffset+=t}_zeroIfClose(t){Math.abs(t.x)<I&&(t.x=0),Math.abs(t.y)<I&&(t.y=0),Math.abs(t.z)<I&&(t.z=0)}}r([h()],D.prototype,"wheelPrecision",void 0);r([h()],D.prototype,"zoomToMouseLocation",void 0);r([h()],D.prototype,"wheelDeltaPercentage",void 0);z.ArcRotateCameraMouseWheelInput=D;class nt extends tt{constructor(t){super(t)}addMouseWheel(){return this.add(new D),this}addPointers(){return this.add(new R),this}addKeyboard(){return this.add(new P),this}}q.AddNodeConstructor("ArcRotateCamera",(d,t)=>()=>new u(d,0,0,1,l.Zero(),t));function ot(d){let t=Math.PI/2;return d.x===0&&d.z===0||(t=Math.acos(d.x/Math.sqrt(Math.pow(d.x,2)+Math.pow(d.z,2)))),d.z<0&&(t=2*Math.PI-t),t}function rt(d,t){return Math.acos(d/t)}function g(d,t){return isNaN(d)?t:d}class u extends it{get target(){return this._target}set target(t){this.setTarget(t)}get targetHost(){return this._targetHost}set targetHost(t){t&&this.setTarget(t)}getTarget(){return this.target}get position(){return this._position}set position(t){this.setPosition(t)}set upVector(t){this._upToYMatrix||(this._yToUpMatrix=new w,this._upToYMatrix=new w,this._upVector=l.Zero()),t.normalize(),this._upVector.copyFrom(t),this.setMatUp()}get upVector(){return this._upVector}setMatUp(){w.RotationAlignToRef(l.UpReadOnly,this._upVector,this._yToUpMatrix),w.RotationAlignToRef(this._upVector,l.UpReadOnly,this._upToYMatrix)}get angularSensibilityX(){const t=this.inputs.attached.pointers;return t?t.angularSensibilityX:0}set angularSensibilityX(t){const i=this.inputs.attached.pointers;i&&(i.angularSensibilityX=t)}get angularSensibilityY(){const t=this.inputs.attached.pointers;return t?t.angularSensibilityY:0}set angularSensibilityY(t){const i=this.inputs.attached.pointers;i&&(i.angularSensibilityY=t)}get pinchPrecision(){const t=this.inputs.attached.pointers;return t?t.pinchPrecision:0}set pinchPrecision(t){const i=this.inputs.attached.pointers;i&&(i.pinchPrecision=t)}get pinchDeltaPercentage(){const t=this.inputs.attached.pointers;return t?t.pinchDeltaPercentage:0}set pinchDeltaPercentage(t){const i=this.inputs.attached.pointers;i&&(i.pinchDeltaPercentage=t)}get useNaturalPinchZoom(){const t=this.inputs.attached.pointers;return t?t.useNaturalPinchZoom:!1}set useNaturalPinchZoom(t){const i=this.inputs.attached.pointers;i&&(i.useNaturalPinchZoom=t)}get panningSensibility(){const t=this.inputs.attached.pointers;return t?t.panningSensibility:0}set panningSensibility(t){const i=this.inputs.attached.pointers;i&&(i.panningSensibility=t)}get keysUp(){const t=this.inputs.attached.keyboard;return t?t.keysUp:[]}set keysUp(t){const i=this.inputs.attached.keyboard;i&&(i.keysUp=t)}get keysDown(){const t=this.inputs.attached.keyboard;return t?t.keysDown:[]}set keysDown(t){const i=this.inputs.attached.keyboard;i&&(i.keysDown=t)}get keysLeft(){const t=this.inputs.attached.keyboard;return t?t.keysLeft:[]}set keysLeft(t){const i=this.inputs.attached.keyboard;i&&(i.keysLeft=t)}get keysRight(){const t=this.inputs.attached.keyboard;return t?t.keysRight:[]}set keysRight(t){const i=this.inputs.attached.keyboard;i&&(i.keysRight=t)}get wheelPrecision(){const t=this.inputs.attached.mousewheel;return t?t.wheelPrecision:0}set wheelPrecision(t){const i=this.inputs.attached.mousewheel;i&&(i.wheelPrecision=t)}get zoomToMouseLocation(){const t=this.inputs.attached.mousewheel;return t?t.zoomToMouseLocation:!1}set zoomToMouseLocation(t){const i=this.inputs.attached.mousewheel;i&&(i.zoomToMouseLocation=t)}get wheelDeltaPercentage(){const t=this.inputs.attached.mousewheel;return t?t.wheelDeltaPercentage:0}set wheelDeltaPercentage(t){const i=this.inputs.attached.mousewheel;i&&(i.wheelDeltaPercentage=t)}get isInterpolating(){return this._isInterpolating}get bouncingBehavior(){return this._bouncingBehavior}get useBouncingBehavior(){return this._bouncingBehavior!=null}set useBouncingBehavior(t){t!==this.useBouncingBehavior&&(t?(this._bouncingBehavior=new S,this.addBehavior(this._bouncingBehavior)):this._bouncingBehavior&&(this.removeBehavior(this._bouncingBehavior),this._bouncingBehavior=null))}get framingBehavior(){return this._framingBehavior}get useFramingBehavior(){return this._framingBehavior!=null}set useFramingBehavior(t){t!==this.useFramingBehavior&&(t?(this._framingBehavior=new f,this.addBehavior(this._framingBehavior)):this._framingBehavior&&(this.removeBehavior(this._framingBehavior),this._framingBehavior=null))}get autoRotationBehavior(){return this._autoRotationBehavior}get useAutoRotationBehavior(){return this._autoRotationBehavior!=null}set useAutoRotationBehavior(t){t!==this.useAutoRotationBehavior&&(t?(this._autoRotationBehavior=new st,this.addBehavior(this._autoRotationBehavior)):this._autoRotationBehavior&&(this.removeBehavior(this._autoRotationBehavior),this._autoRotationBehavior=null))}constructor(t,i,e,s,n,o,c=!0){super(t,l.Zero(),o,c),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.lowerAlphaLimit=null,this.upperAlphaLimit=null,this.lowerBetaLimit=.01,this.upperBetaLimit=Math.PI-.01,this.lowerRadiusLimit=null,this.upperRadiusLimit=null,this.lowerTargetYLimit=-1/0,this.inertialPanningX=0,this.inertialPanningY=0,this.pinchToPanMaxDistance=20,this.panningDistanceLimit=null,this.panningOriginTarget=l.Zero(),this.panningInertia=.9,this.zoomOnFactor=1,this.targetScreenOffset=L.Zero(),this.allowUpsideDown=!0,this.useInputToRestoreState=!0,this.restoreStateInterpolationFactor=0,this._currentInterpolationFactor=0,this._viewMatrix=new w,this.panningAxis=new l(1,1,0),this._transformedDirection=new l,this.mapPanning=!1,this._isInterpolating=!1,this.onMeshTargetChangedObservable=new X,this.checkCollisions=!1,this.collisionRadius=new l(.5,.5,.5),this._previousPosition=l.Zero(),this._collisionVelocity=l.Zero(),this._newPosition=l.Zero(),this._computationVector=l.Zero(),this._goalAlpha=NaN,this._goalBeta=NaN,this._goalRadius=NaN,this._goalTarget=new l(NaN,NaN,NaN),this._goalTargetScreenOffset=new L(NaN,NaN),this._onCollisionPositionChange=(a,_,p=null)=>{p?(this.setPosition(_),this.onCollide&&this.onCollide(p)):this._previousPosition.copyFrom(this._position);const O=Math.cos(this.alpha),y=Math.sin(this.alpha),A=Math.cos(this.beta);let C=Math.sin(this.beta);C===0&&(C=1e-4);const E=this._getTargetPosition();this._computationVector.copyFromFloats(this.radius*O*C,this.radius*A,this.radius*y*C),E.addToRef(this._computationVector,this._newPosition),this._position.copyFrom(this._newPosition);let M=this.upVector;this.allowUpsideDown&&this.beta<0&&(M=M.clone(),M=M.negate()),this._computeViewMatrix(this._position,E,M),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y),this._collisionTriggered=!1},this._target=l.Zero(),n&&this.setTarget(n),this.alpha=i,this.beta=e,this.radius=s,this.getViewMatrix(),this.inputs=new nt(this),this.inputs.addKeyboard().addMouseWheel().addPointers()}_initCache(){super._initCache(),this._cache._target=new l(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.alpha=void 0,this._cache.beta=void 0,this._cache.radius=void 0,this._cache.targetScreenOffset=L.Zero()}_updateCache(t){t||super._updateCache(),this._cache._target.copyFrom(this._getTargetPosition()),this._cache.alpha=this.alpha,this._cache.beta=this.beta,this._cache.radius=this.radius,this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)}_getTargetPosition(){if(this._targetHost&&this._targetHost.getAbsolutePosition){const i=this._targetHost.getAbsolutePosition();this._targetBoundingCenter?i.addToRef(this._targetBoundingCenter,this._target):this._target.copyFrom(i)}const t=this._getLockedTargetPosition();return t||this._target}storeState(){return this._storedAlpha=this.alpha,this._storedBeta=this.beta,this._storedRadius=this.radius,this._storedTarget=this._getTargetPosition().clone(),this._storedTargetScreenOffset=this.targetScreenOffset.clone(),super.storeState()}_restoreStateValues(){return this.hasStateStored()&&this.restoreStateInterpolationFactor>I&&this.restoreStateInterpolationFactor<1?(this.interpolateTo(this._storedAlpha,this._storedBeta,this._storedRadius,this._storedTarget,this._storedTargetScreenOffset,this.restoreStateInterpolationFactor),!0):super._restoreStateValues()?(this.setTarget(this._storedTarget.clone()),this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.targetScreenOffset=this._storedTargetScreenOffset.clone(),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0):!1}stopInterpolation(){this._goalAlpha=NaN,this._goalBeta=NaN,this._goalRadius=NaN,this._goalTarget.set(NaN,NaN,NaN),this._goalTargetScreenOffset.set(NaN,NaN)}interpolateTo(t=this.alpha,i=this.beta,e=this.radius,s=this.target,n=this.targetScreenOffset,o){this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,o!=null?this._currentInterpolationFactor=o:this.restoreStateInterpolationFactor!==0?this._currentInterpolationFactor=this.restoreStateInterpolationFactor:this._currentInterpolationFactor=.1,this._goalAlpha=g(t,this._goalAlpha),this._goalBeta=g(i,this._goalBeta),this._goalRadius=g(e,this._goalRadius),this._goalTarget.set(g(s.x,this._goalTarget.x),g(s.y,this._goalTarget.y),g(s.z,this._goalTarget.z)),this._goalTargetScreenOffset.set(g(n.x,this._goalTargetScreenOffset.x),g(n.y,this._goalTargetScreenOffset.y)),this._goalAlpha=N(this._goalAlpha,this.lowerAlphaLimit??-1/0,this.upperAlphaLimit??1/0),this._goalBeta=N(this._goalBeta,this.lowerBetaLimit??-1/0,this.upperBetaLimit??1/0),this._goalRadius=N(this._goalRadius,this.lowerRadiusLimit??-1/0,this.upperRadiusLimit??1/0),this._goalTarget.y=N(this._goalTarget.y,this.lowerTargetYLimit??-1/0,1/0),this._isInterpolating=!0}_isSynchronizedViewMatrix(){return super._isSynchronizedViewMatrix()?this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset):!1}attachControl(t,i,e=!0,s=2){const n=arguments;i=B.BackCompatCameraNoPreventDefault(n),this._useCtrlForPanning=e,this._panningMouseButton=s,typeof n[0]=="boolean"&&(n.length>1&&(this._useCtrlForPanning=n[1]),n.length>2&&(this._panningMouseButton=n[2])),this.inputs.attachElement(i),this._reset=()=>{this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0}}detachControl(){this.inputs.detachElement(),this._reset&&this._reset()}_checkInputs(){if(this._collisionTriggered)return;this.inputs.checkInputs();let t=!1;if(this.inertialAlphaOffset!==0||this.inertialBetaOffset!==0||this.inertialRadiusOffset!==0){t=!0;const i=this.invertRotation?-1:1,e=this._calculateHandednessMultiplier();let s=this.inertialAlphaOffset*e;this.beta<0&&(s*=-1),this.alpha+=s*i,this.beta+=this.inertialBetaOffset*i,this.radius-=this.inertialRadiusOffset,this.inertialAlphaOffset*=this.inertia,this.inertialBetaOffset*=this.inertia,this.inertialRadiusOffset*=this.inertia,Math.abs(this.inertialAlphaOffset)<this._rotationEpsilon&&(this.inertialAlphaOffset=0),Math.abs(this.inertialBetaOffset)<this._rotationEpsilon&&(this.inertialBetaOffset=0),Math.abs(this.inertialRadiusOffset)<this.speed*this._rotationEpsilon&&(this.inertialRadiusOffset=0)}if(this.inertialPanningX!==0||this.inertialPanningY!==0){t=!0;const i=new l(this.inertialPanningX,this.inertialPanningY,this.inertialPanningY);if(this._viewMatrix.invertToRef(this._cameraTransformMatrix),i.multiplyInPlace(this.panningAxis),l.TransformNormalToRef(i,this._cameraTransformMatrix,this._transformedDirection),this.mapPanning){const s=this.upVector,n=l.CrossToRef(this._transformedDirection,s,this._transformedDirection);l.CrossToRef(s,n,this._transformedDirection)}else this.panningAxis.y||(this._transformedDirection.y=0);if(!this._targetHost)if(this.panningDistanceLimit)this._transformedDirection.addInPlace(this._target),l.DistanceSquared(this._transformedDirection,this.panningOriginTarget)<=this.panningDistanceLimit*this.panningDistanceLimit&&this._target.copyFrom(this._transformedDirection);else{if(this.parent){const s=v.Matrix[0];this.parent.getWorldMatrix().getRotationMatrixToRef(s),s.transposeToRef(s),l.TransformCoordinatesToRef(this._transformedDirection,s,this._transformedDirection)}this._target.addInPlace(this._transformedDirection)}this.inertialPanningX*=this.panningInertia,this.inertialPanningY*=this.panningInertia;const e=this.speed*this._panningEpsilon;Math.abs(this.inertialPanningX)<e&&(this.inertialPanningX=0),Math.abs(this.inertialPanningY)<e&&(this.inertialPanningY=0)}if(t)this.stopInterpolation();else if(this._isInterpolating){let i=!1;const e=this._scene.getEngine().getDeltaTime()/1e3,s=1-Math.pow(2,-e/this._currentInterpolationFactor),n=g(this._goalRadius,this.radius);if(!isNaN(this._goalTarget.x)||!isNaN(this._goalTarget.y)||!isNaN(this._goalTarget.z)){const o=v.Vector3[0].set(g(this._goalTarget.x,this._target.x),g(this._goalTarget.y,this._target.y),g(this._goalTarget.z,this._target.z));l.LerpToRef(this.target,o,s,this._target),l.Distance(this.target,o)*10/n<I?(this._goalTarget.set(NaN,NaN,NaN),this.target.copyFrom(o),this.setTarget(this.target,!1,!0,!0)):i=!0}if(!isNaN(this._goalAlpha)||!isNaN(this._goalBeta)){const o=F.RotationAlphaBetaGammaToRef(g(this._goalAlpha,this.alpha),g(this._goalBeta,this.beta),0,v.Quaternion[0]),c=F.RotationAlphaBetaGammaToRef(this.alpha,this.beta,0,v.Quaternion[1]),a=F.SlerpToRef(c,o,s,v.Quaternion[2]);a.normalize();const _=a.toAlphaBetaGammaToRef(v.Vector3[0]);if(this.alpha=_.x,this.beta=_.y,a.isApprox(o,I/5)){this._goalAlpha=NaN,this._goalBeta=NaN;const p=o.toAlphaBetaGammaToRef(v.Vector3[0]);this.alpha=p.x,this.beta=p.y}else i=!0}if(isNaN(this._goalRadius)||(this.radius+=(n-this.radius)*s,Math.abs(n/this.radius-1)<I?(this._goalRadius=NaN,this.radius=n):i=!0),!isNaN(this._goalTargetScreenOffset.x)||!isNaN(this._goalTargetScreenOffset.y)){const o=v.Vector2[0].set(g(this._goalTargetScreenOffset.x,this.targetScreenOffset.x),g(this._goalTargetScreenOffset.y,this.targetScreenOffset.y));L.LerpToRef(this.targetScreenOffset,o,s,this.targetScreenOffset),L.Distance(this.targetScreenOffset,o)<I?(this._goalTargetScreenOffset.set(NaN,NaN),this.targetScreenOffset.copyFrom(o)):i=!0}this._isInterpolating=i}this._checkLimits(),super._checkInputs()}_checkLimits(){this.lowerBetaLimit===null||this.lowerBetaLimit===void 0?this.allowUpsideDown&&this.beta>Math.PI&&(this.beta=this.beta-2*Math.PI):this.beta<this.lowerBetaLimit&&(this.beta=this.lowerBetaLimit),this.upperBetaLimit===null||this.upperBetaLimit===void 0?this.allowUpsideDown&&this.beta<-Math.PI&&(this.beta=this.beta+2*Math.PI):this.beta>this.upperBetaLimit&&(this.beta=this.upperBetaLimit),this.lowerAlphaLimit!==null&&this.alpha<this.lowerAlphaLimit&&(this.alpha=this.lowerAlphaLimit),this.upperAlphaLimit!==null&&this.alpha>this.upperAlphaLimit&&(this.alpha=this.upperAlphaLimit),this.lowerRadiusLimit!==null&&this.radius<this.lowerRadiusLimit&&(this.radius=this.lowerRadiusLimit,this.inertialRadiusOffset=0),this.upperRadiusLimit!==null&&this.radius>this.upperRadiusLimit&&(this.radius=this.upperRadiusLimit,this.inertialRadiusOffset=0),this.target.y=Math.max(this.target.y,this.lowerTargetYLimit)}rebuildAnglesAndRadius(){this._position.subtractToRef(this._getTargetPosition(),this._computationVector),(this._upVector.x!==0||this._upVector.y!==1||this._upVector.z!==0)&&l.TransformCoordinatesToRef(this._computationVector,this._upToYMatrix,this._computationVector),this.radius=this._computationVector.length(),this.radius===0&&(this.radius=1e-4);const t=this.alpha;this.alpha=ot(this._computationVector),this.beta=rt(this._computationVector.y,this.radius);const i=Math.round((t-this.alpha)/(2*Math.PI));this.alpha+=i*2*Math.PI,this._checkLimits()}setPosition(t){this._position.equals(t)||(this._position.copyFrom(t),this.rebuildAnglesAndRadius())}setTarget(t,i=!1,e=!1,s=!1){if(s=this.overrideCloneAlphaBetaRadius??s,t.computeWorldMatrix)i&&t.getBoundingInfo?this._targetBoundingCenter=t.getBoundingInfo().boundingBox.centerWorld.clone():this._targetBoundingCenter=null,t.computeWorldMatrix(),this._targetHost=t,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{const n=t,o=this._getTargetPosition();if(o&&!e&&o.equals(n))return;this._targetHost=null,this._target=n,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}s||this.rebuildAnglesAndRadius()}_getViewMatrix(){const t=Math.cos(this.alpha),i=Math.sin(this.alpha),e=Math.cos(this.beta);let s=Math.sin(this.beta);s===0&&(s=1e-4),this.radius===0&&(this.radius=1e-4);const n=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*t*s,this.radius*e,this.radius*i*s),(this._upVector.x!==0||this._upVector.y!==1||this._upVector.z!==0)&&l.TransformCoordinatesToRef(this._computationVector,this._yToUpMatrix,this._computationVector),n.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){const o=this.getScene().collisionCoordinator;this._collider||(this._collider=o.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this._position,this._collisionVelocity),this._collisionTriggered=!0,o.getNewPosition(this._position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this._position.copyFrom(this._newPosition);let o=this.upVector;this.allowUpsideDown&&s<0&&(o=o.negate()),this._computeViewMatrix(this._position,n,o),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget.copyFrom(n),this._viewMatrix}zoomOn(t,i=!1){t=t||this.getScene().meshes;const e=V.MinMax(t);let s=this._calculateLowerRadiusFromModelBoundingSphere(e.min,e.max);if(s=Math.max(Math.min(s,this.upperRadiusLimit||Number.MAX_VALUE),this.lowerRadiusLimit||0),this.radius=s*this.zoomOnFactor,this.mode===b.ORTHOGRAPHIC_CAMERA){const n=this.getScene().getEngine().getAspectRatio(this),o=s*this.zoomOnFactor/2;this.orthoLeft=-o*n,this.orthoRight=o*n,this.orthoBottom=-o,this.orthoTop=o}this.focusOn({min:e.min,max:e.max,distance:s},i)}focusOn(t,i=!1){let e,s;if(t.min===void 0){const n=t||this.getScene().meshes;e=V.MinMax(n),s=l.Distance(e.min,e.max)}else{const n=t;e=n,s=n.distance}this._target=V.Center(e),i||(this.maxZ=s*2)}createRigCamera(t,i){let e=0;switch(this.cameraRigMode){case b.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case b.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case b.RIG_MODE_STEREOSCOPIC_OVERUNDER:case b.RIG_MODE_STEREOSCOPIC_INTERLACED:case b.RIG_MODE_VR:e=this._cameraRigParams.stereoHalfAngle*(i===0?1:-1);break;case b.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:e=this._cameraRigParams.stereoHalfAngle*(i===0?-1:1);break}const s=new u(t,this.alpha+e,this.beta,this.radius,this._target,this.getScene());return s._cameraRigParams={},s.isRigCamera=!0,s.rigParent=this,s.upVector=this.upVector,s.mode=this.mode,s.orthoLeft=this.orthoLeft,s.orthoRight=this.orthoRight,s.orthoBottom=this.orthoBottom,s.orthoTop=this.orthoTop,s}_updateRigCameras(){const t=this._rigCameras[0],i=this._rigCameras[1];switch(t.beta=i.beta=this.beta,this.cameraRigMode){case b.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case b.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case b.RIG_MODE_STEREOSCOPIC_OVERUNDER:case b.RIG_MODE_STEREOSCOPIC_INTERLACED:case b.RIG_MODE_VR:t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,i.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case b.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:t.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,i.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle;break}super._updateRigCameras()}_calculateLowerRadiusFromModelBoundingSphere(t,i,e=1){const s=l.Distance(t,i),o=this.getScene().getEngine().getAspectRatio(this),c=Math.tan(this.fov/2),a=c*o,p=s*.5*e,O=p*Math.sqrt(1+1/(a*a)),y=p*Math.sqrt(1+1/(c*c));return Math.max(O,y)}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"ArcRotateCamera"}}r([h()],u.prototype,"alpha",void 0);r([h()],u.prototype,"beta",void 0);r([h()],u.prototype,"radius",void 0);r([h()],u.prototype,"overrideCloneAlphaBetaRadius",void 0);r([U("target")],u.prototype,"_target",void 0);r([H("targetHost")],u.prototype,"_targetHost",void 0);r([h()],u.prototype,"inertialAlphaOffset",void 0);r([h()],u.prototype,"inertialBetaOffset",void 0);r([h()],u.prototype,"inertialRadiusOffset",void 0);r([h()],u.prototype,"lowerAlphaLimit",void 0);r([h()],u.prototype,"upperAlphaLimit",void 0);r([h()],u.prototype,"lowerBetaLimit",void 0);r([h()],u.prototype,"upperBetaLimit",void 0);r([h()],u.prototype,"lowerRadiusLimit",void 0);r([h()],u.prototype,"upperRadiusLimit",void 0);r([h()],u.prototype,"lowerTargetYLimit",void 0);r([h()],u.prototype,"inertialPanningX",void 0);r([h()],u.prototype,"inertialPanningY",void 0);r([h()],u.prototype,"pinchToPanMaxDistance",void 0);r([h()],u.prototype,"panningDistanceLimit",void 0);r([U()],u.prototype,"panningOriginTarget",void 0);r([h()],u.prototype,"panningInertia",void 0);r([h()],u.prototype,"zoomToMouseLocation",null);r([h()],u.prototype,"zoomOnFactor",void 0);r([K()],u.prototype,"targetScreenOffset",void 0);r([h()],u.prototype,"allowUpsideDown",void 0);r([h()],u.prototype,"useInputToRestoreState",void 0);r([h()],u.prototype,"restoreStateInterpolationFactor",void 0);G("BABYLON.ArcRotateCamera",u);export{u as ArcRotateCamera,ot as ComputeAlpha,rt as ComputeBeta};
|
assets/assetContainer-DOnbxwKX.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{A as S,T as _,C as b,M as I}from"./mesh-Fj-9677A.js";import{L as x}from"./bufferUtils-DTRdUD8L.js";import{E as A}from"./math.vector-C1xyPDEl.js";import{I as O}from"./instancedMesh-Cz-e1Hca.js";import{L as k}from"./light-DT53MGnW.js";import{T as C}from"./tools-D01N7ptR.js";import{T as w}from"./decorators.serialization-C7d7ykGG.js";class q{constructor(){this.rootNodes=[],this.cameras=[],this.lights=[],this.meshes=[],this.skeletons=[],this.particleSystems=[],this.animations=[],this.animationGroups=[],this.multiMaterials=[],this.materials=[],this.morphTargetManagers=[],this.geometries=[],this.transformNodes=[],this.actionManagers=[],this.textures=[],this._environmentTexture=null,this.postProcesses=[],this.sounds=null,this.effectLayers=[],this.layers=[],this.reflectionProbes=[],this.spriteManagers=[]}get environmentTexture(){return this._environmentTexture}set environmentTexture(e){this._environmentTexture=e}getNodes(){let e=[];e=e.concat(this.meshes),e=e.concat(this.lights),e=e.concat(this.cameras),e=e.concat(this.transformNodes);for(const t of this.skeletons)e=e.concat(t.bones);return e}}class B extends q{}class G{constructor(){this.rootNodes=[],this.skeletons=[],this.animationGroups=[]}dispose(){const e=this.rootNodes;for(const o of e)o.dispose();e.length=0;const t=this.skeletons;for(const o of t)o.dispose();t.length=0;const s=this.animationGroups;for(const o of s)o.dispose();s.length=0}}class W extends q{constructor(e){super(),this._wasAddedToScene=!1,e=e||A.LastCreatedScene,e&&(this.scene=e,this.proceduralTextures=[],e.onDisposeObservable.add(()=>{this._wasAddedToScene||this.dispose()}),this._onContextRestoredObserver=e.getEngine().onContextRestoredObservable.add(()=>{for(const t of this.geometries)t._rebuild();for(const t of this.meshes)t._rebuild();for(const t of this.particleSystems)t.rebuild();for(const t of this.textures)t._rebuild();for(const t of this.spriteManagers)t.rebuild()}))}_topologicalSort(e){const t=new Map;for(const c of e)t.set(c.uniqueId,c);const s={dependsOn:new Map,dependedBy:new Map};for(const c of e){const i=c.uniqueId;s.dependsOn.set(i,new Set),s.dependedBy.set(i,new Set)}for(const c of e){const i=c.uniqueId,a=s.dependsOn.get(i);if(c instanceof O){const m=c.sourceMesh;t.has(m.uniqueId)&&(a.add(m.uniqueId),s.dependedBy.get(m.uniqueId).add(i))}const p=s.dependedBy.get(i);for(const m of c.getDescendants()){const T=m.uniqueId;t.has(T)&&(p.add(T),s.dependsOn.get(T).add(i))}}const o=[],h=[];for(const c of e){const i=c.uniqueId;s.dependsOn.get(i).size===0&&(h.push(c),t.delete(i))}const l=h;for(;l.length>0;){const c=l.shift();o.push(c);const i=s.dependedBy.get(c.uniqueId);for(const a of Array.from(i.values())){const p=s.dependsOn.get(a);p.delete(c.uniqueId),p.size===0&&t.get(a)&&(l.push(t.get(a)),t.delete(a))}}return t.size>0&&(x.Error("SceneSerializer._topologicalSort: There were unvisited nodes:"),t.forEach(c=>{x.Error(c.name)})),o}_addNodeAndDescendantsToList(e,t,s,o){if(!(!s||o&&!o(s)||t.has(s.uniqueId))){e.push(s),t.add(s.uniqueId);for(const h of s.getDescendants(!0))this._addNodeAndDescendantsToList(e,t,h,o)}}_isNodeInContainer(e){return e instanceof S&&this.meshes.indexOf(e)!==-1||e instanceof _&&this.transformNodes.indexOf(e)!==-1||e instanceof k&&this.lights.indexOf(e)!==-1||e instanceof b&&this.cameras.indexOf(e)!==-1}_isValidHierarchy(){for(const e of this.meshes)if(e.parent&&!this._isNodeInContainer(e.parent))return x.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.transformNodes)if(e.parent&&!this._isNodeInContainer(e.parent))return x.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.lights)if(e.parent&&!this._isNodeInContainer(e.parent))return x.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;for(const e of this.cameras)if(e.parent&&!this._isNodeInContainer(e.parent))return x.Warn(`Node ${e.name} has a parent that is not in the container.`),!1;return!0}instantiateModelsToScene(e,t=!1,s){this._isValidHierarchy()||C.Warn("SceneSerializer.InstantiateModelsToScene: The Asset Container hierarchy is not valid.");const o={},h={},l=new G,c=[],i=[],a={doNotInstantiate:!0,...s},p=(n,r)=>{if(o[n.uniqueId]=r.uniqueId,h[r.uniqueId]=r,e&&(r.name=e(n.name)),r instanceof I){const f=r;if(f.morphTargetManager){const d=n.morphTargetManager;f.morphTargetManager=d.clone();for(let u=0;u<d.numTargets;u++){const N=d.getTarget(u),g=f.morphTargetManager.getTarget(u);o[N.uniqueId]=g.uniqueId,h[g.uniqueId]=g}}}},m=[],T=new Set;for(const n of this.transformNodes)n.parent===null&&this._addNodeAndDescendantsToList(m,T,n,a.predicate);for(const n of this.meshes)n.parent===null&&this._addNodeAndDescendantsToList(m,T,n,a.predicate);const M=this._topologicalSort(m),v=(n,r)=>{if(p(n,r),n.parent){const f=o[n.parent.uniqueId],d=h[f];d?r.parent=d:r.parent=n.parent}if(r.position&&n.position&&r.position.copyFrom(n.position),r.rotationQuaternion&&n.rotationQuaternion&&r.rotationQuaternion.copyFrom(n.rotationQuaternion),r.rotation&&n.rotation&&r.rotation.copyFrom(n.rotation),r.scaling&&n.scaling&&r.scaling.copyFrom(n.scaling),r.material){const f=r;if(f.material)if(t){const d=n.material;if(i.indexOf(d)===-1){let u=d.clone(e?e(d.name):"Clone of "+d.name);if(i.push(d),o[d.uniqueId]=u.uniqueId,h[u.uniqueId]=u,d.getClassName()==="MultiMaterial"){const N=d;for(const g of N.subMaterials)g&&(u=g.clone(e?e(g.name):"Clone of "+g.name),i.push(g),o[g.uniqueId]=u.uniqueId,h[u.uniqueId]=u);N.subMaterials=N.subMaterials.map(g=>g&&h[o[g.uniqueId]])}}f.getClassName()!=="InstancedMesh"&&(f.material=h[o[d.uniqueId]])}else f.material.getClassName()==="MultiMaterial"?this.scene.multiMaterials.indexOf(f.material)===-1&&this.scene.addMultiMaterial(f.material):this.scene.materials.indexOf(f.material)===-1&&this.scene.addMaterial(f.material)}r.parent===null&&l.rootNodes.push(r)};for(const n of M)if(n.getClassName()==="InstancedMesh"){const r=n,f=r.sourceMesh,d=o[f.uniqueId],N=(typeof d=="number"?h[d]:f).createInstance(r.name);v(r,N)}else{let r=!0;n.getClassName()==="TransformNode"||n.getClassName()==="Node"||n.skeleton||!n.getTotalVertices||n.getTotalVertices()===0?r=!1:a.doNotInstantiate&&(typeof a.doNotInstantiate=="function"?r=!a.doNotInstantiate(n):r=!a.doNotInstantiate);const f=r?n.createInstance(`instance of ${n.name}`):n.clone(`Clone of ${n.name}`,null,!0);if(!f)throw new Error(`Could not clone or instantiate node on Asset Container ${n.name}`);v(n,f)}for(const n of this.skeletons){if(a.predicate&&!a.predicate(n))continue;const r=n.clone(e?e(n.name):"Clone of "+n.name);for(const f of this.meshes)if(f.skeleton===n&&!f.isAnInstance){const d=h[o[f.uniqueId]];if(!d||d.isAnInstance||(d.skeleton=r,c.indexOf(r)!==-1))continue;c.push(r);for(const u of r.bones)u._linkedTransformNode&&(u._linkedTransformNode=h[o[u._linkedTransformNode.uniqueId]])}l.skeletons.push(r)}for(const n of this.animationGroups){if(a.predicate&&!a.predicate(n))continue;const r=n.clone(e?e(n.name):"Clone of "+n.name,f=>h[o[f.uniqueId]]||f);l.animationGroups.push(r)}return l}addAllToScene(){if(!this._wasAddedToScene){this._isValidHierarchy()||C.Warn("SceneSerializer.addAllToScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!0,this.addToScene(null),this.environmentTexture&&(this.scene.environmentTexture=this.environmentTexture);for(const e of this.scene._serializableComponents)e.addFromContainer(this);this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null}}addToScene(e=null){const t=[];for(const s of this.cameras)e&&!e(s)||(this.scene.addCamera(s),t.push(s));for(const s of this.lights)e&&!e(s)||(this.scene.addLight(s),t.push(s));for(const s of this.meshes)e&&!e(s)||(this.scene.addMesh(s),t.push(s));for(const s of this.skeletons)e&&!e(s)||this.scene.addSkeleton(s);for(const s of this.animations)e&&!e(s)||this.scene.addAnimation(s);for(const s of this.animationGroups)e&&!e(s)||this.scene.addAnimationGroup(s);for(const s of this.multiMaterials)e&&!e(s)||this.scene.addMultiMaterial(s);for(const s of this.materials)e&&!e(s)||this.scene.addMaterial(s);for(const s of this.morphTargetManagers)e&&!e(s)||this.scene.addMorphTargetManager(s);for(const s of this.geometries)e&&!e(s)||this.scene.addGeometry(s);for(const s of this.transformNodes)e&&!e(s)||(this.scene.addTransformNode(s),t.push(s));for(const s of this.actionManagers)e&&!e(s)||this.scene.addActionManager(s);for(const s of this.textures)e&&!e(s)||this.scene.addTexture(s);for(const s of this.reflectionProbes)e&&!e(s)||this.scene.addReflectionProbe(s);for(const s of this.spriteManagers)e&&!e(s)||(this.scene.spriteManagers||(this.scene.spriteManagers=[]),this.scene.spriteManagers.push(s));if(t.length){const s=new Set(this.scene.meshes);for(const o of this.scene.lights)s.add(o);for(const o of this.scene.cameras)s.add(o);for(const o of this.scene.transformNodes)s.add(o);for(const o of this.skeletons)for(const h of o.bones)s.add(h);for(const o of t)o.parent&&!s.has(o.parent)&&(o.setParent?o.setParent(null):o.parent=null)}}removeAllFromScene(){this._isValidHierarchy()||C.Warn("SceneSerializer.removeAllFromScene: The Asset Container hierarchy is not valid."),this._wasAddedToScene=!1,this.removeFromScene(null),this.environmentTexture===this.scene.environmentTexture&&(this.scene.environmentTexture=null);for(const e of this.scene._serializableComponents)e.removeFromContainer(this)}removeFromScene(e=null){for(const t of this.cameras)e&&!e(t)||this.scene.removeCamera(t);for(const t of this.lights)e&&!e(t)||this.scene.removeLight(t);for(const t of this.meshes)e&&!e(t)||this.scene.removeMesh(t,!0);for(const t of this.skeletons)e&&!e(t)||this.scene.removeSkeleton(t);for(const t of this.animations)e&&!e(t)||this.scene.removeAnimation(t);for(const t of this.animationGroups)e&&!e(t)||this.scene.removeAnimationGroup(t);for(const t of this.multiMaterials)e&&!e(t)||this.scene.removeMultiMaterial(t);for(const t of this.materials)e&&!e(t)||this.scene.removeMaterial(t);for(const t of this.morphTargetManagers)e&&!e(t)||this.scene.removeMorphTargetManager(t);for(const t of this.geometries)e&&!e(t)||this.scene.removeGeometry(t);for(const t of this.transformNodes)e&&!e(t)||this.scene.removeTransformNode(t);for(const t of this.actionManagers)e&&!e(t)||this.scene.removeActionManager(t);for(const t of this.textures)e&&!e(t)||this.scene.removeTexture(t);for(const t of this.reflectionProbes)e&&!e(t)||this.scene.removeReflectionProbe(t);for(const t of this.spriteManagers)if(!(e&&!e(t))&&this.scene.spriteManagers){const s=this.scene.spriteManagers.indexOf(t);s!==-1&&this.scene.spriteManagers.splice(s,1)}}dispose(){const e=this.cameras.slice(0);for(const n of e)n.dispose();this.cameras.length=0;const t=this.lights.slice(0);for(const n of t)n.dispose();this.lights.length=0;const s=this.meshes.slice(0);for(const n of s)n.dispose();this.meshes.length=0;const o=this.skeletons.slice(0);for(const n of o)n.dispose();this.skeletons.length=0;const h=this.animationGroups.slice(0);for(const n of h)n.dispose();this.animationGroups.length=0;const l=this.multiMaterials.slice(0);for(const n of l)n.dispose();this.multiMaterials.length=0;const c=this.materials.slice(0);for(const n of c)n.dispose();this.materials.length=0;const i=this.geometries.slice(0);for(const n of i)n.dispose();this.geometries.length=0;const a=this.transformNodes.slice(0);for(const n of a)n.dispose();this.transformNodes.length=0;const p=this.actionManagers.slice(0);for(const n of p)n.dispose();this.actionManagers.length=0;const m=this.textures.slice(0);for(const n of m)n.dispose();this.textures.length=0;const T=this.reflectionProbes.slice(0);for(const n of T)n.dispose();this.reflectionProbes.length=0;const M=this.morphTargetManagers.slice(0);for(const n of M)n.dispose();this.morphTargetManagers.length=0;const v=this.spriteManagers.slice(0);for(const n of v)n.dispose();this.spriteManagers.length=0,this.environmentTexture&&(this.environmentTexture.dispose(),this.environmentTexture=null);for(const n of this.scene._serializableComponents)n.removeFromContainer(this,!0);this._onContextRestoredObserver&&(this.scene.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver),this._onContextRestoredObserver=null)}_moveAssets(e,t,s){if(!(!e||!t))for(const o of e){let h=!0;if(s){for(const l of s)if(o===l){h=!1;break}}h&&(t.push(o),o._parentContainer=this)}}moveAllFromScene(e){this._wasAddedToScene=!1,e===void 0&&(e=new B);for(const t in this)Object.prototype.hasOwnProperty.call(this,t)&&(this[t]=this[t]||(t==="_environmentTexture"?null:[]),this._moveAssets(this.scene[t],this[t],e[t]));this.environmentTexture=this.scene.environmentTexture,this.removeAllFromScene()}createRootMesh(){const e=new I("assetContainerRootMesh",this.scene);for(const t of this.meshes)t.parent||e.addChild(t);return this.meshes.unshift(e),e}mergeAnimationsTo(e=A.LastCreatedScene,t,s=null){if(!e)return x.Error("No scene available to merge animations to"),[];const o=s||(i=>{let a;const p=i.animations.length?i.animations[0].targetProperty:"",m=i.name.split(".").join("").split("_primitive")[0];switch(p){case"position":case"rotationQuaternion":a=e.getTransformNodeByName(i.name)||e.getTransformNodeByName(m);break;case"influence":a=e.getMorphTargetByName(i.name)||e.getMorphTargetByName(m);break;default:a=e.getNodeByName(i.name)||e.getNodeByName(m)}return a}),h=this.getNodes();for(const i of h){const a=o(i);if(a!==null){for(const p of i.animations){const m=a.animations.filter(T=>T.targetProperty===p.targetProperty);for(const T of m){const M=a.animations.indexOf(T,0);M>-1&&a.animations.splice(M,1)}}a.animations=a.animations.concat(i.animations)}}const l=[],c=this.animationGroups.slice();for(const i of c){l.push(i.clone(i.name,o));for(const a of i.animatables)a.stop()}for(const i of t){const a=o(i.target);a&&(e.beginAnimation(a,i.fromFrame,i.toFrame,i.loopAnimation,i.speedRatio,i.onAnimationEnd?i.onAnimationEnd:void 0,void 0,!0,void 0,i.onAnimationLoop?i.onAnimationLoop:void 0),e.stopAnimation(i.target))}return l}populateRootNodes(){this.rootNodes.length=0;for(const e of this.meshes)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e);for(const e of this.transformNodes)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e);for(const e of this.lights)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e);for(const e of this.cameras)!e.parent&&this.rootNodes.indexOf(e)===-1&&this.rootNodes.push(e)}addAllAssetsToContainer(e){if(!e)return;const t=[],s=new Set;for(t.push(e);t.length>0;){const o=t.pop();if(o instanceof I?(o.geometry&&this.geometries.indexOf(o.geometry)===-1&&this.geometries.push(o.geometry),this.meshes.push(o)):o instanceof O?this.meshes.push(o):o instanceof _?this.transformNodes.push(o):o instanceof k?this.lights.push(o):o instanceof b&&this.cameras.push(o),o instanceof S){if(o.material&&this.materials.indexOf(o.material)===-1){this.materials.push(o.material);for(const h of o.material.getActiveTextures())this.textures.indexOf(h)===-1&&this.textures.push(h)}o.skeleton&&this.skeletons.indexOf(o.skeleton)===-1&&this.skeletons.push(o.skeleton),o.morphTargetManager&&this.morphTargetManagers.indexOf(o.morphTargetManager)===-1&&this.morphTargetManagers.push(o.morphTargetManager)}for(const h of o.getChildren())s.has(h)||t.push(h);s.add(o)}this.populateRootNodes()}_getByTags(e,t,s){if(t===void 0)return e;const o=[];for(const h in e){const l=e[h];w&&w.MatchesQuery(l,t)&&(!s||s(l))&&o.push(l)}return o}getMeshesByTags(e,t){return this._getByTags(this.meshes,e,t)}getCamerasByTags(e,t){return this._getByTags(this.cameras,e,t)}getLightsByTags(e,t){return this._getByTags(this.lights,e,t)}getMaterialsByTags(e,t){return this._getByTags(this.materials,e,t).concat(this._getByTags(this.multiMaterials,e,t))}getTransformNodesByTags(e,t){return this._getByTags(this.transformNodes,e,t)}}export{W as A};
|
assets/axesViewer-McvgY2Ig.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{M as k,V as h,O as R,T as s,E as L,Q as F}from"./math.vector-C1xyPDEl.js";import{StandardMaterial as A}from"./standardMaterial-bHoIzJS_.js";import{M as E,C as U,T as V}from"./mesh-Fj-9677A.js";import{C as G,a as I}from"./planeBuilder-DFAEUdSV.js";import{S as Q}from"./scene-gn_hoGMy.js";import{P as m,a as S}from"./deviceInputEvents-BTza-zoR.js";import{R as z}from"./ray-BIadP2Df.js";import{E as H}from"./math.scalar.functions-DkeaWAWz.js";import{P as K}from"./sceneComponent-Dflhczui.js";import{HemisphericLight as Y}from"./hemisphericLight-DUUZAi58.js";import{Color3 as O}from"./math.color-CzLaKyb6.js";import{L as w}from"./light-DT53MGnW.js";import"./index-Bx1QoKVU.js";import"./bufferUtils-DTRdUD8L.js";import"./smartArray-CO6iJ0u5.js";import"./buffer-DqKlo1ts.js";import"./dataBuffer-CgoqiUzT.js";import"./imageProcessing-2WziWti-.js";import"./material-CrEsrP1R.js";import"./tools-D01N7ptR.js";import"./decorators.serialization-C7d7ykGG.js";import"./subMesh-UWDo5wjI.js";import"./drawWrapper-CZVk0xN-.js";import"./lightConstants-B1TSTh-k.js";import"./math.plane-Ce_75-g5.js";import"./texture-BEqhDl5Y.js";import"./baseTexture-CgAggsey.js";import"./drawWrapper.functions-Dzz0ghog.js";import"./pushMaterial-B8MG1fVH.js";import"./material.detailMapConfiguration-D1Pl6X8T.js";import"./mesh.vertexData-Cr3zcPIw.js";import"./node-C-Iu0ALa.js";import"./math.viewport-CgkTt1RS.js";import"./sceneLoaderFlags-wywyb9ml.js";import"./math.axis-Ck7JfPPj.js";import"./renderingManager-CiY2OUrf.js";import"./perfCounter-DusmGz8t.js";class l{static _RemoveAndStorePivotPoint(t){t&&l._PivotCached===0&&(t.getPivotPointToRef(l._OldPivotPoint),l._PivotPostMultiplyPivotMatrix=t._postMultiplyPivotMatrix,l._OldPivotPoint.equalsToFloats(0,0,0)||(t.setPivotMatrix(k.IdentityReadOnly),l._OldPivotPoint.subtractToRef(t.getPivotPoint(),l._PivotTranslation),l._PivotTmpVector.copyFromFloats(1,1,1),l._PivotTmpVector.subtractInPlace(t.scaling),l._PivotTmpVector.multiplyInPlace(l._PivotTranslation),t.position.addInPlace(l._PivotTmpVector))),l._PivotCached++}static _RestorePivotPoint(t){t&&!l._OldPivotPoint.equalsToFloats(0,0,0)&&l._PivotCached===1&&(t.setPivotPoint(l._OldPivotPoint),t._postMultiplyPivotMatrix=l._PivotPostMultiplyPivotMatrix,l._PivotTmpVector.copyFromFloats(1,1,1),l._PivotTmpVector.subtractInPlace(t.scaling),l._PivotTmpVector.multiplyInPlace(l._PivotTranslation),t.position.subtractInPlace(l._PivotTmpVector)),this._PivotCached--}}l._PivotCached=0;l._OldPivotPoint=new h;l._PivotTranslation=new h;l._PivotTmpVector=new h;l._PivotPostMultiplyPivotMatrix=!1;class f{get currentDraggingPointerID(){return this.currentDraggingPointerId}set currentDraggingPointerID(t){this.currentDraggingPointerId=t}set enabled(t){t!=this._enabled&&this.onEnabledObservable.notifyObservers(t),this._enabled=t}get enabled(){return this._enabled}get options(){return this._options}set options(t){this._options=t}constructor(t){this._useAlternatePickedPointAboveMaxDragAngleDragSpeed=-1.1,this._activeDragButton=-1,this.maxDragAngle=0,this.dragButtons=[0,1,2],this._useAlternatePickedPointAboveMaxDragAngle=!1,this.currentDraggingPointerId=-1,this.dragging=!1,this.dragDeltaRatio=.2,this.updateDragPlane=!0,this._debugMode=!1,this._moving=!1,this.onDragObservable=new R,this.onDragStartObservable=new R,this.onDragEndObservable=new R,this.onEnabledObservable=new R,this.moveAttached=!0,this._enabled=!0,this.startAndReleaseDragOnPointerEvents=!0,this.detachCameraControls=!0,this.useObjectOrientationForDragging=!0,this.allowOtherButtonsDuringDrag=!1,this.validateDrag=a=>!0,this._tmpVector=new h(0,0,0),this._alternatePickedPoint=new h(0,0,0),this._worldDragAxis=new h(0,0,0),this._targetPosition=new h(0,0,0),this._attachedToElement=!1,this._startDragRay=new z(new h,new h),this._lastPointerRay={},this._dragDelta=new h,this._pointA=new h(0,0,0),this._pointC=new h(0,0,0),this._localAxis=new h(0,0,0),this._lookAt=new h(0,0,0),this._options=t||{};let i=0;if(this._options.dragAxis&&i++,this._options.dragPlaneNormal&&i++,i>1)throw"Multiple drag modes specified in dragBehavior options. Only one expected"}get name(){return"PointerDrag"}init(){}attach(t,i){this._scene=t.getScene(),t.isNearGrabbable=!0,this.attachedNode=t,f._PlaneScene||(this._debugMode?f._PlaneScene=this._scene:(f._PlaneScene=new Q(this._scene.getEngine(),{virtual:!0}),f._PlaneScene.detachControl(),this._scene.onDisposeObservable.addOnce(()=>{f._PlaneScene.dispose(),f._PlaneScene=null}))),this._dragPlane=G("pointerDragPlane",{size:this._debugMode?1:1e4,updatable:!1,sideOrientation:E.DOUBLESIDE},f._PlaneScene),this.lastDragPosition=new h(0,0,0);const a=i||(e=>this.attachedNode==e||e.isDescendantOf(this.attachedNode));this._pointerObserver=this._scene.onPointerObservable.add(e=>{if(!this.enabled){this._attachedToElement&&this.releaseDrag();return}if(this.dragging&&this.currentDraggingPointerId==e.event.pointerId&&e.event.button!==-1&&e.event.button!==this._activeDragButton&&!this.allowOtherButtonsDuringDrag){this.releaseDrag();return}if(e.type==m.POINTERDOWN)this.startAndReleaseDragOnPointerEvents&&!this.dragging&&e.pickInfo&&e.pickInfo.hit&&e.pickInfo.pickedMesh&&e.pickInfo.pickedPoint&&e.pickInfo.ray&&a(e.pickInfo.pickedMesh)&&this._activeDragButton===-1&&this.dragButtons.indexOf(e.event.button)!==-1&&(this._activeDragButton=e.event.button,this._activePointerInfo=e,this._startDrag(e.event.pointerId,e.pickInfo.ray,e.pickInfo.pickedPoint));else if(e.type==m.POINTERUP)this.startAndReleaseDragOnPointerEvents&&this.currentDraggingPointerId==e.event.pointerId&&(this._activeDragButton===e.event.button||this._activeDragButton===-1)&&this.releaseDrag();else if(e.type==m.POINTERMOVE){const r=e.event.pointerId;if(this.currentDraggingPointerId===f._AnyMouseId&&r!==f._AnyMouseId){const c=e.event;(c.pointerType==="mouse"||!this._scene.getEngine().hostInformation.isMobile&&c instanceof MouseEvent)&&(this._lastPointerRay[this.currentDraggingPointerId]&&(this._lastPointerRay[r]=this._lastPointerRay[this.currentDraggingPointerId],delete this._lastPointerRay[this.currentDraggingPointerId]),this.currentDraggingPointerId=r)}this._lastPointerRay[r]||(this._lastPointerRay[r]=new z(new h,new h)),e.pickInfo&&e.pickInfo.ray&&(this._lastPointerRay[r].origin.copyFrom(e.pickInfo.ray.origin),this._lastPointerRay[r].direction.copyFrom(e.pickInfo.ray.direction),this.currentDraggingPointerId==r&&this.dragging&&this._moveDrag(e.pickInfo.ray))}}),this._beforeRenderObserver=this._scene.onBeforeRenderObservable.add(()=>{if(this._moving&&this.moveAttached){let e=!1;l._RemoveAndStorePivotPoint(this.attachedNode),this._targetPosition.subtractToRef(this.attachedNode.absolutePosition,this._tmpVector),this._tmpVector.scaleInPlace(this.dragDeltaRatio),this.attachedNode.getAbsolutePosition().addToRef(this._tmpVector,this._tmpVector),this.validateDrag(this._tmpVector)&&(this.attachedNode.setAbsolutePosition(this._tmpVector),e=!0),l._RestorePivotPoint(this.attachedNode),e&&this.attachedNode.computeWorldMatrix()}})}releaseDrag(){if(this.dragging&&(this.dragging=!1,this.onDragEndObservable.notifyObservers({dragPlanePoint:this.lastDragPosition,pointerId:this.currentDraggingPointerId,pointerInfo:this._activePointerInfo})),this.currentDraggingPointerId=-1,this._activeDragButton=-1,this._activePointerInfo=null,this._moving=!1,this.detachCameraControls&&this._attachedToElement&&this._scene.activeCamera&&!this._scene.activeCamera.leftCamera){if(this._scene.activeCamera.getClassName()==="ArcRotateCamera"){const t=this._scene.activeCamera;t.attachControl(t.inputs?t.inputs.noPreventDefault:!0,t._useCtrlForPanning,t._panningMouseButton)}else this._scene.activeCamera.attachControl(this._scene.activeCamera.inputs?this._scene.activeCamera.inputs.noPreventDefault:!0);this._attachedToElement=!1}}startDrag(t=f._AnyMouseId,i,a){this._startDrag(t,i,a);let e=this._lastPointerRay[t];t===f._AnyMouseId&&(e=this._lastPointerRay[Object.keys(this._lastPointerRay)[0]]),e&&this._moveDrag(e)}_startDrag(t,i,a){if(!this._scene.activeCamera||this.dragging||!this.attachedNode)return;l._RemoveAndStorePivotPoint(this.attachedNode),i?(this._startDragRay.direction.copyFrom(i.direction),this._startDragRay.origin.copyFrom(i.origin)):(this._startDragRay.origin.copyFrom(this._scene.activeCamera.position),this.attachedNode.getWorldMatrix().getTranslationToRef(this._tmpVector),this._tmpVector.subtractToRef(this._scene.activeCamera.position,this._startDragRay.direction)),this._updateDragPlanePosition(this._startDragRay,a||this._tmpVector);const e=this._pickWithRayOnDragPlane(this._startDragRay);e?(this.dragging=!0,this.currentDraggingPointerId=t,this.lastDragPosition.copyFrom(e),this.onDragStartObservable.notifyObservers({dragPlanePoint:e,pointerId:this.currentDraggingPointerId,pointerInfo:this._activePointerInfo}),this._targetPosition.copyFrom(this.attachedNode.getAbsolutePosition()),this.detachCameraControls&&this._scene.activeCamera&&this._scene.activeCamera.inputs&&!this._scene.activeCamera.leftCamera&&(this._scene.activeCamera.inputs.attachedToElement?(this._scene.activeCamera.detachControl(),this._attachedToElement=!0):this._attachedToElement=!1)):this.releaseDrag(),l._RestorePivotPoint(this.attachedNode)}_moveDrag(t){this._moving=!0;const i=this._pickWithRayOnDragPlane(t);if(i){l._RemoveAndStorePivotPoint(this.attachedNode),this.updateDragPlane&&this._updateDragPlanePosition(t,i);let a;this._options.dragAxis?(this.useObjectOrientationForDragging?h.TransformCoordinatesToRef(this._options.dragAxis,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._worldDragAxis):this._worldDragAxis.copyFrom(this._options.dragAxis),i.subtractToRef(this.lastDragPosition,this._tmpVector),this.additionalTransformNode&&(this.additionalTransformNode.getWorldMatrix().invertToRef(s.Matrix[0]),h.TransformNormalToRef(this._worldDragAxis,s.Matrix[0],this._worldDragAxis)),this._worldDragAxis.normalize(),a=h.Dot(this._tmpVector,this._worldDragAxis),this._worldDragAxis.scaleToRef(a,this._dragDelta)):(a=this._dragDelta.length(),i.subtractToRef(this.lastDragPosition,this._dragDelta)),this._targetPosition.addInPlace(this._dragDelta),this.onDragObservable.notifyObservers({dragDistance:a,delta:this._dragDelta,dragPlanePoint:i,dragPlaneNormal:this._dragPlane.forward,pointerId:this.currentDraggingPointerId,pointerInfo:this._activePointerInfo}),this.lastDragPosition.copyFrom(i),l._RestorePivotPoint(this.attachedNode)}}_pickWithRayOnDragPlane(t){if(!t)return null;let i=Math.acos(h.Dot(this._dragPlane.forward,t.direction));if(i>Math.PI/2&&(i=Math.PI-i),this.maxDragAngle>0&&i>this.maxDragAngle)if(this._useAlternatePickedPointAboveMaxDragAngle){this._tmpVector.copyFrom(t.direction),this.attachedNode.absolutePosition.subtractToRef(t.origin,this._alternatePickedPoint),this._alternatePickedPoint.normalize(),this._alternatePickedPoint.scaleInPlace(this._useAlternatePickedPointAboveMaxDragAngleDragSpeed*h.Dot(this._alternatePickedPoint,this._tmpVector)),this._tmpVector.addInPlace(this._alternatePickedPoint);const g=h.Dot(this._dragPlane.forward,this._tmpVector);return this._dragPlane.forward.scaleToRef(-g,this._alternatePickedPoint),this._alternatePickedPoint.addInPlace(this._tmpVector),this._alternatePickedPoint.addInPlace(this.attachedNode.absolutePosition),this._alternatePickedPoint}else return null;const a=this._dragPlane.forward,e=this._dragPlane.position,r=t.direction.dot(a);if(Math.abs(r)<H)return null;e.subtractToRef(t.origin,s.Vector3[0]);const c=s.Vector3[0].dot(a)/r;return c<0?null:(t.direction.scaleToRef(c,s.Vector3[0]),t.origin.add(s.Vector3[0]))}_updateDragPlanePosition(t,i){this._pointA.copyFrom(i),this._options.dragAxis?(this.useObjectOrientationForDragging?h.TransformCoordinatesToRef(this._options.dragAxis,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragAxis),t.origin.subtractToRef(this._pointA,this._pointC),this._pointC.normalize(),Math.abs(h.Dot(this._localAxis,this._pointC))>.999?Math.abs(h.Dot(h.UpReadOnly,this._pointC))>.999?this._lookAt.copyFrom(h.Right()):this._lookAt.copyFrom(h.UpReadOnly):(h.CrossToRef(this._localAxis,this._pointC,this._lookAt),h.CrossToRef(this._localAxis,this._lookAt,this._lookAt),this._lookAt.normalize()),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._lookAt,this._lookAt),this._dragPlane.lookAt(this._lookAt)):this._options.dragPlaneNormal?(this.useObjectOrientationForDragging?h.TransformCoordinatesToRef(this._options.dragPlaneNormal,this.attachedNode.getWorldMatrix().getRotationMatrix(),this._localAxis):this._localAxis.copyFrom(this._options.dragPlaneNormal),this._dragPlane.position.copyFrom(this._pointA),this._pointA.addToRef(this._localAxis,this._lookAt),this._dragPlane.lookAt(this._lookAt)):(this._scene.activeCamera&&this._scene.activeCamera.getForwardRay().direction.normalizeToRef(this._localAxis),this._dragPlane.position.copyFrom(this._pointA),this._dragPlane.lookAt(this._pointA.add(this._localAxis))),this._dragPlane.position.copyFrom(this.attachedNode.getAbsolutePosition()),this._dragPlane.computeWorldMatrix(!0)}detach(){this._lastPointerRay={},this.attachedNode&&(this.attachedNode.isNearGrabbable=!1),this._pointerObserver&&this._scene.onPointerObservable.remove(this._pointerObserver),this._beforeRenderObserver&&this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver),this._dragPlane&&this._dragPlane.dispose(),this.releaseDrag()}}f._AnyMouseId=-2;class _{getRenderCamera(t){if(this._renderCamera)return this._renderCamera;{let i;return this.originalScene.activeCameras&&this.originalScene.activeCameras.length>1?i=this.originalScene.activeCameras[this.originalScene.activeCameras.length-1]:i=this.originalScene.activeCamera,t&&i&&i.isRigCamera?i.rigParent:i}}setRenderCamera(t){this._renderCamera=t}_getSharedGizmoLight(){return this._sharedGizmoLight||(this._sharedGizmoLight=new Y("shared gizmo light",new h(0,1,0),this.utilityLayerScene),this._sharedGizmoLight.intensity=2,this._sharedGizmoLight.groundColor=O.Gray()),this._sharedGizmoLight}static get DefaultUtilityLayer(){return _._DefaultUtilityLayer==null?_._CreateDefaultUtilityLayerFromScene(L.LastCreatedScene):_._DefaultUtilityLayer}static _CreateDefaultUtilityLayerFromScene(t){return _._DefaultUtilityLayer=new _(t),_._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(()=>{_._DefaultUtilityLayer=null}),_._DefaultUtilityLayer}static get DefaultKeepDepthUtilityLayer(){return _._DefaultKeepDepthUtilityLayer==null?_._CreateDefaultKeepUtilityLayerFromScene(L.LastCreatedScene):_._DefaultKeepDepthUtilityLayer}static _CreateDefaultKeepUtilityLayerFromScene(t){return _._DefaultKeepDepthUtilityLayer=new _(t),_._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil=!1,_._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(()=>{_._DefaultKeepDepthUtilityLayer=null}),_._DefaultKeepDepthUtilityLayer}constructor(t,i=!0,a=!1){this.originalScene=t,this.handleEvents=i,this._pointerCaptures={},this._lastPointerEvents={},this._sharedGizmoLight=null,this._renderCamera=null,this.pickUtilitySceneFirst=!0,this.shouldRender=!0,this.onlyCheckPointerDownEvents=!0,this.processAllEvents=!1,this.pickingEnabled=!0,this.onPointerOutObservable=new R,this.utilityLayerScene=new Q(t.getEngine(),{virtual:!0,useFloatingOrigin:t.floatingOriginMode}),this.utilityLayerScene.useRightHandedSystem=t.useRightHandedSystem,this.utilityLayerScene._allowPostProcessClearColor=!1,this.utilityLayerScene.postProcessesEnabled=!1,this.utilityLayerScene.detachControl(),i&&(this._originalPointerObserver=t.onPrePointerObservable.add(e=>{var g;if(!this.utilityLayerScene.activeCamera||!this.pickingEnabled||!this.processAllEvents&&e.type!==m.POINTERMOVE&&e.type!==m.POINTERUP&&e.type!==m.POINTERDOWN&&e.type!==m.POINTERDOUBLETAP)return;this.utilityLayerScene.pointerX=t.pointerX,this.utilityLayerScene.pointerY=t.pointerY;const r=e.event;if(t.isPointerCaptured(r.pointerId)){this._pointerCaptures[r.pointerId]=!1;return}const c=d=>{let n;if(e.nearInteractionPickingInfo)e.nearInteractionPickingInfo.pickedMesh.getScene()==d?n=e.nearInteractionPickingInfo:n=new K;else if(d!==this.utilityLayerScene&&e.originalPickingInfo)n=e.originalPickingInfo;else{let u=null;this._renderCamera&&(u=d._activeCamera,d._activeCamera=this._renderCamera,e.ray=null),n=e.ray?d.pickWithRay(e.ray):d.pick(t.pointerX,t.pointerY),u&&(d._activeCamera=u)}return n},o=c(this.utilityLayerScene);if(!e.ray&&o&&(e.ray=o.ray),(g=e.originalPickingInfo)!=null&&g.aimTransform&&o&&(o.aimTransform=e.originalPickingInfo.aimTransform,o.gripTransform=e.originalPickingInfo.gripTransform),this.utilityLayerScene.onPrePointerObservable.notifyObservers(e),this.onlyCheckPointerDownEvents&&e.type!=m.POINTERDOWN){e.skipOnPointerObservable||this.utilityLayerScene.onPointerObservable.notifyObservers(new S(e.type,e.event,o),e.type),e.type===m.POINTERUP&&this._pointerCaptures[r.pointerId]&&(this._pointerCaptures[r.pointerId]=!1);return}if(this.utilityLayerScene.autoClearDepthAndStencil||this.pickUtilitySceneFirst)o&&o.hit&&(e.skipOnPointerObservable||this.utilityLayerScene.onPointerObservable.notifyObservers(new S(e.type,e.event,o),e.type),e.skipOnPointerObservable=!0);else{const d=c(t),n=e.event;d&&o&&(o.distance===0&&d.pickedMesh?this.mainSceneTrackerPredicate&&this.mainSceneTrackerPredicate(d.pickedMesh)?(this._notifyObservers(e,d,n),e.skipOnPointerObservable=!0):e.type===m.POINTERDOWN?(this._pointerCaptures[n.pointerId]=!0,this._notifyObservers(e,d,n)):(e.type===m.POINTERMOVE||e.type===m.POINTERUP)&&(this._lastPointerEvents[n.pointerId]&&(this.onPointerOutObservable.notifyObservers(n.pointerId),delete this._lastPointerEvents[n.pointerId]),this._notifyObservers(e,d,n)):!this._pointerCaptures[n.pointerId]&&(o.distance<d.distance||d.distance===0)?(this._notifyObservers(e,o,n),e.skipOnPointerObservable||(e.skipOnPointerObservable=o.distance>0)):!this._pointerCaptures[n.pointerId]&&o.distance>=d.distance&&(this.mainSceneTrackerPredicate&&this.mainSceneTrackerPredicate(d.pickedMesh)?(this._notifyObservers(e,d,n),e.skipOnPointerObservable=!0):((e.type===m.POINTERMOVE||e.type===m.POINTERUP)&&this._lastPointerEvents[n.pointerId]&&(this.onPointerOutObservable.notifyObservers(n.pointerId),delete this._lastPointerEvents[n.pointerId]),this._notifyObservers(e,o,n))),e.type===m.POINTERUP&&this._pointerCaptures[n.pointerId]&&(this._pointerCaptures[n.pointerId]=!1))}}),this._originalPointerObserver&&t.onPrePointerObservable.makeObserverTopPriority(this._originalPointerObserver)),this.utilityLayerScene.autoClear=!1,a||(this._afterRenderObserver=this.originalScene.onAfterRenderCameraObservable.add(e=>{this.shouldRender&&e==this.getRenderCamera()&&this.render()})),this._sceneDisposeObserver=this.originalScene.onDisposeObservable.add(()=>{this.dispose()}),this._updateCamera()}_notifyObservers(t,i,a){t.skipOnPointerObservable||(this.utilityLayerScene.onPointerObservable.notifyObservers(new S(t.type,t.event,i),t.type),this._lastPointerEvents[a.pointerId]=!0)}render(){if(this._updateCamera(),this.utilityLayerScene.activeCamera){const t=this.utilityLayerScene.activeCamera.getScene(),i=this.utilityLayerScene.activeCamera;i._scene=this.utilityLayerScene,i.leftCamera&&(i.leftCamera._scene=this.utilityLayerScene),i.rightCamera&&(i.rightCamera._scene=this.utilityLayerScene),this.utilityLayerScene.render(!1),i._scene=t,i.leftCamera&&(i.leftCamera._scene=t),i.rightCamera&&(i.rightCamera._scene=t)}}dispose(){this.onPointerOutObservable.clear(),this._afterRenderObserver&&this.originalScene.onAfterCameraRenderObservable.remove(this._afterRenderObserver),this._sceneDisposeObserver&&this.originalScene.onDisposeObservable.remove(this._sceneDisposeObserver),this._originalPointerObserver&&this.originalScene.onPrePointerObservable.remove(this._originalPointerObserver),this.utilityLayerScene.dispose()}_updateCamera(){this.utilityLayerScene.cameraToUseForPointers=this.getRenderCamera(),this.utilityLayerScene.activeCamera=this.getRenderCamera()}}_._DefaultUtilityLayer=null;_._DefaultKeepDepthUtilityLayer=null;var B;(function(b){b[b.Origin=0]="Origin",b[b.Pivot=1]="Pivot"})(B||(B={}));var W;(function(b){b[b.World=0]="World",b[b.Local=1]="Local"})(W||(W={}));class y{set scaleRatio(t){this._scaleRatio=t}get scaleRatio(){return this._scaleRatio}get isHovered(){return this._isHovered}get attachedMesh(){return this._attachedMesh}set attachedMesh(t){this._attachedMesh=t,t&&(this._attachedNode=t),this._rootMesh.setEnabled(!!t),this._attachedNodeChanged(t)}get attachedNode(){return this._attachedNode}set attachedNode(t){this._attachedNode=t,this._attachedMesh=null,this._rootMesh.setEnabled(!!t),this._attachedNodeChanged(t)}setCustomMesh(t){if(t.getScene()!=this.gizmoLayer.utilityLayerScene)throw"When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";const i=this._rootMesh.getChildMeshes();for(const a of i)a.dispose();t.parent=this._rootMesh,this._customMeshSet=!0}get additionalTransformNode(){return this._additionalTransformNode}set additionalTransformNode(t){this._additionalTransformNode=t}set updateGizmoRotationToMatchAttachedMesh(t){this._updateGizmoRotationToMatchAttachedMesh=t}get updateGizmoRotationToMatchAttachedMesh(){return this._updateGizmoRotationToMatchAttachedMesh}set updateGizmoPositionToMatchAttachedMesh(t){this._updateGizmoPositionToMatchAttachedMesh=t}get updateGizmoPositionToMatchAttachedMesh(){return this._updateGizmoPositionToMatchAttachedMesh}set anchorPoint(t){this._anchorPoint=t}get anchorPoint(){return this._anchorPoint}set coordinatesMode(t){this._coordinatesMode=t;const i=t==1;this.updateGizmoRotationToMatchAttachedMesh=i,this.updateGizmoPositionToMatchAttachedMesh=!0}get coordinatesMode(){return this._coordinatesMode}set updateScale(t){this._updateScale=t}get updateScale(){return this._updateScale}_attachedNodeChanged(t){}constructor(t=_.DefaultUtilityLayer){this.gizmoLayer=t,this._attachedMesh=null,this._attachedNode=null,this._customRotationQuaternion=null,this._scaleRatio=1,this._isHovered=!1,this._customMeshSet=!1,this._updateGizmoRotationToMatchAttachedMesh=!0,this._updateGizmoPositionToMatchAttachedMesh=!0,this._anchorPoint=0,this._updateScale=!0,this._coordinatesMode=1,this._interactionsEnabled=!0,this._rightHandtoLeftHandMatrix=k.RotationY(Math.PI),this._rootMesh=new E("gizmoRootNode",t.utilityLayerScene),this._rootMesh.rotationQuaternion=F.Identity(),this._beforeRenderObserver=this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.add(()=>{this._update()})}get customRotationQuaternion(){return this._customRotationQuaternion}set customRotationQuaternion(t){this._customRotationQuaternion=t}_update(){if(this.attachedNode){let t=this.attachedNode;if(this.attachedMesh&&(t=this.attachedMesh),this.updateGizmoPositionToMatchAttachedMesh)if(this.anchorPoint==1&&t.getAbsolutePivotPoint){const i=t.getAbsolutePivotPoint();this._rootMesh.position.copyFrom(i)}else{const i=t.getWorldMatrix().getRow(3),a=i?i.toVector3():new h(0,0,0);this._rootMesh.position.copyFrom(a)}if(this.updateGizmoRotationToMatchAttachedMesh){const a=t._isMesh||t.getClassName()==="AbstractMesh"||t.getClassName()==="TransformNode"||t.getClassName()==="InstancedMesh"?t:void 0;t.getWorldMatrix().decompose(void 0,this._rootMesh.rotationQuaternion,void 0,y.PreserveScaling?a:void 0),this._rootMesh.rotationQuaternion.normalize()}else this._customRotationQuaternion?this._rootMesh.rotationQuaternion.copyFrom(this._customRotationQuaternion):this._rootMesh.rotationQuaternion.set(0,0,0,1);if(this.updateScale){const i=this.gizmoLayer.utilityLayerScene.activeCamera,a=i.globalPosition,e=s.Vector3[0];this._rootMesh.absolutePosition.subtractToRef(a,e);let r=this.scaleRatio;if(i.mode==U.ORTHOGRAPHIC_CAMERA){if(i.orthoTop&&i.orthoBottom){const c=i.orthoTop-i.orthoBottom;r*=c}}else{const c=i.getScene().useRightHandedSystem?h.RightHandedForwardReadOnly:h.LeftHandedForwardReadOnly,o=i.getDirection(c);r*=h.Dot(e,o)}if(this.additionalTransformNode){this.additionalTransformNode.getWorldMatrix().decompose(s.Vector3[1]);const c=Math.max(Math.abs(s.Vector3[1].x),Math.abs(s.Vector3[1].y),Math.abs(s.Vector3[1].z));r*=1/c}this._rootMesh.scaling.setAll(r),t._getWorldMatrixDeterminant()<0&&!y.PreserveScaling&&(this._rootMesh.scaling.y*=-1)}else this._rootMesh.scaling.setAll(this.scaleRatio)}this.additionalTransformNode&&(this._rootMesh.computeWorldMatrix(!0),this._rootMesh.getWorldMatrix().multiplyToRef(this.additionalTransformNode.getWorldMatrix(),s.Matrix[0]),s.Matrix[0].decompose(this._rootMesh.scaling,this._rootMesh.rotationQuaternion,this._rootMesh.position))}_handlePivotMatrixInverse(t,i,a){if(t.isUsingPivotMatrix()&&!t.isUsingPostMultiplyPivotMatrix()){t.getPivotMatrix().invertToRef(s.Matrix[5]),s.Matrix[5].multiplyToRef(i,a);return}a.copyFrom(i)}_matrixChanged(){if(this._attachedNode)if(this._attachedNode._isCamera){const t=this._attachedNode;let i,a;if(t.parent){const r=s.Matrix[1];t.parent._worldMatrix.invertToRef(r),this._attachedNode._worldMatrix.multiplyToRef(r,s.Matrix[0]),i=s.Matrix[0]}else i=this._attachedNode._worldMatrix;if(t.getScene().useRightHandedSystem?(this._rightHandtoLeftHandMatrix.multiplyToRef(i,s.Matrix[1]),a=s.Matrix[1]):a=i,a.decompose(s.Vector3[1],s.Quaternion[0],s.Vector3[0]),this._attachedNode.getClassName()==="FreeCamera"||this._attachedNode.getClassName()==="FlyCamera"||this._attachedNode.getClassName()==="ArcFollowCamera"||this._attachedNode.getClassName()==="TargetCamera"||this._attachedNode.getClassName()==="TouchCamera"||this._attachedNode.getClassName()==="UniversalCamera"){const r=this._attachedNode;r.rotation=s.Quaternion[0].toEulerAngles(),r.rotationQuaternion&&(r.rotationQuaternion.copyFrom(s.Quaternion[0]),r.rotationQuaternion.normalize())}t.position.copyFrom(s.Vector3[0])}else if(this._attachedNode._isMesh||this._attachedNode.getClassName()==="AbstractMesh"||this._attachedNode.getClassName()==="TransformNode"||this._attachedNode.getClassName()==="InstancedMesh"){const t=this._attachedNode;if(t.parent){const i=s.Matrix[0],a=s.Matrix[1];t.parent.getWorldMatrix().invertToRef(i),this._attachedNode.getWorldMatrix().multiplyToRef(i,a);const e=s.Matrix[4];if(this._handlePivotMatrixInverse(t,a,e),e.decompose(s.Vector3[0],s.Quaternion[0],t.position,y.PreserveScaling?t:void 0,y.UseAbsoluteScaling),s.Quaternion[0].normalize(),t.isUsingPivotMatrix()){const r=s.Quaternion[1];F.RotationYawPitchRollToRef(t.rotation.y,t.rotation.x,t.rotation.z,r);const c=s.Matrix[2];k.ScalingToRef(t.scaling.x,t.scaling.y,t.scaling.z,c);const o=s.Matrix[7];r.toRotationMatrix(o);const g=t.getPivotMatrix(),d=s.Matrix[3];g.invertToRef(d),g.multiplyToRef(c,s.Matrix[4]),s.Matrix[4].multiplyToRef(o,s.Matrix[5]),s.Matrix[5].multiplyToRef(d,s.Matrix[6]),s.Matrix[6].getTranslationToRef(s.Vector3[1]),t.position.subtractInPlace(s.Vector3[1])}}else{const i=s.Matrix[4];this._handlePivotMatrixInverse(t,this._attachedNode._worldMatrix,i),i.decompose(s.Vector3[0],s.Quaternion[0],t.position,y.PreserveScaling?t:void 0,y.UseAbsoluteScaling)}s.Vector3[0].scaleInPlace(1/t.scalingDeterminant),t.scaling.copyFrom(s.Vector3[0]),t.billboardMode||(t.rotationQuaternion?(t.rotationQuaternion.copyFrom(s.Quaternion[0]),t.rotationQuaternion.normalize()):t.rotation=s.Quaternion[0].toEulerAngles())}else if(this._attachedNode.getClassName()==="Bone"){const t=this._attachedNode,i=t.getParent();if(i){const a=s.Matrix[0],e=s.Matrix[1];i.getFinalMatrix().invertToRef(a),t.getFinalMatrix().multiplyToRef(a,e),t.getLocalMatrix().copyFrom(e)}else t.getLocalMatrix().copyFrom(t.getFinalMatrix());t.markAsDirty()}else{const t=this._attachedNode;if(t.getTypeID){const i=t.getTypeID();if(i===w.LIGHTTYPEID_DIRECTIONALLIGHT||i===w.LIGHTTYPEID_SPOTLIGHT||i===w.LIGHTTYPEID_POINTLIGHT){const a=t.parent;if(a){const e=s.Matrix[0],r=s.Matrix[1];a.getWorldMatrix().invertToRef(e),t.getWorldMatrix().multiplyToRef(e,r),r.decompose(void 0,s.Quaternion[0],s.Vector3[0])}else this._attachedNode._worldMatrix.decompose(void 0,s.Quaternion[0],s.Vector3[0]);t.position=new h(s.Vector3[0].x,s.Vector3[0].y,s.Vector3[0].z),t.direction&&(t.direction=new h(t.direction.x,t.direction.y,t.direction.z))}}}}_setGizmoMeshMaterial(t,i){if(t)for(const a of t)a.material=i,a.color&&(a.color=i.diffuseColor)}static GizmoAxisPointerObserver(t,i){let a=!1,e=-1,r=!1;return t.utilityLayerScene.onPointerObservable.add(o=>{var g,d;if(o.pickInfo){if(r=a&&o.event.button!==-1&&o.event.button!==e,r||o.type===m.POINTERUP)i.forEach(n=>{n.active=!1,a=!1,e=-1;for(const u of n.gizmoMeshes)u.material=n.dragBehavior.enabled?n.material:n.disableMaterial,u.color&&(u.color=n.material.diffuseColor)});else if(o.type===m.POINTERMOVE){if(a)return;i.forEach(n=>{var u,x;if(n.colliderMeshes&&n.gizmoMeshes){const v=((x=n.colliderMeshes)==null?void 0:x.indexOf((u=o==null?void 0:o.pickInfo)==null?void 0:u.pickedMesh))!=-1,C=n.dragBehavior.enabled?v||n.active?n.hoverMaterial:n.material:n.disableMaterial;for(const p of n.gizmoMeshes)p.material=C,p.color&&(p.color=C.diffuseColor)}})}else if(o.type===m.POINTERDOWN&&i.has((g=o.pickInfo.pickedMesh)==null?void 0:g.parent)){a=!0,e=o.event.button;const n=i.get((d=o.pickInfo.pickedMesh)==null?void 0:d.parent);n.active=!0,i.forEach(u=>{var C,p;const v=(((p=u.colliderMeshes)==null?void 0:p.indexOf((C=o==null?void 0:o.pickInfo)==null?void 0:C.pickedMesh))!=-1||u.active)&&u.dragBehavior.enabled?u.hoverMaterial:u.disableMaterial;for(const P of u.gizmoMeshes)P.material=v,P.color&&(P.color=v.diffuseColor)})}}})}dispose(){this._rootMesh.dispose(),this._beforeRenderObserver&&this.gizmoLayer.utilityLayerScene.onBeforeRenderObservable.remove(this._beforeRenderObserver)}}y.PreserveScaling=!1;y.UseAbsoluteScaling=!0;class D extends y{get coloredMaterial(){return this._coloredMaterial}get hoverMaterial(){return this._hoverMaterial}get disableMaterial(){return this._disableMaterial}static _CreateArrow(t,i,a=1,e=!1){const r=new V("arrow",t),c=I("cylinder",{diameterTop:0,height:.075,diameterBottom:.0375*(1+(a-1)/4),tessellation:96},t),o=I("cylinder",{diameterTop:.005*a,height:.275,diameterBottom:.005*a,tessellation:96},t);return c.parent=r,c.material=i,c.rotation.x=Math.PI/2,c.position.z+=.3,o.parent=r,o.material=i,o.position.z+=.275/2,o.rotation.x=Math.PI/2,e&&(o.visibility=0,c.visibility=0),r}static _CreateArrowInstance(t,i){const a=new V("arrow",t);for(const e of i.getChildMeshes()){const r=e.createInstance(e.name);r.parent=a}return a}constructor(t,i=O.Gray(),a=_.DefaultUtilityLayer,e=null,r=1,c=O.Yellow(),o=O.Gray()){var C;super(a),this._pointerObserver=null,this.snapDistance=0,this.onSnapObservable=new R,this._isEnabled=!0,this._parent=null,this._dragging=!1,this._parent=e,this._coloredMaterial=new A("",a.utilityLayerScene),this._coloredMaterial.diffuseColor=i,this._coloredMaterial.specularColor=i.subtract(new O(.1,.1,.1)),this._hoverMaterial=new A("",a.utilityLayerScene),this._hoverMaterial.diffuseColor=c,this._disableMaterial=new A("",a.utilityLayerScene),this._disableMaterial.diffuseColor=o,this._disableMaterial.alpha=.4;const g=D._CreateArrow(a.utilityLayerScene,this._coloredMaterial,r),d=D._CreateArrow(a.utilityLayerScene,this._coloredMaterial,r+4,!0);this._gizmoMesh=new E("",a.utilityLayerScene),this._gizmoMesh.addChild(g),this._gizmoMesh.addChild(d),this._gizmoMesh.lookAt(this._rootMesh.position.add(t)),this._gizmoMesh.scaling.scaleInPlace(1/3),this._gizmoMesh.parent=this._rootMesh;let n=0;const u={snapDistance:0};this.dragBehavior=new f({dragAxis:t}),this.dragBehavior.moveAttached=!1,this.dragBehavior.updateDragPlane=!1,this._rootMesh.addBehavior(this.dragBehavior),this.dragBehavior.onDragObservable.add(p=>{if(this.attachedNode){let P=!1,M=p.delta;if(this._additionalTransformNode){const T=s.Matrix[0];this._additionalTransformNode.getWorldMatrix().invertToRef(T),h.TransformNormalToRef(p.delta,T,s.Vector3[3]),M=s.Vector3[3]}if(this.snapDistance==0)this.attachedNode.getWorldMatrix().getTranslationToRef(s.Vector3[2]),s.Vector3[2].addInPlace(M),this.dragBehavior.validateDrag(s.Vector3[2])&&(this.attachedNode.position&&this.attachedNode.position.addInPlaceFromFloats(M.x,M.y,M.z),this.attachedNode.getWorldMatrix().addTranslationFromFloats(M.x,M.y,M.z),this.attachedNode.updateCache(),P=!0);else if(n+=p.dragDistance,Math.abs(n)>this.snapDistance){const T=Math.floor(Math.abs(n)/this.snapDistance);n=n%this.snapDistance,M.normalizeToRef(s.Vector3[1]),s.Vector3[1].scaleInPlace(this.snapDistance*T),this.attachedNode.getWorldMatrix().getTranslationToRef(s.Vector3[2]),s.Vector3[2].addInPlace(s.Vector3[1]),this.dragBehavior.validateDrag(s.Vector3[2])&&(this.attachedNode.getWorldMatrix().addTranslationFromFloats(s.Vector3[1].x,s.Vector3[1].y,s.Vector3[1].z),this.attachedNode.updateCache(),u.snapDistance=this.snapDistance*T*Math.sign(n),this.onSnapObservable.notifyObservers(u),P=!0)}P&&this._matrixChanged()}}),this.dragBehavior.onDragStartObservable.add(()=>{this._dragging=!0}),this.dragBehavior.onDragEndObservable.add(()=>{this._dragging=!1});const x=a._getSharedGizmoLight();x.includedOnlyMeshes=x.includedOnlyMeshes.concat(this._rootMesh.getChildMeshes(!1));const v={gizmoMeshes:g.getChildMeshes(),colliderMeshes:d.getChildMeshes(),material:this._coloredMaterial,hoverMaterial:this._hoverMaterial,disableMaterial:this._disableMaterial,active:!1,dragBehavior:this.dragBehavior};(C=this._parent)==null||C.addToAxisCache(d,v),this._pointerObserver=a.utilityLayerScene.onPointerObservable.add(p=>{var P;if(!this._customMeshSet&&(this._isHovered=v.colliderMeshes.indexOf((P=p==null?void 0:p.pickInfo)==null?void 0:P.pickedMesh)!=-1,!this._parent)){const M=this.dragBehavior.enabled?this._isHovered||this._dragging?this._hoverMaterial:this._coloredMaterial:this._disableMaterial;this._setGizmoMeshMaterial(v.gizmoMeshes,M)}}),this.dragBehavior.onEnabledObservable.add(p=>{this._setGizmoMeshMaterial(v.gizmoMeshes,p?v.material:v.disableMaterial)})}_attachedNodeChanged(t){this.dragBehavior&&(this.dragBehavior.enabled=!!t)}set isEnabled(t){this._isEnabled=t,t?this._parent&&(this.attachedMesh=this._parent.attachedMesh,this.attachedNode=this._parent.attachedNode):(this.attachedMesh=null,this.attachedNode=null)}get isEnabled(){return this._isEnabled}dispose(){this.onSnapObservable.clear(),this.gizmoLayer.utilityLayerScene.onPointerObservable.remove(this._pointerObserver),this.dragBehavior.detach(),this._gizmoMesh&&this._gizmoMesh.dispose();const t=[this._coloredMaterial,this._hoverMaterial,this._disableMaterial];for(const i of t)i&&i.dispose();super.dispose()}}class N{get scaleLines(){return this._scaleLines}set scaleLines(t){this._scaleLines=t,this._xAxis.scaling.setAll(this._scaleLines*this._scaleLinesFactor),this._yAxis.scaling.setAll(this._scaleLines*this._scaleLinesFactor),this._zAxis.scaling.setAll(this._scaleLines*this._scaleLinesFactor)}get xAxis(){return this._xAxis}get yAxis(){return this._yAxis}get zAxis(){return this._zAxis}constructor(t,i=1,a=2,e,r,c,o=1){if(this._scaleLinesFactor=4,this._instanced=!1,this.scene=null,this._scaleLines=1,t=t||L.LastCreatedScene,!!t){if(!e){const g=new A("xAxisMaterial",t);g.disableLighting=!0,g.emissiveColor=O.Red().scale(.5),e=D._CreateArrow(t,g,o)}if(!r){const g=new A("yAxisMaterial",t);g.disableLighting=!0,g.emissiveColor=O.Green().scale(.5),r=D._CreateArrow(t,g,o)}if(!c){const g=new A("zAxisMaterial",t);g.disableLighting=!0,g.emissiveColor=O.Blue().scale(.5),c=D._CreateArrow(t,g,o)}this._xAxis=e,this._yAxis=r,this._zAxis=c,this.scaleLines=i,a!=null&&(N._SetRenderingGroupId(this._xAxis,a),N._SetRenderingGroupId(this._yAxis,a),N._SetRenderingGroupId(this._zAxis,a)),this.scene=t,this.update(new h,h.Right(),h.Up(),h.Forward())}}update(t,i,a,e){this._xAxis.position.copyFrom(t),this._xAxis.setDirection(i),this._yAxis.position.copyFrom(t),this._yAxis.setDirection(a),this._zAxis.position.copyFrom(t),this._zAxis.setDirection(e)}createInstance(){const t=D._CreateArrowInstance(this.scene,this._xAxis),i=D._CreateArrowInstance(this.scene,this._yAxis),a=D._CreateArrowInstance(this.scene,this._zAxis),e=new N(this.scene,this.scaleLines,null,t,i,a);return e._instanced=!0,e}dispose(){this._xAxis&&this._xAxis.dispose(!1,!this._instanced),this._yAxis&&this._yAxis.dispose(!1,!this._instanced),this._zAxis&&this._zAxis.dispose(!1,!this._instanced),this.scene=null}static _SetRenderingGroupId(t,i){const a=t.getChildMeshes();for(const e of a)e.renderingGroupId=i}}export{N as AxesViewer};
|