n&&(n=a)}return{min:r,max:n}}_getPixelForNumber(e,t,r,n,o){const{min:s,max:a}=t;let i=Math.abs(a-s)>.001?(e-s)/(a-s):.5;return o&&(i=1-i),r+i*n}_attachEventListeners(e){e.addEventListener("wheel",this._handleZoom),e.addEventListener("mousemove",this._handleDataHover),e.addEventListener("mousedown",this._handlePanStart),e.addEventListener("mouseleave",this._handleStopHover),e.ownerDocument.addEventListener("mouseup",this._handlePanStop)}_removeEventListeners(e){e.removeEventListener("wheel",this._handleZoom),e.removeEventListener("mousemove",this._handleDataHover),e.removeEventListener("mousedown",this._handlePanStart),e.removeEventListener("mouseleave",this._handleStopHover),e.ownerDocument.removeEventListener("mouseup",this._handlePanStop)}_getDistanceFromLine(e,t,r,n,o,s){if(e===r&&t===n)return Math.sqrt(Math.pow(e-o,2)+Math.pow(t-s,2));let a=0,i=0,l=0,p=0;return t>=n?(a=e,i=t,l=r,p=n):(a=r,i=n,l=e,p=t),si?Math.sqrt(Math.pow(a-o,2)+Math.pow(i-s,2)):Math.abs((r-e)*(t-s)-(e-o)*(n-t))/Math.sqrt(Math.pow(r-e,2)+Math.pow(n-t,2))}_preprocessTooltip(e,t){const{_ctx:r}=this;if(null===e||!r||!r.canvas||0===this._getNumberOfSlices())return;const{left:n,top:s}=r.canvas.getBoundingClientRect(),a=e.yPos-s;let i=e.xPos-n;i>t.right&&(i=t.right);const l=this._getNumberFromPixel(i,this._globalTimeMinMax,t.left,t.right,!1);let p="",c=0;const d=this._getClosestPointToTimestamp(l);let h=0,u="",b={min:0,max:0},g=Number.POSITIVE_INFINITY;this.datasets.ids.forEach(((r,s)=>{if(this.metadata.get(r)?.hidden)return;if(s>=this.datasets.data.at(this.datasets.startingIndices.at(d)+o.PerformanceViewerCollector.NumberOfPointsOffset))return;const i=this.datasets.startingIndices.at(d)+o.PerformanceViewerCollector.SliceDataOffset+s,l=this.datasets.data.at(i);let m;for(let e=0;ep.length&&(p=f),this._tooltipItems[c].text=f,this._tooltipItems[c].color=this.metadata.get(r)?.color??po,c++,!this._position)return;let x=this._getDistanceFromLine(C,A,C,A,e.xPos-n,a);if(d+1s){const r=this.datasets.data.at(this.datasets.startingIndices.at(d+1)),i=this._getPixelForNumber(r,this._globalTimeMinMax,t.left,t.right-t.left,!1),l=this.datasets.data.at(this.datasets.startingIndices.at(d+1)+o.PerformanceViewerCollector.SliceDataOffset+s),p=this._getPixelForNumber(l,m,t.top,t.bottom-t.top,!0);x=Math.min(this._getDistanceFromLine(C,A,i,p,e.xPos-n,a),x)}if(d-1>=0&&this.datasets.data.at(this.datasets.startingIndices.at(d+1)+o.PerformanceViewerCollector.NumberOfPointsOffset)>s){const r=this.datasets.data.at(this.datasets.startingIndices.at(d-1)),i=this._getPixelForNumber(r,this._globalTimeMinMax,t.left,t.right-t.left,!1),l=this.datasets.data.at(this.datasets.startingIndices.at(d-1)+o.PerformanceViewerCollector.SliceDataOffset+s),p=this._getPixelForNumber(l,m,t.top,t.bottom-t.top,!0);x=Math.min(this._getDistanceFromLine(C,A,i,p,e.xPos-n,a),x)}xthis._width&&(u-=d),r.globalAlpha=.8,r.fillStyle="#566268",r.fillRect(u,b,d,h),r.globalAlpha=1,u+=10,b+=c;for(let e=0;e.998}_drawPlayheadRegion(e,t){const{_ctx:r}=this;if(!r||t>=.95)return;const n=Math.ceil(e.right*t),o=n-8,s=n+2,a=e.bottom-e.top-1;r.save(),r.fillStyle="#dfe9ed",r.fillRect(s,e.top,e.right-s,a),r.fillStyle="#0a3066",r.fillRect(n,e.top,2,a),r.fillStyle="#b9dbef",r.fillRect(o,e.top,8,a),r.restore()}destroy(){this._ctx&&this._ctx.canvas&&(this._removeEventListeners(this._ctx.canvas),this._ctx=null)}clear(){const{_ctx:e,_width:t,_height:r}=this;e&&(e.save(),e.resetTransform(),e.clearRect(0,0,t,r),e.restore())}}const fo=e=>{const{id:t,collector:n,scene:o,layoutObservable:a,returnToPlayheadObservable:i,onVisibleRangeChangedObservable:l,initialGraphSize:p}=e,c=(0,r.useRef)(null);return(0,r.useEffect)((()=>{if(!c.current)return;let e;p&&(c.current.width=p.width,c.current.height=p.height);try{e=new Co(c.current,{datasets:n.datasets,onVisibleRangeChangedObservable:l})}catch(e){return void console.error(e)}const t=t=>{if(!c.current)return;const{left:r,top:n}=c.current.getBoundingClientRect();t.width=t.width-r,t.height=t.height-n,e?.resize(t)},r=()=>{e?.update()},s=t=>{e&&(e.metadata=t,e.update())};return o.onAfterRenderObservable.add(r),n.metadataObservable.add(s),a?.add(t),i?.add((()=>{e?.resetDataPosition()})),()=>{e?.destroy(),a?.removeCallback(t),o.onAfterRenderObservable.removeCallback(r),n.metadataObservable.removeCallback(s)}}),[c]),(0,s.jsx)("canvas",{id:t,ref:c})},xo=e=>{const{scene:t,layoutObservable:n,returnToLiveObservable:a,performanceCollector:i,initialGraphSize:l}=e,[p]=(0,r.useState)(new o.Observable);return(0,s.jsxs)("div",{id:"performance-viewer",children:[(0,s.jsx)(io,{returnToPlayhead:a}),(0,s.jsx)(ao,{collector:i,onVisibleRangeChangedObservable:p}),(0,s.jsx)(fo,{id:"performance-viewer-graph",returnToPlayheadObservable:a,layoutObservable:n,scene:t,collector:i,onVisibleRangeChangedObservable:p,initialGraphSize:l})]})};var vo=p(8560),yo={};yo.styleTagTransform=Xn(),yo.setAttributes=Zn(),yo.insert=Wn().bind(null,"head"),yo.domAPI=Hn(),yo.insertStyleElement=Jn(),Gn()(vo.Z,yo),vo.Z&&vo.Z.locals&&vo.Z.locals;const jo={width:1024,height:512},Oo={width:724,height:512};var So;!function(e){e.Count="Count",e.FrameSteps="Frame Steps Duration"}(So||(So={}));const wo=[{strategyCallback:o.PerfCollectionStrategy.FpsStrategy()},{strategyCallback:o.PerfCollectionStrategy.TotalMeshesStrategy(),category:So.Count,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.ActiveMeshesStrategy(),category:So.Count,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.ActiveIndicesStrategy(),category:So.Count,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.ActiveBonesStrategy(),category:So.Count,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.ActiveParticlesStrategy(),category:So.Count,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.DrawCallsStrategy(),category:So.Count,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.TotalLightsStrategy(),category:So.Count,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.TotalVerticesStrategy(),category:So.Count,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.TotalMaterialsStrategy(),category:So.Count,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.TotalTexturesStrategy(),category:So.Count,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.AbsoluteFpsStrategy(),category:So.FrameSteps,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.MeshesSelectionStrategy(),category:So.FrameSteps,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.RenderTargetsStrategy(),category:So.FrameSteps,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.ParticlesStrategy(),category:So.FrameSteps,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.SpritesStrategy(),category:So.FrameSteps,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.AnimationsStrategy(),category:So.FrameSteps,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.PhysicsStrategy(),category:So.FrameSteps,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.RenderStrategy(),category:So.FrameSteps,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.FrameTotalStrategy(),category:So.FrameSteps,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.InterFrameStrategy(),category:So.FrameSteps,hidden:!0},{strategyCallback:o.PerfCollectionStrategy.GpuFrameTimeStrategy(),category:So.FrameSteps,hidden:!0}],Mo=e=>{const{scene:t}=e,[n,a]=(0,r.useState)(!1),[i,l]=(0,r.useState)(!1),[p,c]=(0,r.useState)(),[d]=(0,r.useState)(new o.Observable),[h]=(0,r.useState)(new o.Observable),u=e=>{e&&e.close(),l(!1),a(!1)};(0,r.useEffect)((()=>{i||p&&(p.stop(),p.clear(!1),m(p))}),[i]);const b=()=>{p&&Ap._CreatePersistentPopup({props:{id:"performance-viewer",title:"Realtime Performance Viewer",onClose:u,onResize:g,size:jo},children:(0,s.jsx)(xo,{scene:t,layoutObservable:d,returnToLiveObservable:h,performanceCollector:p,initialGraphSize:Oo})},document.body)},g=e=>{const t=e?.innerWidth??0,r=e?.innerHeight??0;d.notifyObservers({width:t,height:r})},m=e=>{e.addCollectionStrategies(...wo),o.PressureObserverWrapper.IsAvailable&&e.addCollectionStrategies({strategyCallback:o.PerfCollectionStrategy.PressureStrategy(),category:So.FrameSteps,hidden:!0})};return(0,r.useEffect)((()=>{const e=t.getPerfCollector();m(e),c(e)}),[]),(0,s.jsxs)(In,{title:"Performance Viewer",children:[!n&&(0,s.jsx)(_n,{label:"Open Realtime Perf Viewer",onClick:()=>{a(!0),p?.start(!0),b()}}),!n&&(0,s.jsx)(zn,{accept:"csv",label:"Load Perf Viewer using CSV",onClick:e=>{o.Tools.ReadFile(e,(e=>{a(!1),l(!0),p?.stop();const t=p?.loadFromFileData(e);t?b():(a(!1),p?.start(!0))}))}}),(0,s.jsx)(_n,{label:"Export Perf to CSV",onClick:()=>{p?.exportDataToCsv()}}),!n&&(0,s.jsx)(_n,{label:p?.isStarted?"Stop Recording":"Begin Recording",onClick:()=>{p?.isStarted?p?.stop():p?.start(!0)}})]})};class No extends En{constructor(e){super(e);const t=this.props.scene;t&&(this._sceneInstrumentation=new o.SceneInstrumentation(t),this._sceneInstrumentation.captureActiveMeshesEvaluationTime=!0,this._sceneInstrumentation.captureRenderTargetsRenderTime=!0,this._sceneInstrumentation.captureFrameTime=!0,this._sceneInstrumentation.captureRenderTime=!0,this._sceneInstrumentation.captureInterFrameTime=!0,this._sceneInstrumentation.captureParticlesRenderTime=!0,this._sceneInstrumentation.captureSpritesRenderTime=!0,this._sceneInstrumentation.capturePhysicsTime=!0,this._sceneInstrumentation.captureAnimationsTime=!0,this._engineInstrumentation=new o.EngineInstrumentation(t.getEngine()),this._engineInstrumentation.captureGPUFrameTime=!0,this._timerIntervalId=window.setInterval((()=>this.forceUpdate()),500))}componentWillUnmount(){this._sceneInstrumentation&&(this._sceneInstrumentation.dispose(),this._sceneInstrumentation=null),this._engineInstrumentation&&(this._engineInstrumentation.dispose(),this._engineInstrumentation=null),window.clearInterval(this._timerIntervalId)}render(){const e=this.props.scene;if(!e||!this._sceneInstrumentation||!this._engineInstrumentation)return null;const t=e.getEngine(),r=this._sceneInstrumentation,n=this._engineInstrumentation,a=t.getCaps();return(0,s.jsxs)("div",{className:"pane",children:[(0,s.jsx)(Pn,{label:"Version",value:o.Engine.Version,color:"rgb(113, 159, 255)"}),(0,s.jsx)(Dn,{label:"FPS",value:t.getFps(),fractionDigits:0}),(0,s.jsx)(Mo,{scene:e}),(0,s.jsxs)(In,{title:"COUNT",children:[(0,s.jsx)(Pn,{label:"Total meshes",value:e.meshes.length.toString()}),(0,s.jsx)(Pn,{label:"Active meshes",value:e.getActiveMeshes().length.toString()}),(0,s.jsx)(Pn,{label:"Active indices",value:e.getActiveIndices().toString()}),(0,s.jsx)(Pn,{label:"Active faces",value:(e.getActiveIndices()/3).toString()}),(0,s.jsx)(Pn,{label:"Active bones",value:e.getActiveBones().toString()}),(0,s.jsx)(Pn,{label:"Active particles",value:e.getActiveParticles().toString()}),(0,s.jsx)(Pn,{label:"Draw calls",value:r.drawCallsCounter.current.toString()}),(0,s.jsx)(Pn,{label:"Total lights",value:e.lights.length.toString()}),(0,s.jsx)(Pn,{label:"Total vertices",value:e.getTotalVertices().toString()}),(0,s.jsx)(Pn,{label:"Total materials",value:e.materials.length.toString()}),(0,s.jsx)(Pn,{label:"Total textures",value:e.textures.length.toString()})]}),(0,s.jsxs)(In,{title:"FRAME STEPS DURATION",children:[(0,s.jsx)(Dn,{label:"Absolute FPS",value:1e3/this._sceneInstrumentation.frameTimeCounter.lastSecAverage,fractionDigits:0}),(0,s.jsx)(Dn,{label:"Meshes selection",value:r.activeMeshesEvaluationTimeCounter.lastSecAverage,units:"ms"}),(0,s.jsx)(Dn,{label:"Render targets",value:r.renderTargetsRenderTimeCounter.lastSecAverage,units:"ms"}),(0,s.jsx)(Dn,{label:"Particles",value:r.particlesRenderTimeCounter.lastSecAverage,units:"ms"}),(0,s.jsx)(Dn,{label:"Sprites",value:r.spritesRenderTimeCounter.lastSecAverage,units:"ms"}),(0,s.jsx)(Dn,{label:"Animations",value:r.animationsTimeCounter.lastSecAverage,units:"ms"}),(0,s.jsx)(Dn,{label:"Physics",value:r.physicsTimeCounter.lastSecAverage,units:"ms"}),(0,s.jsx)(Dn,{label:"Render",value:r.renderTimeCounter.lastSecAverage,units:"ms"}),(0,s.jsx)(Dn,{label:"Frame total",value:r.frameTimeCounter.lastSecAverage,units:"ms"}),(0,s.jsx)(Dn,{label:"Inter-frame",value:r.interFrameTimeCounter.lastSecAverage,units:"ms"}),(0,s.jsx)(Dn,{label:"GPU Frame time",value:1e-6*n.gpuFrameTimeCounter.lastSecAverage,units:"ms"}),(0,s.jsx)(Dn,{label:"GPU Frame time (average)",value:1e-6*n.gpuFrameTimeCounter.average,units:"ms"})]}),(0,s.jsxs)(In,{title:"SYSTEM INFO",children:[(0,s.jsx)(Pn,{label:"Resolution",value:t.getRenderWidth()+"x"+t.getRenderHeight()}),(0,s.jsx)(Pn,{label:"Hardware scaling level",value:t.getHardwareScalingLevel().toString()}),(0,s.jsx)(Pn,{label:"Engine",value:t.description}),(0,s.jsx)(Tn,{label:"Std derivatives",value:a.standardDerivatives}),(0,s.jsx)(Tn,{label:"Compressed textures",value:void 0!==a.s3tc}),(0,s.jsx)(Tn,{label:"Hardware instances",value:a.instancedArrays}),(0,s.jsx)(Tn,{label:"Texture float",value:a.textureFloat}),(0,s.jsx)(Tn,{label:"Texture half-float",value:a.textureHalfFloat}),(0,s.jsx)(Tn,{label:"Render to texture float",value:a.textureFloatRender}),(0,s.jsx)(Tn,{label:"Render to texture half-float",value:a.textureHalfFloatRender}),(0,s.jsx)(Tn,{label:"32bits indices",value:a.uintIndices}),(0,s.jsx)(Tn,{label:"Fragment depth",value:a.fragmentDepthSupported}),(0,s.jsx)(Tn,{label:"High precision shaders",value:a.highPrecisionShaderSupported}),(0,s.jsx)(Tn,{label:"Draw buffers",value:a.drawBuffersExtension}),(0,s.jsx)(Tn,{label:"Vertex array object",value:a.vertexArrayObject}),(0,s.jsx)(Tn,{label:"Timer query",value:void 0!==a.timerQuery}),(0,s.jsx)(Tn,{label:"Stencil",value:t.isStencilEnable}),(0,s.jsx)(Tn,{label:"Parallel shader compilation",value:null!=a.parallelShaderCompile}),(0,s.jsx)(Dn,{label:"Max textures units",value:a.maxTexturesImageUnits,fractionDigits:0}),(0,s.jsx)(Dn,{label:"Max textures size",value:a.maxTextureSize,fractionDigits:0}),(0,s.jsx)(Dn,{label:"Max anisotropy",value:a.maxAnisotropy,fractionDigits:0}),(0,s.jsx)(Pn,{label:"Driver",value:t.getGlInfo().renderer})]})]})}}var ko=p(7849);class Lo extends r.Component{constructor(e){super(e),this.state={isEnabled:!1}}componentDidMount(){const e=o.UtilityLayerRenderer.DefaultKeepDepthUtilityLayer.utilityLayerScene;for(const t of e.meshes)if(t.reservedDataStore&&t.reservedDataStore.isInspectorGrid)return this._gridMesh=t,void this.setState({isEnabled:!0})}addOrRemoveGrid(){const e=o.UtilityLayerRenderer.DefaultKeepDepthUtilityLayer.utilityLayerScene;if(!this._gridMesh){const t=this.props.scene.getWorldExtends(),r=5*(t.max.x-t.min.x),n=5*(t.max.z-t.min.z);this._gridMesh=(0,o.CreateGround)("grid",{width:1,height:1,subdivisions:1},e),this._gridMesh.reservedDataStore||(this._gridMesh.reservedDataStore={}),this._gridMesh.scaling.x=Math.max(r,n),this._gridMesh.scaling.z=this._gridMesh.scaling.x,this._gridMesh.reservedDataStore.isInspectorGrid=!0,this._gridMesh.isPickable=!1;const s=new ko.GridMaterial("GridMaterial",e);return s.majorUnitFrequency=10,s.minorUnitVisibility=.3,s.gridRatio=.01,s.backFaceCulling=!1,s.mainColor=new o.Color3(1,1,1),s.lineColor=new o.Color3(1,1,1),s.opacity=.8,s.zOffset=1,s.opacityTexture=new o.Texture("https://assets.babylonjs.com/environments/backgroundGround.png",e),this._gridMesh.material=s,void this.setState({isEnabled:!0})}this.setState({isEnabled:!this.state.isEnabled}),this._gridMesh.dispose(!0,!0),this._gridMesh=null}render(){return(0,s.jsx)("div",{children:(0,s.jsx)(so,{label:"Render grid",isSelected:()=>this.state.isEnabled,onSelect:()=>this.addOrRemoveGrid()})})}}var Eo=p(4352);class Po extends En{constructor(e){super(e),this._physicsViewersEnabled=!1;const t=this.props.scene;t&&(t.reservedDataStore||(t.reservedDataStore={}),this._physicsViewersEnabled=null!=t.reservedDataStore.physicsViewer)}switchPhysicsViewers(){this._physicsViewersEnabled=!this._physicsViewersEnabled;const e=this.props.scene;if(this._physicsViewersEnabled){const t=new Eo.PhysicsViewer(e);e.reservedDataStore.physicsViewer=t;for(const r of e.meshes)if(r.physicsImpostor){const e=t.showImpostor(r.physicsImpostor,r);e&&(e.reservedDataStore={hidden:!0},e.material.reservedDataStore={hidden:!0})}else if(r.physicsBody){const e=t.showBody(r.physicsBody);e&&(e.reservedDataStore={hidden:!0},e.material.reservedDataStore={hidden:!0})}for(const r of e.transformNodes)if(r.physicsBody){const e=t.showBody(r.physicsBody);e&&(e.reservedDataStore={hidden:!0},e.material.reservedDataStore={hidden:!0})}}else e.reservedDataStore.physicsViewer.dispose(),e.reservedDataStore.physicsViewer=null}render(){const e=this.props.scene;return e?(0,s.jsxs)("div",{className:"pane",children:[(0,s.jsxs)(In,{title:"HELPERS",selection:this.props.globalState,children:[(0,s.jsx)(Lo,{globalState:this.props.globalState,scene:e}),(0,s.jsx)(so,{label:"Physics",isSelected:()=>this._physicsViewersEnabled,onSelect:()=>this.switchPhysicsViewers()})]}),(0,s.jsxs)(In,{title:"CORE TEXTURE CHANNELS",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Diffuse",isSelected:()=>o.StandardMaterial.DiffuseTextureEnabled,onSelect:()=>o.StandardMaterial.DiffuseTextureEnabled=!o.StandardMaterial.DiffuseTextureEnabled}),(0,s.jsx)(so,{label:"Ambient",isSelected:()=>o.StandardMaterial.AmbientTextureEnabled,onSelect:()=>o.StandardMaterial.AmbientTextureEnabled=!o.StandardMaterial.AmbientTextureEnabled}),(0,s.jsx)(so,{label:"Specular",isSelected:()=>o.StandardMaterial.SpecularTextureEnabled,onSelect:()=>o.StandardMaterial.SpecularTextureEnabled=!o.StandardMaterial.SpecularTextureEnabled}),(0,s.jsx)(so,{label:"Emissive",isSelected:()=>o.StandardMaterial.EmissiveTextureEnabled,onSelect:()=>o.StandardMaterial.EmissiveTextureEnabled=!o.StandardMaterial.EmissiveTextureEnabled}),(0,s.jsx)(so,{label:"Bump",isSelected:()=>o.StandardMaterial.BumpTextureEnabled,onSelect:()=>o.StandardMaterial.BumpTextureEnabled=!o.StandardMaterial.BumpTextureEnabled}),(0,s.jsx)(so,{label:"Opacity",isSelected:()=>o.StandardMaterial.OpacityTextureEnabled,onSelect:()=>o.StandardMaterial.OpacityTextureEnabled=!o.StandardMaterial.OpacityTextureEnabled}),(0,s.jsx)(so,{label:"Reflection",isSelected:()=>o.StandardMaterial.ReflectionTextureEnabled,onSelect:()=>o.StandardMaterial.ReflectionTextureEnabled=!o.StandardMaterial.ReflectionTextureEnabled}),(0,s.jsx)(so,{label:"Refraction",isSelected:()=>o.StandardMaterial.RefractionTextureEnabled,onSelect:()=>o.StandardMaterial.RefractionTextureEnabled=!o.StandardMaterial.RefractionTextureEnabled}),(0,s.jsx)(so,{label:"ColorGrading",isSelected:()=>o.StandardMaterial.ColorGradingTextureEnabled,onSelect:()=>o.StandardMaterial.ColorGradingTextureEnabled=!o.StandardMaterial.ColorGradingTextureEnabled}),(0,s.jsx)(so,{label:"Lightmap",isSelected:()=>o.StandardMaterial.LightmapTextureEnabled,onSelect:()=>o.StandardMaterial.LightmapTextureEnabled=!o.StandardMaterial.LightmapTextureEnabled}),(0,s.jsx)(so,{label:"Fresnel",isSelected:()=>o.StandardMaterial.FresnelEnabled,onSelect:()=>o.StandardMaterial.FresnelEnabled=!o.StandardMaterial.FresnelEnabled}),(0,s.jsx)(so,{label:"Detail",isSelected:()=>o.MaterialFlags.DetailTextureEnabled,onSelect:()=>o.MaterialFlags.DetailTextureEnabled=!o.MaterialFlags.DetailTextureEnabled}),(0,s.jsx)(so,{label:"Decal",isSelected:()=>o.MaterialFlags.DecalMapEnabled,onSelect:()=>o.MaterialFlags.DecalMapEnabled=!o.MaterialFlags.DecalMapEnabled})]}),(0,s.jsxs)(In,{title:"FEATURES",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Animations",isSelected:()=>e.animationsEnabled,onSelect:()=>e.animationsEnabled=!e.animationsEnabled}),(0,s.jsx)(so,{label:"Physics",isSelected:()=>e.physicsEnabled,onSelect:()=>e.physicsEnabled=!e.physicsEnabled}),(0,s.jsx)(so,{label:"Collisions",isSelected:()=>e.collisionsEnabled,onSelect:()=>e.collisionsEnabled=!e.collisionsEnabled}),(0,s.jsx)(so,{label:"Fog",isSelected:()=>e.fogEnabled,onSelect:()=>e.fogEnabled=!e.fogEnabled}),(0,s.jsx)(so,{label:"Lens flares",isSelected:()=>e.lensFlaresEnabled,onSelect:()=>e.lensFlaresEnabled=!e.lensFlaresEnabled}),(0,s.jsx)(so,{label:"Lights",isSelected:()=>e.lightsEnabled,onSelect:()=>e.lightsEnabled=!e.lightsEnabled}),(0,s.jsx)(so,{label:"Particles",isSelected:()=>e.particlesEnabled,onSelect:()=>e.particlesEnabled=!e.particlesEnabled}),(0,s.jsx)(so,{label:"Post-processes",isSelected:()=>e.postProcessesEnabled,onSelect:()=>e.postProcessesEnabled=!e.postProcessesEnabled}),(0,s.jsx)(so,{label:"Probes",isSelected:()=>e.probesEnabled,onSelect:()=>e.probesEnabled=!e.probesEnabled}),(0,s.jsx)(so,{label:"Textures",isSelected:()=>e.texturesEnabled,onSelect:()=>e.texturesEnabled=!e.texturesEnabled}),(0,s.jsx)(so,{label:"Procedural textures",isSelected:()=>e.proceduralTexturesEnabled,onSelect:()=>e.proceduralTexturesEnabled=!e.proceduralTexturesEnabled}),(0,s.jsx)(so,{label:"Render targets",isSelected:()=>e.renderTargetsEnabled,onSelect:()=>e.renderTargetsEnabled=!e.renderTargetsEnabled}),(0,s.jsx)(so,{label:"Shadows",isSelected:()=>e.shadowsEnabled,onSelect:()=>e.shadowsEnabled=!e.shadowsEnabled}),(0,s.jsx)(so,{label:"Skeletons",isSelected:()=>e.skeletonsEnabled,onSelect:()=>e.skeletonsEnabled=!e.skeletonsEnabled}),(0,s.jsx)(so,{label:"Sprites",isSelected:()=>e.spritesEnabled,onSelect:()=>e.spritesEnabled=!e.spritesEnabled})]})]}):null}}var Io=function(){function e(e,t){for(var r=0;r{this.props.incrementValue(-e.movementY)},this._releaseListener=()=>{this.props.setDragging(!1),this._arrowsRef.current?.ownerDocument.exitPointerLock(),this._arrowsRef.current?.ownerDocument.defaultView.removeEventListener("pointerup",this._releaseListener),this._arrowsRef.current?.ownerDocument.removeEventListener("pointerlockchange",this._lockChangeListener),this._arrowsRef.current?.ownerDocument.defaultView.removeEventListener("mousemove",this._drag)},this._lockChangeListener=()=>{this._arrowsRef.current?.ownerDocument.pointerLockElement!==this._arrowsRef.current&&this._releaseListener()}}render(){return(0,s.jsxs)("div",{className:"arrows",ref:this._arrowsRef,onPointerDown:()=>{this._arrowsRef.current?.ownerDocument.addEventListener("pointerlockchange",this._lockChangeListener),this._arrowsRef.current?.ownerDocument.defaultView.addEventListener("pointerup",this._releaseListener),this._arrowsRef.current?.ownerDocument.defaultView.addEventListener("mousemove",this._drag),this.props.setDragging(!0),this._arrowsRef.current?.requestPointerLock()},onDragStart:e=>e.preventDefault(),children:[(0,s.jsx)("img",{className:"upArrowIcon",src:"data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDE1IDE1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNC4wOSw5LjQ1YS42LjYsMCwwLDEsMC0uODRsMy0zYS42LjYsMCwwLDEsLjg0LDBsMywzYS42LjYsMCwwLDEsMCwuODQuNjEuNjEsMCwwLDEtLjg1LDBsLTItMnY1LjczYS42LjYsMCwwLDEtMS4yLDBWNy40OGwtMiwyQS42MS42MSwwLDAsMSw0LjA5LDkuNDVaIi8+PC9zdmc+",alt:"Increase Value"}),(0,s.jsx)("img",{className:"downArrowIcon",src:"data:image/svg+xml;base64,PHN2ZyBpZD0iaWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDE1IDE1Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6IzMzMzt9PC9zdHlsZT48L2RlZnM+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNNC4wOSw1LjU1YS42MS42MSwwLDAsMSwuODUsMGwyLDJWMS43OWEuNi42LDAsMSwxLDEuMiwwVjcuNTJsMi0yYS42MS42MSwwLDAsMSwuODUsMCwuNi42LDAsMCwxLDAsLjg0bC0zLDNhLjYuNiwwLDAsMS0uODQsMGwtMy0zQS42LjYsMCwwLDEsNC4wOSw1LjU1WiIvPjwvc3ZnPg==",alt:"Increase Value"})]})}}class Jo extends r.Component{constructor(e){super(e),this._localChange=!1;const t=this.props.target[this.props.propertyName];this.state={value:this.getValueString(t,this.props),dragging:!1},this._store=t}componentWillUnmount(){this.unlock()}getValueString(e,t){return e?e===ro?ro:t.isInteger?e.toFixed(0):e.toFixed(t.digits||4):"0"}shouldComponentUpdate(e,t){if(this._localChange)return this._localChange=!1,!0;const r=e.target[e.propertyName],n=this.getValueString(r,e);return n!==t.value?(t.value=n,!0):t.dragging!=this.state.dragging||e.unit!==this.props.unit||e.isInteger!==this.props.isInteger}raiseOnPropertyChanged(e,t){this.props.onChange&&this.props.onChange(e),this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:e,initialValue:t})}updateValue(e){if(/[^0-9.-]/g.test(e))return;let t;t=this.props.isInteger?parseInt(e):parseFloat(e),isNaN(t)?null!=this.props.defaultValue&&(t=this.props.defaultValue):(void 0!==this.props.min&&tthis.props.max&&(t=this.props.max,e=t.toString())),this._localChange=!0,this.setState({value:e}),isNaN(t)||(this.props.target[this.props.propertyName]=t,this.raiseOnPropertyChanged(t,this._store),this._store=t)}lock(){this.props.lockObject&&(this.props.lockObject.lock=!0)}unlock(){this.props.lockObject&&(this.props.lockObject.lock=!1)}incrementValue(e,t=!0){t&&this.props.step&&(e*=parseFloat(this.props.step));let r=parseFloat(this.state.value);isNaN(r)&&(r=0),this.updateValue((r+e).toFixed(2))}onKeyDown(e){const t=parseFloat(this.props.step||this.props.isInteger?"1":"0.01"),r=r=>{e.shiftKey&&(r*=10,(e.ctrlKey||e.metaKey)&&(r*=10)),this.incrementValue(r*t,!1),e.preventDefault()};"ArrowUp"===e.key?r(1):"ArrowDown"===e.key&&r(-1),"Enter"===e.key&&this.props.onEnter&&this.props.onEnter(this._store)}render(){let e;e=this.props.isInteger?parseInt(this.state.value):parseFloat(this.state.value);let t=this.props.smallUI?"short":"value";this.state.dragging&&(t+=" dragging"),this.props.arrows&&(t+=" hasArrows");const r=this.state.value===ro?"":this.state.value,n=this.state.value===ro?ro:"";return(0,s.jsxs)(s.Fragment,{children:[!this.props.useEuler&&(0,s.jsxs)("div",{className:this.props.additionalClass?this.props.additionalClass+" floatLine":"floatLine",children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,className:"icon"}),(!this.props.icon||""!=this.props.label)&&(0,s.jsx)("div",{className:"label",title:this.props.label,children:this.props.label}),(0,s.jsxs)("div",{className:t,children:[(0,s.jsx)("input",{type:"number",step:this.props.step||this.props.isInteger?"1":"0.01",className:"numeric-input",onKeyDown:e=>this.onKeyDown(e),value:r,onBlur:()=>{this.unlock(),this.props.onEnter&&this.props.onEnter(this._store)},placeholder:n,onFocus:()=>this.lock(),onChange:e=>this.updateValue(e.target.value)}),this.props.arrows&&(0,s.jsx)(Qo,{incrementValue:e=>this.incrementValue(e),setDragging:t=>{const r=this.state.dragging;!r&&t&&this.props.onDragStart?this.props.onDragStart(e):r&&!t&&this.props.onDragStop&&this.props.onDragStop(e),this.setState({dragging:t})}})]}),this.props.unit]}),this.props.useEuler&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:this.props.label,minimum:0,maximum:360,step:.1,directValue:o.Tools.ToDegrees(e),onChange:e=>this.updateValue(o.Tools.ToRadians(e).toString())})]})}}class Ko extends r.Component{constructor(e){if(super(e),this._localChange=!1,void 0!==this.props.directValue)this.state={value:this.props.directValue};else{let e=this.props.target[this.props.propertyName];void 0===e&&(e=this.props.maximum),this.state={value:e}}}shouldComponentUpdate(e,t){if(void 0!==e.directValue)return t.value=e.directValue,!0;if(e.label!==this.props.label)return!0;let r=e.target[e.propertyName];return void 0===r&&(r=e.maximum),r!==t.value||this._localChange||e.maximum!==this.props.maximum||e.minimum!==this.props.minimum?(t.value=r,this._localChange=!1,!0):e.unit!==this.props.unit}onChange(e){if("—"===e)return;this._localChange=!0;let t=parseFloat(e);this.props.useEuler&&(t=o.Tools.ToRadians(t)),this.props.target&&(this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:t,initialValue:this.state.value}),this.props.target[this.props.propertyName]=t),this.props.onChange&&this.props.onChange(t),this.setState({value:t})}onInput(e){const t=parseFloat(e);this.props.onInput&&this.props.onInput(t)}prepareDataToRead(e){return null===e&&(e=0),this.props.useEuler?o.Tools.ToDegrees(e):e}render(){return(0,s.jsxs)("div",{className:"sliderLine",children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,className:"icon"}),(!this.props.icon||""!=this.props.label)&&(0,s.jsx)("div",{className:this.props.margin?"label withMargins":"label",title:this.props.label,children:this.props.label}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,isInteger:0===this.props.decimalCount,smallUI:!0,label:"",target:this.state,digits:void 0===this.props.decimalCount?4:this.props.decimalCount,propertyName:"value",min:this.props.minimum,max:this.props.maximum,onEnter:()=>{const e=this.prepareDataToRead(this.state.value);this.onChange(e)},onChange:()=>{const e=this.prepareDataToRead(this.state.value);this.onChange(e)},onPropertyChangedObservable:this.props.onPropertyChangedObservable,unit:this.props.unit}),(0,s.jsx)("div",{className:"slider",children:(0,s.jsx)("input",{className:"range",type:"range",step:this.props.step,min:this.prepareDataToRead(this.props.minimum),max:this.prepareDataToRead(this.props.maximum),value:this.prepareDataToRead(this.state.value),onInput:e=>this.onInput(e.target.value),onChange:e=>this.onChange(e.target.value)})})]})}}const Xo=Number.MAX_SAFE_INTEGER;class qo extends r.Component{_remapValueIn(e){return this.props.allowNullValue&&null===e?Xo:e}_remapValueOut(e){return this.props.allowNullValue&&e===Xo?null:e}_getValue(e){return e.extractValue?e.extractValue(e.target):e.target&&e.propertyName?e.target[e.propertyName]:e.options[e.defaultIfNull||0]}constructor(e){super(e),this._localChange=!1,this.state={value:this._remapValueIn(this._getValue(e))}}shouldComponentUpdate(e,t){if(this._localChange)return this._localChange=!1,!0;const r=this._remapValueIn(e.extractValue?e.extractValue(this.props.target):e.target[e.propertyName]);return null!=r&&r!==t.value&&(t.value=r,!0)}raiseOnPropertyChanged(e,t){this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:e,initialValue:t,allowNullValue:this.props.allowNullValue})}setValue(e){this.setState({value:e})}updateValue(e){const t=this.props.valuesAreStrings?e:parseInt(e);this._localChange=!0;const r=this.props.extractValue?this.props.extractValue(this.props.target):this.props.target[this.props.propertyName];this.props.noDirectUpdate||(this.props.target[this.props.propertyName]=this._remapValueOut(t)),this.setState({value:t}),this.props.onSelect&&this.props.onSelect(t);const n=this.props.extractValue?this.props.extractValue(this.props.target):this.props.target[this.props.propertyName];this.raiseOnPropertyChanged(n,r)}render(){return(0,s.jsxs)("div",{className:"listLine"+(this.props.className?" "+this.props.className:""),children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,color:"black",className:"icon"}),(0,s.jsx)("div",{className:"label",title:this.props.label,children:this.props.label}),(0,s.jsx)("div",{className:"options",children:(0,s.jsx)("select",{onChange:e=>this.updateValue(e.target.value),value:this.state.value??"",children:this.props.options.map(((e,t)=>(0,s.jsx)("option",{selected:e.selected,value:e.value,title:e.label,children:e.label},e.label+t)))})})]})}}class $o extends r.Component{constructor(e){super(e),this._localChange=!1,this.state={value:this.props.value.toFixed(void 0!==this.props.precision?this.props.precision:3)}}componentWillUnmount(){this.props.lockObject&&(this.props.lockObject.lock=!1)}shouldComponentUpdate(e,t){return!!this._localChange||e.value.toString()!==t.value&&(t.value=e.value.toFixed(void 0!==this.props.precision?this.props.precision:3),!0)}updateValue(e){if(/[^0-9.-]/g.test(e))return;const t=parseFloat(e);this._localChange=!0,this.setState({value:e}),isNaN(t)||this.props.onChange(t)}onBlur(){this._localChange=!1;const e=parseFloat(this.state.value);this.props.lockObject&&(this.props.lockObject.lock=!1),isNaN(e)?this.props.onChange(this.props.value):this.props.onChange(e)}incrementValue(e){let t=parseFloat(this.state.value);isNaN(t)&&(t=0),this.updateValue((t+e).toFixed(void 0!==this.props.precision?this.props.precision:3))}onKeyDown(e){const t=this.props.step||1,r=r=>{e.shiftKey&&(r*=10,(e.ctrlKey||e.metaKey)&&(r*=10)),this.incrementValue(r*t),e.preventDefault()};"ArrowUp"===e.key?r(1):"ArrowDown"===e.key&&r(-1)}render(){return(0,s.jsxs)("div",{className:"numeric",children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,className:"icon"}),this.props.label&&(0,s.jsx)("div",{className:"numeric-label",title:this.props.label,children:`${this.props.label}: `}),(0,s.jsx)("input",{type:"number",step:this.props.step,className:"numeric-input",value:this.state.value,onChange:e=>this.updateValue(e.target.value),onKeyDown:e=>this.onKeyDown(e),onFocus:()=>{this.props.lockObject&&(this.props.lockObject.lock=!0)},onBlur:()=>this.onBlur()})]})}}$o.defaultProps={step:1};const es="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5jb3B5PC90aXRsZT48ZyBpZD0iVUlfRWxlbWVudHMiIGRhdGEtbmFtZT0iVUkgRWxlbWVudHMiPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTI0LDE0Ljg5SDIyLjc2bC0zLTNIMTIuNDNWMjYuNTloNC4yNnYzaDExLjVWMTlabS4zLDEuNzEsMi4xNCwyLjEzSDI0LjM0Wm0tMTAuOTEsOVYxMi45M2g1LjkzbDIsMkgxNi42OXYxMC43Wm00LjI2LDNWMTUuODloNS42NXYzLjg0aDMuODV2OC44M1oiLz48L2c+PC9zdmc+",ts=new o.Color4(0,0,0,0);class rs extends r.Component{constructor(e){super(e),this.state={isExpanded:!1,color:this.getValue()},this.props.target._isLinearColor=e.isLinear}shouldComponentUpdate(e,t){const r=t.color,n=this.getValue(e);return r!==this.state.color?(t.color=r,!0):n!==this.state.color?(t.color=n,!0):t.isExpanded!==this.state.isExpanded}getValue(e=this.props){const t=e.target[e.propertyName];return t?"string"==typeof t?t===ro?ts:this._convertToColor(t):e.isLinear?t.toGammaSpace():t.clone():ts}setColorFromString(e){const t=this._convertToColor(e);this.setColor(t)}setColor(e){this.setState({color:e.clone()}),this.props.isLinear&&e.toLinearSpaceToRef(e);const t=this.props.disableAlpha?this._toColor3(e):e,r=this.props.target,n=r[this.props.propertyName],o="string"==typeof r[this.props.propertyName]?t.toHexString():t;r[this.props.propertyName]=o,this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:r,property:this.props.propertyName,value:o,initialValue:n}),this.props.onChange&&this.props.onChange()}switchExpandState(){this.setState({isExpanded:!this.state.isExpanded})}updateStateR(e){this.setColor(new o.Color4(e,this.state.color.g,this.state.color.b,this.state.color.a))}updateStateG(e){this.setColor(new o.Color4(this.state.color.r,e,this.state.color.b,this.state.color.a))}updateStateB(e){this.setColor(new o.Color4(this.state.color.r,this.state.color.g,e,this.state.color.a))}updateStateA(e){this.props.disableAlpha||this.setColor(new o.Color4(this.state.color.r,this.state.color.g,this.state.color.b,e))}copyToClipboard(){const e=document.createElement("div");if(e.textContent=this.state.color.toHexString(),document.body.appendChild(e),window.getSelection){const t=document.createRange();t.selectNode(e),window.getSelection().removeAllRanges(),window.getSelection().addRange(t)}document.execCommand("copy"),e.remove()}_convertToColor(e){if(""===e||"transparent"===e)return ts;if("#"!==e.substring(0,1)||7!==e.length&&9!==e.length){const t=document.createElement("div");t.style.color=e,document.body.append(t);const r=window.getComputedStyle(t).color;document.body.removeChild(t);const n=r.substring(4,r.length-1).replace(/ /g,"").split(","),s=n.length>3?parseInt(n[3])/255:1;return new o.Color4(parseInt(n[0])/255,parseInt(n[1])/255,parseInt(n[2])/255,s)}if(this.props.disableAlpha){const t=o.Color3.FromHexString(e);return new o.Color4(t.r,t.g,t.b,1)}return o.Color4.FromHexString(e)}_toColor3(e){return new o.Color3(e.r,e.g,e.b)}render(){const e=this.state.isExpanded?(0,s.jsx)(Ir,{icon:hn}):(0,s.jsx)(Ir,{icon:vn});return(0,s.jsxs)("div",{className:"color3Line",children:[(0,s.jsxs)("div",{className:"firstLine",children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,className:"icon"}),(0,s.jsx)("div",{className:"label",title:this.props.label,children:this.props.label}),(0,s.jsx)("div",{className:"color3",children:(0,s.jsx)(to,{lockObject:this.props.lockObject,linearHint:this.props.isLinear,value:this.props.disableAlpha?this._toColor3(this.state.color):this.state.color,onColorChanged:e=>{this.setColorFromString(e)}})}),(0,s.jsx)("div",{className:"copy hoverIcon",onClick:()=>this.copyToClipboard(),title:"Copy to clipboard",children:(0,s.jsx)("img",{src:es,alt:"Copy"})}),(0,s.jsx)("div",{className:"expand hoverIcon",onClick:()=>this.switchExpandState(),title:"Expand",children:e})]}),this.state.isExpanded&&(0,s.jsxs)("div",{className:"secondLine",children:[(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"r",value:this.state.color.r,onChange:e=>this.updateStateR(e)}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"g",value:this.state.color.g,onChange:e=>this.updateStateG(e)}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"b",value:this.state.color.b,onChange:e=>this.updateStateB(e)}),this.props.disableAlpha||(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"a",value:this.state.color.a,onChange:e=>this.updateStateA(e)})]})]})}}class ns extends r.Component{render(){const e=this.props;return(0,s.jsx)(rs,{disableAlpha:!0,...e})}}class os extends r.Component{constructor(e){super(e),this._localChange=!1,this.state={isExpanded:!1,value:this.props.target[this.props.propertyName].clone()}}shouldComponentUpdate(e,t){const r=e.target[e.propertyName];return!(r.equals(t.value)&&!this._localChange||(t.value=r.clone(),this._localChange=!1,0))}switchExpandState(){this._localChange=!0,this.setState({isExpanded:!this.state.isExpanded})}raiseOnPropertyChanged(e){this.props.onChange&&this.props.onChange(this.state.value),this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:this.state.value,initialValue:e})}updateStateX(e){this._localChange=!0;const t=this.state.value.clone();this.props.target[this.props.propertyName].x=e,this.state.value.x=e,this.setState({value:this.state.value}),this.raiseOnPropertyChanged(t)}updateStateY(e){this._localChange=!0;const t=this.state.value.clone();this.props.target[this.props.propertyName].y=e,this.state.value.y=e,this.setState({value:this.state.value}),this.raiseOnPropertyChanged(t)}render(){const e=this.state.isExpanded?(0,s.jsx)(Ir,{icon:hn}):(0,s.jsx)(Ir,{icon:vn});return(0,s.jsxs)("div",{className:"vector3Line",children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,className:"icon"}),(0,s.jsxs)("div",{className:"firstLine",title:this.props.label,children:[(0,s.jsx)("div",{className:"label",children:this.props.label}),(0,s.jsx)("div",{className:"vector",children:`X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}`}),(0,s.jsx)("div",{className:"expand hoverIcon",onClick:()=>this.switchExpandState(),title:"Expand",children:e})]}),this.state.isExpanded&&(0,s.jsxs)("div",{className:"secondLine",children:[(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"x",step:this.props.step,value:this.state.value.x,onChange:e=>this.updateStateX(e)}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"y",step:this.props.step,value:this.state.value.y,onChange:e=>this.updateStateY(e)})]})]})}}os.defaultProps={step:.001};class ss extends r.Component{constructor(e){super(e),this._localChange=!1;const t=this.getCurrentValue();this.state={isExpanded:!1,value:t?t.clone():o.Vector3.Zero()}}getCurrentValue(){return this.props.target[this.props.propertyName]}shouldComponentUpdate(e,t){const r=e.target[e.propertyName];return!(r.equals(t.value)&&!this._localChange||(t.value=r.clone(),this._localChange=!1,0))}switchExpandState(){this._localChange=!0,this.setState({isExpanded:!this.state.isExpanded})}raiseOnPropertyChanged(e){this.props.onChange&&this.props.onChange(this.state.value),this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:this.state.value,initialValue:e})}updateVector3(){const e=this.props.target[this.props.propertyName].clone();this.props.target[this.props.propertyName]=this.state.value,this.setState({value:e}),this.raiseOnPropertyChanged(e)}updateStateX(e){this._localChange=!0,this.state.value.x=e,this.updateVector3()}updateStateY(e){this._localChange=!0,this.state.value.y=e,this.updateVector3()}updateStateZ(e){this._localChange=!0,this.state.value.z=e,this.updateVector3()}render(){const e=this.state.isExpanded?(0,s.jsx)(Ir,{icon:hn}):(0,s.jsx)(Ir,{icon:vn});return(0,s.jsxs)("div",{className:"vector3Line",children:[(0,s.jsxs)("div",{className:"firstLine",children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,className:"icon"}),(0,s.jsx)("div",{className:"label",title:this.props.label,children:this.props.label}),(0,s.jsxs)("div",{className:"vector",children:[!this.props.useEuler&&`X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}`,this.props.useEuler&&`X: ${o.Tools.ToDegrees(this.state.value.x).toFixed(2)}, Y: ${o.Tools.ToDegrees(this.state.value.y).toFixed(2)}, Z: ${o.Tools.ToDegrees(this.state.value.z).toFixed(2)}`]}),(0,s.jsx)("div",{className:"expand hoverIcon",onClick:()=>this.switchExpandState(),title:"Expand",children:e})]}),this.state.isExpanded&&!this.props.useEuler&&(0,s.jsxs)("div",{className:"secondLine",children:[(0,s.jsx)($o,{label:"x",lockObject:this.props.lockObject,step:this.props.step,value:this.state.value.x,onChange:e=>this.updateStateX(e)}),(0,s.jsx)($o,{label:"y",lockObject:this.props.lockObject,step:this.props.step,value:this.state.value.y,onChange:e=>this.updateStateY(e)}),(0,s.jsx)($o,{label:"z",lockObject:this.props.lockObject,step:this.props.step,value:this.state.value.z,onChange:e=>this.updateStateZ(e)})]}),this.state.isExpanded&&this.props.useEuler&&!this.props.noSlider&&(0,s.jsxs)("div",{className:"secondLine",children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,margin:!0,label:"x",minimum:0,maximum:360,step:.1,directValue:o.Tools.ToDegrees(this.state.value.x),onChange:e=>this.updateStateX(o.Tools.ToRadians(e))}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,margin:!0,label:"y",minimum:0,maximum:360,step:.1,directValue:o.Tools.ToDegrees(this.state.value.y),onChange:e=>this.updateStateY(o.Tools.ToRadians(e))}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,margin:!0,label:"z",minimum:0,maximum:360,step:.1,directValue:o.Tools.ToDegrees(this.state.value.z),onChange:e=>this.updateStateZ(o.Tools.ToRadians(e))})]}),this.state.isExpanded&&this.props.useEuler&&this.props.noSlider&&(0,s.jsxs)("div",{className:"secondLine",children:[(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"x",step:this.props.step,value:o.Tools.ToDegrees(this.state.value.x),onChange:e=>this.updateStateX(o.Tools.ToRadians(e))}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"y",step:this.props.step,value:o.Tools.ToDegrees(this.state.value.y),onChange:e=>this.updateStateY(o.Tools.ToRadians(e))}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"z",step:this.props.step,value:o.Tools.ToDegrees(this.state.value.z),onChange:e=>this.updateStateZ(o.Tools.ToRadians(e))})]})]})}}ss.defaultProps={step:.001};class as extends r.Component{constructor(e){super(e),this._localChange=!1;const t=this.props.target[this.props.propertyName].clone();this.state={isExpanded:!1,value:t,eulerValue:t.toEulerAngles()}}_checkRoundCircle(e,t){return Math.abs(o.Tools.ToDegrees(e))+Math.abs(o.Tools.ToDegrees(t))===360}shouldComponentUpdate(e,t){const r=e.target[e.propertyName];return!(r.equals(t.value)&&!this._localChange||(t.value=r.clone(),t.eulerValue=r.toEulerAngles(),this._checkRoundCircle(t.eulerValue.x,this.state.eulerValue.x)&&(t.eulerValue.x=this.state.eulerValue.x),this._checkRoundCircle(t.eulerValue.y,this.state.eulerValue.y)&&(t.eulerValue.y=this.state.eulerValue.y),this._checkRoundCircle(t.eulerValue.z,this.state.eulerValue.z)&&(t.eulerValue.z=this.state.eulerValue.z),this._localChange=!1,0))}switchExpandState(){this._localChange=!0,this.setState({isExpanded:!this.state.isExpanded})}raiseOnPropertyChanged(e,t){this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:e,initialValue:t})}updateQuaternion(){const e=this.props.target[this.props.propertyName].clone();this.props.target[this.props.propertyName]=this.state.value,this.setState({value:e}),this.raiseOnPropertyChanged(this.state.value,e)}updateStateX(e){this._localChange=!0,this.state.value.x=e,this.updateQuaternion()}updateStateY(e){this._localChange=!0,this.state.value.y=e,this.updateQuaternion()}updateStateZ(e){this._localChange=!0,this.state.value.z=e,this.updateQuaternion()}updateStateW(e){this._localChange=!0,this.state.value.w=e,this.updateQuaternion()}updateQuaternionFromEuler(){const e=this.state.eulerValue.toQuaternion();this.state.value.x=e.x,this.state.value.y=e.y,this.state.value.z=e.z,this.state.value.w=e.w,this.updateQuaternion()}updateStateEulerX(e){this._localChange=!0,this.state.eulerValue.x=o.Tools.ToRadians(e),this.updateQuaternionFromEuler()}updateStateEulerY(e){this._localChange=!0,this.state.eulerValue.y=o.Tools.ToRadians(e),this.updateQuaternionFromEuler()}updateStateEulerZ(e){this._localChange=!0,this.state.eulerValue.z=o.Tools.ToRadians(e),this.updateQuaternionFromEuler()}render(){const e=this.state.isExpanded?(0,s.jsx)(Ir,{icon:hn}):(0,s.jsx)(Ir,{icon:vn}),t=this.state.value,r=this.state.eulerValue.clone();return r.x=o.Tools.ToDegrees(r.x),r.y=o.Tools.ToDegrees(r.y),r.z=o.Tools.ToDegrees(r.z),(0,s.jsxs)("div",{className:"vector3Line",children:[(0,s.jsxs)("div",{className:"firstLine",title:this.props.label+" (Using Quaternion)",children:[(0,s.jsx)("div",{className:"label",children:this.props.label+" (Using Quaternion)"}),(0,s.jsxs)("div",{className:"vector",children:[!this.props.useEuler&&`X: ${t.x.toFixed(1)}, Y: ${t.y.toFixed(1)}, Z: ${t.z.toFixed(1)}, W: ${t.w.toFixed(1)}`,this.props.useEuler&&`X: ${r.x.toFixed(2)}, Y: ${r.y.toFixed(2)}, Z: ${r.z.toFixed(2)}`]}),(0,s.jsx)("div",{className:"expand",onClick:()=>this.switchExpandState(),children:e})]}),this.state.isExpanded&&!this.props.useEuler&&(0,s.jsxs)("div",{className:"secondLine",children:[(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"x",value:t.x,onChange:e=>this.updateStateX(e)}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"y",value:t.y,onChange:e=>this.updateStateY(e)}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"z",value:t.z,onChange:e=>this.updateStateZ(e)}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"w",value:t.w,onChange:e=>this.updateStateW(e)})]}),this.state.isExpanded&&this.props.useEuler&&(0,s.jsxs)("div",{className:"secondLine",children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"x",target:r,propertyName:"x",onChange:e=>{this.updateStateEulerX(e)}}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"y",target:r,propertyName:"y",onChange:e=>{this.updateStateEulerY(e)}}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"z",target:r,propertyName:"z",onChange:e=>{this.updateStateEulerZ(e)}})]})]})}}let is=-1;class ls extends r.Component{constructor(e){super(e),this._localChange=!1;const t=this.props.numeric?"0":"";this.state={value:(void 0!==this.props.value?this.props.value:this.props.target[this.props.propertyName])||t,dragging:!1}}componentWillUnmount(){this.props.lockObject&&(this.props.lockObject.lock=!1)}shouldComponentUpdate(e,t){if(this._localChange)return this._localChange=!1,!0;const r=void 0!==e.value?e.value:e.target[e.propertyName];return r!==t.value?(t.value=r||"",!0):t.dragging!=this.state.dragging||e.unit!==this.props.unit}raiseOnPropertyChanged(e,t){this.props.onChange?this.props.onChange(e):this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName,value:e,initialValue:t})}getCurrentNumericValue(e){const t=parseFloat(e);if(!isNaN(t))return t;if(void 0!==this.props.placeholder){const e=parseFloat(this.props.placeholder);if(!isNaN(e))return e}return 0}updateValue(e,t){if(this.props.disabled)return;if(this.props.numbersOnly){if(/[^0-9.\p\x%-]/g.test(e))return;e||(e="0"),0===e.search(/0+[0-9-]/g)&&(e=e.substr(1))}if(this.props.numeric){let t=this.getCurrentNumericValue(e);this.props.roundValues&&(t=Math.round(t)),void 0!==this.props.min&&(t=Math.max(this.props.min,t)),void 0!==this.props.max&&(t=Math.min(this.props.max,t)),e=t.toString()}this._localChange=!0;const r=void 0!==this.props.value?this.props.value:this.props.target[this.props.propertyName];this.props.validator&&t&&0==this.props.validator(t)&&(e=r),this.setState({value:e}),this.props.propertyName&&!this.props.delayInput&&(this.props.target[this.props.propertyName]=e),this.props.throttlePropertyChangedNotification?(is>=0&&window.clearTimeout(is),is=window.setTimeout((()=>{this.raiseOnPropertyChanged(e,r)}),this.props.throttlePropertyChangedNotificationDelay??200)):this.raiseOnPropertyChanged(e,r)}incrementValue(e){if(this.props.step&&(e*=this.props.step),this.props.arrowsIncrement)return void this.props.arrowsIncrement(e);const t=this.getCurrentNumericValue(this.state.value);this.updateValue((t+e).toFixed(2))}onKeyDown(e){!this.props.disabled&&this.props.arrows&&("ArrowUp"===e.key&&(this.incrementValue(1),e.preventDefault()),"ArrowDown"===e.key&&(this.incrementValue(-1),e.preventDefault()))}render(){const e=this.state.value===ro?"":this.state.value,t=this.state.value===ro?ro:this.props.placeholder||"",r=this.props.step||(this.props.roundValues?1:.01),n=this.props.multilines?"textInputArea":void 0!==this.props.unit?"textInputLine withUnits":"textInputLine";return(0,s.jsxs)("div",{className:n,children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,color:"black",className:"icon"}),void 0!==this.props.label&&(0,s.jsx)("div",{className:"label",title:this.props.label,children:this.props.label}),this.props.multilines&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("textarea",{className:this.props.disabled?"disabled":"",value:this.state.value,onFocus:()=>{this.props.lockObject&&(this.props.lockObject.lock=!0)},onChange:e=>this.updateValue(e.target.value),onKeyDown:e=>{13===e.keyCode&&this.updateValue(this.state.value)},onBlur:e=>{this.updateValue(e.target.value,e.target.value),this.props.lockObject&&(this.props.lockObject.lock=!1)},disabled:this.props.disabled})}),!this.props.multilines&&(0,s.jsxs)("div",{className:`value${!0===this.props.noUnderline?" noUnderline":""}${this.props.arrows?" hasArrows":""}${this.state.dragging?" dragging":""}`,children:[(0,s.jsx)("input",{className:this.props.disabled?"disabled":"",value:e,onBlur:e=>{this.props.lockObject&&(this.props.lockObject.lock=!1),this.updateValue((void 0!==this.props.value?this.props.value:this.props.target[this.props.propertyName])||"",e.target.value)},onFocus:()=>{this.props.lockObject&&(this.props.lockObject.lock=!0)},onChange:e=>this.updateValue(e.target.value),onKeyDown:e=>this.onKeyDown(e),placeholder:t,type:this.props.numeric?"number":"text",step:r,disabled:this.props.disabled}),this.props.arrows&&(0,s.jsx)(Qo,{incrementValue:e=>this.incrementValue(e),setDragging:e=>this.setState({dragging:e})})]}),this.props.unit]})}}class ps extends r.Component{constructor(e){super(e),this.state={mode:0}}renderInspectable(e){switch(e.type){case o.InspectableType.Checkbox:return(0,s.jsx)(so,{label:e.label,target:this.props.target,propertyName:e.propertyName,onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.label);case o.InspectableType.Slider:return(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:e.label,target:this.props.target,propertyName:e.propertyName,step:void 0!==e.step?e.step:.1,minimum:void 0!==e.min?e.min:0,maximum:void 0!==e.max?e.max:1,onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.label);case o.InspectableType.Vector2:return(0,s.jsx)(os,{lockObject:this.props.lockObject,label:e.label,target:this.props.target,propertyName:e.propertyName,onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.label);case o.InspectableType.Vector3:return(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:e.label,target:this.props.target,propertyName:e.propertyName,onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.label);case o.InspectableType.Quaternion:return(0,s.jsx)(as,{lockObject:this.props.lockObject,useEuler:this.props.globalState.onlyUseEulers,label:e.label,target:this.props.target,propertyName:e.propertyName,onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.label);case o.InspectableType.Color3:return(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:e.label,target:this.props.target,propertyName:e.propertyName,onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.label);case o.InspectableType.String:return(0,s.jsx)(ls,{label:e.label,lockObject:this.props.lockObject,target:this.props.target,propertyName:e.propertyName,onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.label);case o.InspectableType.Button:return(0,s.jsx)(_n,{label:e.label,onClick:e.callback||function(){console.warn("no call back function added")}},e.label);case o.InspectableType.Options:return(0,s.jsx)(qo,{label:e.label,target:this.props.target,propertyName:e.propertyName,options:e.options||[],onSelect:e.callback||function(e){console.log(`Option ${e} is selected`)}},e.label);case o.InspectableType.Tab:return(0,s.jsx)(Pn,{label:e.label,value:" "},e.label);case o.InspectableType.FileButton:return(0,s.jsx)(zn,{label:e.label,onClick:e.fileCallback||function(){o.Logger.Warn("no file call back function added")},accept:e.accept||"*"},e.label)}return null}render(){const e=this.props.target.inspectableCustomProperties;return e&&0!==e.length?(0,s.jsx)(In,{title:"CUSTOM",selection:this.props.globalState,children:e.map((e=>this.renderInspectable(e)))}):null}}class cs extends r.Component{constructor(e){super(e),this.onBeforeUnloadListener=()=>{this._window&&this._window.close()},this._container=document.createElement("div"),this._container.id=this.props.id,this._window,this.state={isComponentMounted:!1,blockedByBrowser:!1}}componentDidMount(){this.openPopup(),this.setState({isComponentMounted:!0})}openPopup(){const{title:e,size:t,onClose:r,onOpen:n}=this.props,o=`window_${e}`;this._container=Ap._CreatePopup(e,o,t.width,t.height,!0),this._container&&(this._host=this._container.ownerDocument.createElement("div"),this._host.id="host",this._host.style.width="auto",this._container.appendChild(this._host)),this._window=Ap[o],window.addEventListener("beforeunload",this.onBeforeUnloadListener),this._window?(n&&n(this._window),this._window.addEventListener("keyup",(e=>{this.props.onKeyUp&&this.props.onKeyUp(e)})),this._window.addEventListener("keydown",(e=>{this.props.onKeyDown&&this.props.onKeyDown(e)})),this._window.addEventListener("beforeunload",(()=>this._window&&r(this._window))),this._window.addEventListener("resize",(()=>{this.props.onResize&&this._window&&this.props.onResize(this._window)}))):this._window||this.setState({blockedByBrowser:!0},(()=>{this.state.blockedByBrowser&&console.warn("Popup window couldn't be created")}))}componentWillUnmount(){window.removeEventListener("beforeunload",this.onBeforeUnloadListener),this._window&&this._window.close()}getWindow(){return this._window}render(){return this.state.isComponentMounted&&null!==this._container?n.createPortal(this.props.children,this._host):null}}class ds extends r.Component{constructor(e){super(e),this.state={value:this.props.value,isFocused:!1}}_onChange(e){if(this.props.isNumber){const t=parseFloat(e);if(isNaN(t)){if("-"!==e&&""!==e)return}else this.props.onValueAsNumberChanged&&this.props.onValueAsNumberChanged(t,!0),this._lastKnownGoodValue=t.toString()}this._lastKnownGoodValue=e,this.setState({value:e})}_onBlur(){if(this.props.context.focusedInput=!1,this.props.isNumber){const e=parseFloat(this.state.value);isNaN(e)?this.setState({value:this._lastKnownGoodValue,isFocused:!1}):(this.props.onValueAsNumberChanged&&this.props.onValueAsNumberChanged(e,!1),this.setState({value:e.toString(),isFocused:!1}))}else this.setState({isFocused:!1})}_onFocus(){this.props.context.focusedInput=!0,this.setState({isFocused:!0})}shouldComponentUpdate(e,t){return e!==this.props&&(t.value=e.value),!0}_onKeyPress(e){if("Enter"===e.key){const e=parseFloat(this.state.value);isNaN(e)||this.props.onValueAsNumberChanged&&this.props.onValueAsNumberChanged(e,!1)}}render(){return(0,s.jsx)("input",{type:"text",title:this.props.tooltip,onFocus:()=>this._onFocus(),onBlur:()=>this._onBlur(),className:"text-input"+(this.props.className?" "+this.props.className:""),onChange:e=>this._onChange(this.props.complement?e.target.value.replace(this.props.complement,""):e.target.value),onKeyPress:e=>this._onKeyPress(e),value:(this.state.value||"")+(!this.state.isFocused&&this.props.complement?this.props.complement:""),id:this.props.id,disabled:this.props.disabled})}}class hs extends r.Component{constructor(e){super(e),this.state={}}render(){return(0,s.jsxs)("div",{title:this.props.tooltip,className:"control-button"+(this.props.className?" "+this.props.className:""),id:this.props.id,onClick:()=>this.props.onClick(),children:[(0,s.jsx)("img",{className:"control-button-image",src:this.props.icon}),(0,s.jsx)("img",{className:"control-button-hover-image",src:this.props.hoverIcon})]})}}const us="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuMzcsMTYuNDNhLjIuMiwwLDAsMSwuMi4yaDBWMjguMzdhLjIuMiwwLDAsMS0uMi4ySDUuNjNhLjIuMiwwLDAsMS0uMi0uMmgwVjE2LjYzYS4yLjIsMCwwLDEsLjItLjJIMTcuMzdaTTUuNjMsMTUuMjFhMS40NCwxLjQ0LDAsMCwwLTEuNDIsMS40MlYyOC4zN2ExLjQ0LDEuNDQsMCwwLDAsMS40MiwxLjQySDE3LjM3YTEuNDQsMS40NCwwLDAsMCwxLjQyLTEuNDJWMTYuNjNhMS40NCwxLjQ0LDAsMCwwLTEuNDItMS40MloiIHN0eWxlPSJmaWxsOiM4YzJmMmYiLz48L3N2Zz4=",bs="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNS42MywxNS4yMWExLjQ0LDEuNDQsMCwwLDAtMS40MiwxLjQyVjI4LjM3YTEuNDQsMS40NCwwLDAsMCwxLjQyLDEuNDJIMTcuMzdhMS40NCwxLjQ0LDAsMCwwLDEuNDItMS40MlYxNi42M2ExLjQ0LDEuNDQsMCwwLDAtMS40Mi0xLjQyWiIgc3R5bGU9ImZpbGw6I2MxMmQyZCIvPjwvc3ZnPg==";class gs extends r.Component{constructor(e){super(e),this._isMounted=!1,this.state={},this.props.context.onAnimationStateChanged.add((()=>{this._isMounted&&this.forceUpdate()}))}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}_onFirstKey(){this.props.context.onMoveToFrameRequired.notifyObservers(this.props.context.fromKey)}_onPrevKey(){const e=this.props.context.getPrevKey();null!==e&&this.props.context.onMoveToFrameRequired.notifyObservers(e)}_onRewind(){this.props.context.play(!1),this.forceUpdate()}_onForward(){this.props.context.play(!0),this.forceUpdate()}_onPrevFrame(){this.props.context.onMoveToFrameRequired.notifyObservers(Math.max(0,this.props.context.activeFrame-1))}_onNextFrame(){this.props.context.onMoveToFrameRequired.notifyObservers(this.props.context.activeFrame+1)}_onNextKey(){const e=this.props.context.getNextKey();null!==e&&this.props.context.onMoveToFrameRequired.notifyObservers(e)}_onEndKey(){this.props.context.onMoveToFrameRequired.notifyObservers(this.props.context.toKey)}_onStop(){this.props.context.stop(),this.forceUpdate()}render(){return(0,s.jsxs)("div",{id:"media-player",children:[(0,s.jsx)(hs,{tooltip:"Rewind to the first frame of the selected timeline",id:"start-key",context:this.props.context,globalState:this.props.globalState,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTIuMzIsMTYuNzl2NC4xNGw1Ljk0LTQuNjJhLjYxLjYxLDAsMCwxLC44Ni4wOC42My42MywwLDAsMSwuMTQuNFYyOC4yMWEuNjEuNjEsMCwwLDEtLjYuNjIuNjMuNjMsMCwwLDEtLjQtLjE0bC01Ljk0LTQuNjJ2NC4xNGEuNjEuNjEsMCwwLDEtLjYuNjIuNjMuNjMsMCwwLDEtLjQtLjE0TDQsMjNhLjYxLjYxLDAsMCwxLS4xNS0uODVBLjU0LjU0LDAsMCwxLDQsMjJsNy4zNS01LjcxYS42MS42MSwwLDAsMSwuODUuMTNBLjYzLjYzLDAsMCwxLDEyLjMyLDE2Ljc5Wm0tNyw1LjcxTDExLjA5LDI3VjE4Wm03LDBoMEwxOCwyN1YxOFoiIHN0eWxlPSJmaWxsOiM4ODgiLz48L3N2Zz4=",hoverIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTEuMzMsMTYuMzEsNCwyMmEuNjEuNjEsMCwwLDAtLjE1Ljg1QS41NC41NCwwLDAsMCw0LDIzbDcuMzUsNS43MWEuNjEuNjEsMCwwLDAsLjg2LS4wOC42My42MywwLDAsMCwuMTQtLjRWMjQuMDdsNS45NCw0LjYyYS42MS42MSwwLDAsMCwuODYtLjA4LjYzLjYzLDAsMCwwLC4xNC0uNFYxNi43OWEuNjEuNjEsMCwwLDAtLjYtLjYyLjYzLjYzLDAsMCwwLS40LjE0bC01Ljk0LDQuNjJWMTYuNzlhLjYxLjYxLDAsMCwwLTEtLjQ4WiIgc3R5bGU9ImZpbGw6I2NjYyIvPjwvc3ZnPg==",onClick:()=>this._onFirstKey()}),(0,s.jsx)(hs,{tooltip:"Rewind to the previous frame",id:"prev-frame",context:this.props.context,globalState:this.props.globalState,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cGF0aCBkPSJNOC4wNywyMS43MmExLjQyLDEuNDIsMCwwLDAtLjMyLDIsMS40NCwxLjQ0LDAsMCwwLC4zOC4zNmw4LjQ3LDUuNDNhMS40MiwxLjQyLDAsMCwwLDItLjQ0LDEuNCwxLjQsMCwwLDAsLjIyLS43NVYxNi44YTEuNDMsMS40MywwLDAsMC0xLjQzLTEuNDEsMS4zOSwxLjM5LDAsMCwwLS44MS4yNlptOS40OSw2LjU4YS4yLjIsMCwwLDEtLjMxLjE3TDguNzksMjNhLjIyLjIyLDAsMCwxLDAtLjI5bDAtLjA1LDguNDYtNi4wN2EuMi4yLDAsMCwxLC4yOCwwLC4yLjIsMCwwLDEsMCwuMTNabS0xMy4zNC44N2EuNjEuNjEsMCwwLDAsMS4yMiwwVjE1LjgzYS42MS42MSwwLDAsMC0xLjIyLDBoMFoiIHN0eWxlPSJmaWxsOiM4ODgiLz48L3N2Zz4=",hoverIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTguNzgsMjguM2ExLjQzLDEuNDMsMCwwLDEtMS40MywxLjQxLDEuNCwxLjQsMCwwLDEtLjc1LS4yMkw4LjEzLDI0LjA2YTEuNDIsMS40MiwwLDAsMS0uNDItMiwxLjQ1LDEuNDUsMCwwLDEsLjM2LS4zOGw4LjQ3LTYuMDdhMS40MiwxLjQyLDAsMCwxLDIsLjM0LDEuMzksMS4zOSwwLDAsMSwuMjYuODFaIiBzdHlsZT0iZmlsbDojY2NjIi8+PHBhdGggZD0iTTQuMjIsMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFYxNS44M2EuNjEuNjEsMCwwLDAtMS4yMiwwaDBaIiBzdHlsZT0iZmlsbDojY2NjIi8+PC9zdmc+",onClick:()=>this._onPrevFrame()}),(0,s.jsx)(hs,{tooltip:"Rewind to the previous key frame",id:"first-key",context:this.props.context,globalState:this.props.globalState,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNOC4wNywyMS43MmExLjQyLDEuNDIsMCwwLDAtLjMyLDIsMS40NCwxLjQ0LDAsMCwwLC4zOC4zNmw4LjQ3LDUuNDNhMS40MiwxLjQyLDAsMCwwLDItLjQ0LDEuNCwxLjQsMCwwLDAsLjIyLS43NVYxNi44YTEuNDMsMS40MywwLDAsMC0xLjQzLTEuNDEsMS4zOSwxLjM5LDAsMCwwLS44MS4yNlptOS40OSw2LjU4YS4yLjIsMCwwLDEtLjMxLjE3TDguNzksMjNhLjIyLjIyLDAsMCwxLDAtLjI5bDAtLjA1LDguNDYtNi4wN2EuMi4yLDAsMCwxLC4yOCwwLC4yLjIsMCwwLDEsMCwuMTNaIiBzdHlsZT0iZmlsbDojODg4Ii8+PHBhdGggZD0iTTQuMjIsMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFYxNS44M2EuNjEuNjEsMCwwLDAtMS4yMiwwaDBaIiBzdHlsZT0iZmlsbDojZmZjMDE3Ii8+PHBhdGggZD0iTTMuNDgsMjUuOTFhMS4zNSwxLjM1LDAsMSwwLDIuNywwVjE5LjA5YTEuMzUsMS4zNSwwLDEsMC0yLjcsMGgwWiIgc3R5bGU9ImZpbGw6I2ZmYzAxNyIvPjwvc3ZnPg==",hoverIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTguNzgsMjguM2ExLjQzLDEuNDMsMCwwLDEtMS40MywxLjQxLDEuNCwxLjQsMCwwLDEtLjc1LS4yMkw4LjEzLDI0LjA2YTEuNDIsMS40MiwwLDAsMS0uNDItMiwxLjQ1LDEuNDUsMCwwLDEsLjM2LS4zOGw4LjQ3LTYuMDdhMS40MiwxLjQyLDAsMCwxLDIsLjM0LDEuMzksMS4zOSwwLDAsMSwuMjYuODFaIiBzdHlsZT0iZmlsbDojY2NjIi8+PHBhdGggZD0iTTQuMjIsMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFYxNS44M2EuNjEuNjEsMCwwLDAtMS4yMiwwaDBaIiBzdHlsZT0iZmlsbDojZmZjMDE3Ii8+PHBhdGggZD0iTTMuNDgsMjUuOTFhMS4zNSwxLjM1LDAsMSwwLDIuNywwVjE5LjA5YTEuMzUsMS4zNSwwLDEsMC0yLjcsMGgwWiIgc3R5bGU9ImZpbGw6I2ZmYzAxNyIvPjwvc3ZnPg==",onClick:()=>this._onPrevKey()}),(this.props.context.isPlaying&&this.props.context.forwardAnimation||!this.props.context.isPlaying)&&(0,s.jsx)(hs,{tooltip:"Play backwards",id:"rev-key",context:this.props.context,globalState:this.props.globalState,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNi4yOCwyMmEuNi42LDAsMCwwLDAsMS4wNmw5Ljg3LDUuMzZhLjU5LjU5LDAsMCwwLC44LS4yMi42NC42NCwwLDAsMCwuMDgtLjNWMTcuMTNhLjYuNiwwLDAsMC0uNTgtLjYuNjEuNjEsMCwwLDAtLjMuMDhabTEyLDUuOWExLjc5LDEuNzksMCwwLDEtMS44MSwxLjc5LDEuNzcsMS43NywwLDAsMS0uODQtLjIxbC05LjkyLTUuNEExLjgxLDEuODEsMCwwLDEsNSwyMS42NGExLjg1LDEuODUsMCwwLDEsLjcyLS43Mmw5Ljg3LTUuMzdhMS44LDEuOCwwLDAsMSwyLjQ0Ljc0LDEuNzcsMS43NywwLDAsMSwuMjEuODRaIiBzdHlsZT0iZmlsbDojODg4Ii8+PC9zdmc+",hoverIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTguMjMsMjcuODdhMS43OSwxLjc5LDAsMCwxLTEuODEsMS43OSwxLjc3LDEuNzcsMCwwLDEtLjg0LS4yMUw1LjcxLDI0LjA4QTEuODEsMS44MSwwLDAsMSw1LDIxLjY0YTEuODUsMS44NSwwLDAsMSwuNzItLjcybDkuODctNS4zN2ExLjgsMS44LDAsMCwxLDIuNDQuNzQsMS43NywxLjc3LDAsMCwxLC4yMS44NFoiIHN0eWxlPSJmaWxsOiNjY2MiLz48L3N2Zz4=",onClick:()=>this._onRewind()}),this.props.context.isPlaying&&!this.props.context.forwardAnimation&&(0,s.jsx)(hs,{tooltip:"Stop",id:"stop-key",context:this.props.context,globalState:this.props.globalState,icon:us,hoverIcon:bs,onClick:()=>this._onStop()}),(this.props.context.isPlaying&&!this.props.context.forwardAnimation||!this.props.context.isPlaying)&&(0,s.jsx)(hs,{tooltip:"Play forwards",id:"fwd-key",context:this.props.context,globalState:this.props.globalState,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNi44NSwxNi42MWEuNTkuNTksMCwwLDAtLjguMjIuNjQuNjQsMCwwLDAtLjA4LjNWMjcuODdhLjYuNiwwLDAsMCwuNTguNi42MS42MSwwLDAsMCwuMy0uMDhMMTYuNzIsMjNhLjYuNiwwLDAsMCwwLTEuMDZabS0yLjA4LjUyYTEuNzksMS43OSwwLDAsMSwxLjgxLTEuNzksMS43NywxLjc3LDAsMCwxLC44NC4yMWw5Ljg3LDUuMzdBMS44MSwxLjgxLDAsMCwxLDE4LDIzLjM2YTEuODUsMS44NSwwLDAsMS0uNzIuNzJMNy40MiwyOS40NUExLjgsMS44LDAsMCwxLDUsMjguNzFhMS43NywxLjc3LDAsMCwxLS4yMS0uODRaIiBzdHlsZT0iZmlsbDojODg4Ii8+PC9zdmc+",hoverIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNC43NywxNy4xM2ExLjc5LDEuNzksMCwwLDEsMS44MS0xLjc5LDEuNzcsMS43NywwLDAsMSwuODQuMjFsOS44Nyw1LjM3QTEuODEsMS44MSwwLDAsMSwxOCwyMy4zNmExLjg1LDEuODUsMCwwLDEtLjcyLjcyTDcuNDIsMjkuNDVBMS44LDEuOCwwLDAsMSw1LDI4LjcxYTEuNzcsMS43NywwLDAsMS0uMjEtLjg0WiIgc3R5bGU9ImZpbGw6I2NjYyIvPjwvc3ZnPg==",onClick:()=>this._onForward()}),this.props.context.isPlaying&&this.props.context.forwardAnimation&&(0,s.jsx)(hs,{tooltip:"Stop",id:"stop-key",context:this.props.context,globalState:this.props.globalState,icon:us,hoverIcon:bs,onClick:()=>this._onStop()}),(0,s.jsx)(hs,{tooltip:"Advance to the next key frame",id:"next-key",context:this.props.context,globalState:this.props.globalState,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNi40NiwxNS42NWExLjQyLDEuNDIsMCwwLDAtMiwuMzQsMS4zOSwxLjM5LDAsMCwwLS4yNi44MVYyOC4zYTEuNDMsMS40MywwLDAsMCwxLjQzLDEuNDEsMS40LDEuNCwwLDAsMCwuNzUtLjIybDguNDctNS40M2ExLjQyLDEuNDIsMCwwLDAsLjQyLTIsMS40NSwxLjQ1LDAsMCwwLS4zNi0uMzhabS0xLDEuMTVhLjIuMiwwLDAsMSwuMzItLjE3bDguNDYsNi4wN2EuMjIuMjIsMCwwLDEsMCwuMjlzMCwwLDAsLjA1TDUuNzUsMjguNDdhLjIuMiwwLDAsMS0uMjgtLjA2LjIuMiwwLDAsMSwwLS4xMVoiIHN0eWxlPSJmaWxsOiM4ODgiLz48cGF0aCBkPSJNMTcuNTYsMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFYxNS44M2EuNjEuNjEsMCwwLDAtMS4yMiwwaDBaIiBzdHlsZT0iZmlsbDojZmZjMDE3Ii8+PHBhdGggZD0iTTE2LjgyLDI1LjkxYTEuMzUsMS4zNSwwLDAsMCwyLjcsMFYxOS4wOWExLjM1LDEuMzUsMCwxLDAtMi43LDBoMFoiIHN0eWxlPSJmaWxsOiNmZmMwMTciLz48L3N2Zz4=",hoverIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNC4yMiwxNi44YTEuNDMsMS40MywwLDAsMSwxLjQzLTEuNDEsMS4zOSwxLjM5LDAsMCwxLC44MS4yNmw4LjQ3LDYuMDdhMS40MiwxLjQyLDAsMCwxLC4zMiwyLDEuNDQsMS40NCwwLDAsMS0uMzguMzZMNi40LDI5LjQ5YTEuNDIsMS40MiwwLDAsMS0yLS40NCwxLjQsMS40LDAsMCwxLS4yMi0uNzVaIiBzdHlsZT0iZmlsbDojY2NjIi8+PHBhdGggZD0iTTE3LjU2LDI5LjE3YS42MS42MSwwLDAsMCwxLjIyLDBWMTUuODNhLjYxLjYxLDAsMCwwLTEuMjIsMGgwWiIgc3R5bGU9ImZpbGw6I2ZmYzAxNyIvPjxwYXRoIGQ9Ik0xNi44MiwyNS45MWExLjM1LDEuMzUsMCwwLDAsMi43LDBWMTkuMDlhMS4zNSwxLjM1LDAsMSwwLTIuNywwaDBaIiBzdHlsZT0iZmlsbDojZmZjMDE3Ii8+PC9zdmc+",onClick:()=>this._onNextKey()}),(0,s.jsx)(hs,{tooltip:"Advance to the next frame",id:"next-frame",context:this.props.context,globalState:this.props.globalState,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNi40NiwxNS42NWExLjQyLDEuNDIsMCwwLDAtMiwuMzQsMS4zOSwxLjM5LDAsMCwwLS4yNi44MVYyOC4zYTEuNDMsMS40MywwLDAsMCwxLjQzLDEuNDEsMS40LDEuNCwwLDAsMCwuNzUtLjIybDguNDctNS40M2ExLjQyLDEuNDIsMCwwLDAsLjQyLTIsMS40NSwxLjQ1LDAsMCwwLS4zNi0uMzhabS0xLDEuMTVhLjIuMiwwLDAsMSwuMzItLjE3bDguNDYsNi4wN2EuMjIuMjIsMCwwLDEsMCwuMjlzMCwwLDAsLjA1TDUuNzUsMjguNDdhLjIuMiwwLDAsMS0uMjgtLjA2LjIuMiwwLDAsMSwwLS4xMVoiIHN0eWxlPSJmaWxsOiM4ODgiLz48cGF0aCBkPSJNMTcuNTYsMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFYxNS44M2EuNjEuNjEsMCwwLDAtMS4yMiwwaDBaIiBzdHlsZT0iZmlsbDojODg4Ii8+PC9zdmc+",hoverIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNNC4yMiwxNi44YTEuNDMsMS40MywwLDAsMSwxLjQzLTEuNDEsMS4zOSwxLjM5LDAsMCwxLC44MS4yNmw4LjQ3LDYuMDdhMS40MiwxLjQyLDAsMCwxLC4zMiwyLDEuNDQsMS40NCwwLDAsMS0uMzguMzZMNi40LDI5LjQ5YTEuNDIsMS40MiwwLDAsMS0yLS40NCwxLjQsMS40LDAsMCwxLS4yMi0uNzVaIiBzdHlsZT0iZmlsbDojY2NjIi8+PHBhdGggZD0iTTE4Ljc4LDE1LjgzYS42MS42MSwwLDAsMC0xLjIyLDBWMjkuMTdhLjYxLjYxLDAsMCwwLDEuMjIsMFoiIHN0eWxlPSJmaWxsOiNjY2MiLz48L3N2Zz4=",onClick:()=>this._onNextFrame()}),(0,s.jsx)(hs,{tooltip:"Advance to the last frame of the selected timeline",id:"end-key",context:this.props.context,globalState:this.props.globalState,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTEuNjcsMTYuMzEsMTksMjJhLjYxLjYxLDAsMCwxLC4xNS44NUEuNTQuNTQsMCwwLDEsMTksMjNsLTcuMzUsNS43MWEuNjEuNjEsMCwwLDEtLjg2LS4wOC42My42MywwLDAsMS0uMTQtLjRWMjQuMDdMNC43NCwyOC42OWEuNjEuNjEsMCwwLDEtLjg2LS4wOC42My42MywwLDAsMS0uMTQtLjRWMTYuNzlhLjYxLjYxLDAsMCwxLC42LS42Mi42My42MywwLDAsMSwuNC4xNGw1Ljk0LDQuNjJWMTYuNzlhLjYxLjYxLDAsMCwxLC42MS0uNjFBLjU4LjU4LDAsMCwxLDExLjY3LDE2LjMxWk0xMS45MSwxOHY5bDUuNzMtNC40NlpNNSwxOHY5bDUuNzEtNC40NGgwWiIgc3R5bGU9ImZpbGw6Izg4OCIvPjwvc3ZnPg==",hoverIcon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMyIgaGVpZ2h0PSI0NSIgdmlld0JveD0iMCAwIDIzIDQ1Ij48cmVjdCB3aWR0aD0iMjMiIGhlaWdodD0iNDUiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTEuNjcsMTYuMzEsMTksMjJhLjYxLjYxLDAsMCwxLC4xNS44NUEuNTQuNTQsMCwwLDEsMTksMjNsLTcuMzUsNS43MWEuNjEuNjEsMCwwLDEtLjg2LS4wOC42My42MywwLDAsMS0uMTQtLjRWMjQuMDdMNC43NCwyOC42OWEuNjEuNjEsMCwwLDEtLjg2LS4wOC42My42MywwLDAsMS0uMTQtLjRWMTYuNzlhLjYxLjYxLDAsMCwxLC42LS42Mi42My42MywwLDAsMSwuNC4xNGw1Ljk0LDQuNjJWMTYuNzlhLjYxLjYxLDAsMCwxLC42MS0uNjFBLjU4LjU4LDAsMCwxLDExLjY3LDE2LjMxWiIgc3R5bGU9ImZpbGw6I2NjYyIvPjwvc3ZnPg==",onClick:()=>this._onEndKey()})]})}}const ms="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMSIgdmlld0JveD0iMCAwIDIwIDIxIj48cmVjdCB3aWR0aD0iMjAiIGhlaWdodD0iMjEiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTMuNjgsMTcuMzlWMy42MUEuNi42LDAsMCwxLDE0LjMyLDNhLjYxLjYxLDAsMCwxLC41Ny41VjE3LjM5YS42MS42MSwwLDEsMS0xLjIyLjA4Wm0tNC4yOSwwVjMuNjFBLjYxLjYxLDAsMCwxLDEwLDNhLjYyLjYyLDAsMCwxLC42MS41M1YxNy4zOUEuNi42LDAsMCwxLDEwLDE4YS42MS42MSwwLDAsMS0uNTctLjVabS00LjI5LDBWMy42MWEuNjEuNjEsMCwwLDEsMS4yMi0uMDhWMTcuMzlhLjYuNiwwLDAsMS0uNjQuNTguNjEuNjEsMCwwLDEtLjU3LS41WiIgc3R5bGU9ImZpbGw6IzMzMyIvPjwvc3ZnPg==";class As extends r.Component{constructor(e){super(e),this._viewWidth=748,this.state={},this._rangeHost=r.createRef(),this._rangeScrollbarHost=r.createRef(),this.props.context.onHostWindowResized.add((()=>{this._computeSizes()})),this.props.context.onFrameSet.add((()=>{this.forceUpdate()})),this.props.context.onAnimationsLoaded.add((()=>{this.forceUpdate()})),this._updateLimits()}_computeSizes(){this._rangeHost.current&&(this._viewWidth=this._rangeHost.current.clientWidth-4,this.forceUpdate())}_onPointerDown(e){this._bothHandleIsActive=!1,"left-handle"===e.nativeEvent.target.id?this._leftHandleIsActive=!0:"right-handle"===e.nativeEvent.target.id?this._leftHandleIsActive=!1:(this._bothHandleIsActive=!0,this._currentOffset=e.nativeEvent.clientX,this._currentFrom=this.props.context.fromKey,this._currentTo=this.props.context.toKey),this._pointerIsDown=!0,e.currentTarget.setPointerCapture(e.pointerId)}_onPointerMove(e){if(!this._pointerIsDown)return;if(!this.props.context.animations||!this.props.context.animations.length)return;this._updateLimits();let t=e.nativeEvent.offsetX;this._bothHandleIsActive&&(t=e.nativeEvent.clientX-this._currentOffset);let r=t/this._viewWidth*(this._maxFrame-this._minFrame);const n=Math.min(this._maxFrame,Math.max(this._minFrame,Math.round(this._minFrame+r)));this._bothHandleIsActive?(this._currentTo+r>this._maxFrame&&(r=this._maxFrame-this._currentTo),this._currentFrom+rthis._maxFrame&&(this.props.context.toKey=this._maxFrame),(0,s.jsx)("div",{id:"range-selector",ref:this._rangeHost,onPointerDown:e=>this._onPointerDown(e),onPointerMove:e=>this._onPointerMove(e),onPointerUp:e=>this._onPointerUp(e),children:(0,s.jsxs)("div",{id:"range-scrollbar",ref:this._rangeScrollbarHost,style:{left:2+(this.props.context.fromKey-this._minFrame)/e*this._viewWidth+"px",right:2+(this._maxFrame-this.props.context.toKey)/e*this._viewWidth+"px"},children:[(0,s.jsx)("div",{id:"left-handle",className:"handle",children:(0,s.jsx)("img",{src:ms})}),(0,s.jsx)("div",{id:"from-key",children:0|this.props.context.fromKey}),(0,s.jsx)("div",{id:"to-key",children:0|this.props.context.toKey}),(0,s.jsx)("div",{id:"right-handle",className:"handle",children:(0,s.jsx)("img",{src:ms})})]})})}}var Cs=p(7452),fs={};fs.styleTagTransform=Xn(),fs.setAttributes=Zn(),fs.insert=Wn().bind(null,"head"),fs.domAPI=Hn(),fs.insertStyleElement=Jn(),Gn()(Cs.Z,fs),Cs.Z&&Cs.Z.locals&&Cs.Z.locals;class xs extends r.Component{constructor(e){super(e),this.state={clipLength:this.props.context.clipLength?this.props.context.clipLength.toFixed(0):this.props.context.referenceMaxFrame.toFixed(0)},this._onAnimationsLoadedObserver=this.props.context.onAnimationsLoaded.add((()=>{this.forceUpdate()})),this._onActiveAnimationChangedObserver=this.props.context.onActiveAnimationChanged.add((()=>{this.forceUpdate()})),this._onClipLengthIncreasedObserver=this.props.context.onClipLengthIncreased.add((e=>{this.props.context.clipLength=e,this.props.context.onMoveToFrameRequired.notifyObservers(e),null!==this.props.context.getKeyAtAnyFrameIndex(e)||this.props.context.onCreateOrUpdateKeyPointRequired.notifyObservers(),this.setState({clipLength:e.toFixed(0)})})),this._onClipLengthIncreasedObserver=this.props.context.onClipLengthDecreased.add((e=>{this.props.context.clipLength=e,this.props.context.onMoveToFrameRequired.notifyObservers(e),null!==this.props.context.getKeyAtAnyFrameIndex(e)||this.props.context.onCreateOrUpdateKeyPointRequired.notifyObservers(),this.props.context.toKey=Math.min(this.props.context.toKey,this.props.context.clipLength),this.props.context.onRangeUpdated.notifyObservers(),this.setState({clipLength:e.toFixed(0)})}))}_changeClipLength(e){const t=this.props.context.clipLength||this.props.context.referenceMaxFrame;te&&this.props.context.onClipLengthDecreased.notifyObservers(e),this.setState({clipLength:e.toFixed(0)})}componentWillUnmount(){this._onAnimationsLoadedObserver&&this.props.context.onAnimationsLoaded.remove(this._onAnimationsLoadedObserver),this._onActiveAnimationChangedObserver&&this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver),this._onClipLengthDecreasedObserver&&this.props.context.onClipLengthDecreased.remove(this._onClipLengthDecreasedObserver),this._onClipLengthIncreasedObserver&&this.props.context.onClipLengthDecreased.remove(this._onClipLengthIncreasedObserver)}render(){return(0,s.jsxs)("div",{id:"bottom-bar",children:[(0,s.jsx)(gs,{globalState:this.props.globalState,context:this.props.context}),(0,s.jsx)(As,{globalState:this.props.globalState,context:this.props.context}),this.props.context.activeAnimations.length>0&&(0,s.jsx)("div",{id:"bottom-bar-total",children:(0,s.jsx)(ds,{isNumber:!0,value:this.state.clipLength,tooltip:"Clip Length",id:"clip-range",onValueAsNumberChanged:(e,t)=>{!t&&this._changeClipLength(e)},globalState:this.props.globalState,context:this.props.context})})]})}}class vs extends r.Component{constructor(e){super(e),this.state={}}render(){return(0,s.jsx)("div",{title:this.props.tooltip,className:"action-button"+(this.props.isActive?" active":"")+(this.props.className?" "+this.props.className:""),id:this.props.id,onClick:()=>this.props.onClick(),children:(0,s.jsx)("img",{className:"action-button-image",src:this.props.icon})})}}var ys=p(9388),js={};js.styleTagTransform=Xn(),js.setAttributes=Zn(),js.insert=Wn().bind(null,"head"),js.domAPI=Hn(),js.insertStyleElement=Jn(),Gn()(ys.Z,js),ys.Z&&ys.Z.locals&&ys.Z.locals;class Os extends r.Component{constructor(e){super(e),this.state={keyFrameValue:"",keyValue:"",frameControlEnabled:!1,valueControlEnabled:!1},this._onFrameSetObserver=this.props.context.onFrameSet.add((e=>{this.setState({keyFrameValue:e.toFixed(0)})})),this._onValueSetObserver=this.props.context.onValueSet.add((e=>{this.setState({keyValue:e.toFixed(2)})})),this._onActiveAnimationChangedObserver=this.props.context.onActiveAnimationChanged.add((()=>{this.setState({keyFrameValue:"",keyValue:""})})),this._onActiveKeyPointChanged=this.props.context.onActiveKeyPointChanged.add((()=>{const e=this.props.context.activeKeyPoints?.length||0,t=new Set(this.props.context.activeKeyPoints?.map((e=>e.props.curve.animation.uniqueId))).size,r=1===e&&1===t||e>1&&t>1,n=e>0,o=this.props.context.hasActiveQuaternionAnimationKeyPoints();this.setState({keyFrameValue:"",keyValue:"",frameControlEnabled:r&&!o,valueControlEnabled:n&&!o})}))}componentWillUnmount(){this._onFrameSetObserver&&this.props.context.onFrameSet.remove(this._onFrameSetObserver),this._onValueSetObserver&&this.props.context.onValueSet.remove(this._onValueSetObserver),this._onActiveAnimationChangedObserver&&this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver),this._onActiveKeyPointChanged&&this.props.context.onActiveKeyPointChanged.remove(this._onActiveKeyPointChanged)}render(){const e=this.props.context.activeAnimations.length>0;return(0,s.jsxs)("div",{id:"top-bar",children:[(0,s.jsx)("img",{id:"top-bar-logo",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cG9seWdvbiBwb2ludHM9IjIyLjE0IDcuNTcgMTEuMzcgMTMuNzggMTEuMzcgMjYuMjIgMjIuMTQgMzIuNDQgMzIuOTEgMjYuMjIgMzIuOTEgMTMuNzggMjIuMTQgNy41NyIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxyZWN0IHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgc3R5bGU9ImZpbGw6bm9uZSIvPjxwb2x5Z29uIHBvaW50cz0iMzIuOTEgMTMuNzggMjkuNTQgMTEuODQgMjYuMjkgMTMuNzEgMjkuNjYgMTUuNjUgMzIuOTEgMTMuNzgiIHN0eWxlPSJmaWxsOiNlMDY4NGIiLz48cG9seWdvbiBwb2ludHM9IjE0LjYxIDE1LjY1IDI1LjM4IDkuNDQgMjIuMTQgNy41NyAxMS4zNyAxMy43OCAxNC42MSAxNS42NSIgc3R5bGU9ImZpbGw6I2UwNjg0YiIvPjxwb2x5Z29uIHBvaW50cz0iMTguNzcgMjEuOTUgMjIuMTQgMjMuODkgMjUuNTEgMjEuOTUgMjIuMTQgMjAgMTguNzcgMjEuOTUiIHN0eWxlPSJmaWxsOiNlMDY4NGIiLz48cG9seWdvbiBwb2ludHM9IjI5LjY2IDE1LjY1IDI5LjY2IDI0LjM0IDIyLjE0IDI4LjY5IDE0LjYxIDI0LjM0IDE0LjYxIDE1LjY1IDExLjM3IDEzLjc4IDExLjM3IDI2LjIyIDIyLjE0IDMyLjQ0IDMyLjkxIDI2LjIyIDMyLjkxIDEzLjc4IDI5LjY2IDE1LjY1IiBzdHlsZT0iZmlsbDojYmI0NjRiIi8+PHBvbHlnb24gcG9pbnRzPSIyMi4xNCAxNi4xMSAxOC43NyAxOC4wNSAxOC43NyAyMS45NSAyMi4xNCAyMCAyNS41MSAyMS45NSAyNS41MSAxOC4wNSAyMi4xNCAxNi4xMSIgc3R5bGU9ImZpbGw6I2JiNDY0YiIvPjxwb2x5Z29uIHBvaW50cz0iMjkuNjYgMTUuNjUgMjUuNTEgMTguMDUgMjUuNTEgMjEuOTUgMjIuMTQgMjMuODkgMjIuMTQgMjguNjkgMjkuNjYgMjQuMzQgMjkuNjYgMTUuNjUiIHN0eWxlPSJmaWxsOiNlMGRlZDgiLz48cG9seWdvbiBwb2ludHM9IjE0LjYxIDE1LjY1IDE4Ljc3IDE4LjA1IDE4Ljc3IDIxLjk1IDIyLjE0IDIzLjg5IDIyLjE0IDI4LjY5IDE0LjYxIDI0LjM0IDE0LjYxIDE1LjY1IiBzdHlsZT0iZmlsbDojZDVkMmNhIi8+PHBvbHlnb24gcG9pbnRzPSIyNS4zOCA5LjQ0IDI5LjU0IDExLjg0IDI2LjI5IDEzLjcxIDI5LjY2IDE1LjY1IDI1LjUxIDE4LjA1IDIyLjE0IDE2LjExIDE4Ljc3IDE4LjA1IDE0LjYxIDE1LjY1IDI1LjM4IDkuNDQiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4="}),(0,s.jsx)("div",{id:"top-bar-parent-name",children:this.props.context.title}),(0,s.jsx)(ds,{className:e&&this.state.frameControlEnabled?"":"disabled",isNumber:!0,value:this.state.keyFrameValue,tooltip:"Frame",id:"key-frame",onValueAsNumberChanged:e=>{0!==e&&this.props.context.onFrameManuallyEntered.notifyObservers(e)},globalState:this.props.globalState,context:this.props.context,disabled:0===parseFloat(this.state.keyFrameValue)}),(0,s.jsx)(ds,{className:e&&this.state.valueControlEnabled?"":"disabled",isNumber:!0,value:this.state.keyValue,tooltip:"Value",id:"key-value",onValueAsNumberChanged:e=>this.props.context.onValueManuallyEntered.notifyObservers(e),globalState:this.props.globalState,context:this.props.context}),(0,s.jsx)(vs,{className:e?"":"disabled",tooltip:"New key",id:"new-key",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjEuODMsMTQuODNsMy4zNCwzLjM0YTIuNTksMi41OSwwLDAsMSwwLDMuNjZsLTMuMzQsMy4zNGEyLjU5LDIuNTksMCwwLDEtMy42NiwwbC0zLjM0LTMuMzRhMi41OSwyLjU5LDAsMCwxLDAtMy42NmwzLjM0LTMuMzRBMi41OSwyLjU5LDAsMCwxLDIxLjgzLDE0LjgzWk0xOSwxNS42OCwxNS42OCwxOWExLjM3LDEuMzcsMCwwLDAtLjA2LDEuOTRsLjA2LjA2TDE5LDI0LjMyYTEuMzcsMS4zNywwLDAsMCwxLjk0LjA2bC4wNi0uMDZMMjQuMzIsMjFhMS4zNywxLjM3LDAsMCwwLC4wNi0xLjk0TDI0LjMyLDE5LDIxLDE1LjY4YTEuMzcsMS4zNywwLDAsMC0xLjk0LS4wNloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>this.props.context.onCreateOrUpdateKeyPointRequired.notifyObservers()}),(0,s.jsx)(vs,{tooltip:"Frame canvas",id:"frame-canvas",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMTQuMDUsMTVhMSwxLDAsMCwxLDEtMWgxLjU5YS42LjYsMCwwLDAsLjU5LS42LjU4LjU4LDAsMCwwLS41OS0uNTlIMTVBMi4xOCwyLjE4LDAsMCwwLDEyLjg2LDE1djEuNTlhLjU4LjU4LDAsMCwwLC41OS41OWgwYS42LjYsMCwwLDAsLjYtLjU5Wm0wLDEwYTEsMSwwLDAsMCwxLDFoMS41OWEuNi42LDAsMCwxLC41OS42LjU4LjU4LDAsMCwxLS41OS41OUgxNUEyLjE4LDIuMTgsMCwwLDEsMTIuODYsMjVWMjMuMzdhLjU4LjU4LDAsMCwxLC41OS0uNTloMGEuNi42LDAsMCwxLC42LjU5Wk0yNSwxNC4wNWExLDEsMCwwLDEsMSwxdjEuNTlhLjYuNiwwLDAsMCwuNi41OS41OC41OCwwLDAsMCwuNTktLjU5aDBWMTVBMi4xOCwyLjE4LDAsMCwwLDI1LDEyLjg2SDIzLjM3YS41OC41OCwwLDAsMC0uNTkuNTloMGEuNi42LDAsMCwwLC41OS42Wm0xLDExYTEsMSwwLDAsMS0xLDFIMjMuMzdhLjYuNiwwLDAsMC0uNTkuNi41OC41OCwwLDAsMCwuNTkuNTlIMjVBMi4xOCwyLjE4LDAsMCwwLDI3LjE0LDI1VjIzLjM3YS41OC41OCwwLDAsMC0uNTktLjU5aDBhLjYuNiwwLDAsMC0uNi41OVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>this.props.context.onFrameRequired.notifyObservers()}),(0,s.jsx)(vs,{className:this.props.context.activeKeyPoints&&this.props.context.activeKeyPoints.length>0?"":"disabled",tooltip:"Flatten tangent",id:"flatten-tangent",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjgsMTguNWExLjUxLDEuNTEsMCwwLDAtMS40MSwxSDExLjV2MUgyNi41OWExLjUsMS41LDAsMSwwLDEuNDEtMloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>this.props.context.onFlattenTangentRequired.notifyObservers()}),(0,s.jsx)(vs,{className:this.props.context.activeKeyPoints&&this.props.context.activeKeyPoints.length>0?"":"disabled",tooltip:"Linear tangent",id:"linear-tangent",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjYsMTRhMS40OSwxLjQ5LDAsMCwwLTIuNCwxLjY5bC0xMCwxMCwuNzEuNzEsMTAtMTBBMS40OSwxLjQ5LDAsMCwwLDI2LDE0WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==",onClick:()=>this.props.context.onLinearTangentRequired.notifyObservers()}),(0,s.jsx)(vs,{className:this.props.context.activeKeyPoints&&this.props.context.activeKeyPoints.length>0?"":"disabled",tooltip:"Break tangent",id:"break-tangent",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjcuMTEsMTMuMDVhMS40OSwxLjQ5LDAsMCwwLTIuMDUuNTMsMS40NywxLjQ3LDAsMCwwLC4xNCwxLjcybC00Ljc4LDhMMjAsMjIuOTJsLS40Mi40Mi00Ljc4LThhMS40NywxLjQ3LDAsMCwwLC4xNC0xLjcyLDEuNDksMS40OSwwLDAsMC0yLS41MywxLjUsMS41LDAsMCwwLDEsMi43Nmw0LjkxLDguMjYtMSwxTDIwLDI3LjE2LDIyLjEyLDI1bC0xLTEsNC45MS04LjI2YTEuNSwxLjUsMCwwLDAsMS4wNS0yLjc2WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==",onClick:()=>this.props.context.onBreakTangentRequired.notifyObservers()}),(0,s.jsx)(vs,{className:this.props.context.activeKeyPoints&&this.props.context.activeKeyPoints.length>0?"":"disabled",tooltip:"Unify tangent",id:"unify-tangent",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjcuOTQsMTguMjhhMS40OSwxLjQ5LDAsMCwwLTEuNDEsMWgtNWwtMS42Mi0xLjYzLTEuNjIsMS42M2gtNWExLjUsMS41LDAsMSwwLDAsMWg1bDEuNjIsMS42MiwxLjYyLTEuNjJoNWExLjUsMS41LDAsMSwwLDEuNDEtMloiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>this.props.context.onUnifyTangentRequired.notifyObservers()}),(0,s.jsx)(vs,{className:this.props.context.activeKeyPoints&&this.props.context.activeKeyPoints.length>0?"":"disabled",tooltip:"Step tangent",id:"step-tangent",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cGF0aCBkPSJNMjksMTYuNzFhMS41LDEuNSwwLDEsMC0yLDEuNDF2NS42N0gxMXYxSDI4VjE4LjEyQTEuNTEsMS41MSwwLDAsMCwyOSwxNi43MVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>this.props.context.onStepTangentRequired.notifyObservers()})]})}}class Ss extends r.Component{constructor(e){super(e),this._graphAbsoluteWidth=788,this._viewWidth=748,this._viewScale=1,this._offsetX=0,this.state={},this._svgHost=r.createRef(),this.props.context.onHostWindowResized.add((()=>{this._computeSizes()})),this._onActiveAnimationChangedObserver=this.props.context.onActiveAnimationChanged.add((()=>{this._computeSizes(),this.forceUpdate()})),this.props.context.onGraphMoved.add((e=>{this._offsetX=e,this.forceUpdate()})),this.props.context.onGraphScaled.add((e=>{this._viewScale=e,this.forceUpdate()}))}componentWillUnmount(){this._onActiveAnimationChangedObserver&&this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver)}_computeSizes(){this._svgHost.current&&(this._viewWidth=this._svgHost.current.clientWidth,this.forceUpdate())}_buildFrames(){if(0===this.props.context.activeAnimations.length)return null;const e=this.props.context.referenceMinFrame,t=(this.props.context.referenceMaxFrame-e)/this._graphAbsoluteWidth,r=Math.max(25*this._viewScale,35);let n=Math.floor(r*t);const o=[];0===n&&(n=1);const a=this._offsetX*t,i=e-(a/n|0)*n,l=i+this._viewWidth*this._viewScale*t;for(let e=i-n;e<=l+n;e+=n)o.push(e);return o.map((r=>{const n=(r-e)/t;return(0,s.jsxs)("g",{children:[(0,s.jsx)("line",{x1:n,y1:5*this._viewScale+"px",x2:n,y2:30*this._viewScale+"px",style:{stroke:"#333333",strokeWidth:.5}},"line"+r),(0,s.jsx)("text",{x:n,y:0,dx:7*this._viewScale+"px",textAnchor:"middle",dy:15*this._viewScale+"px",style:{fontFamily:"acumin-pro-condensed",fontSize:10*this._viewScale+"px",fill:"#555555",textAlign:"center"},children:r.toFixed(0)},"label"+r)]},"axis"+r)}))}render(){const e=`${-this._offsetX} 0 ${Math.round(this._viewWidth*this._viewScale)} ${Math.round(30*this._viewScale)}`;return(0,s.jsxs)("div",{id:"frame-bar",children:[this.props.context.activeAnimations.length>0&&(0,s.jsx)("div",{id:"angle-unit"}),(0,s.jsx)("div",{id:"frames",children:(0,s.jsx)("svg",{id:"svg-frames",viewBox:e,ref:this._svgHost,children:this._buildFrames()})})]})}}class ws{constructor(e,t,r,n,s,a){this.keys=new Array,this.onDataUpdatedObservable=new o.Observable,this.color=e,this.animation=t,this.property=r,this.tangentBuilder=n,this.setDefaultInTangent=s,this.setDefaultOutTangent=a}getPathData(e,t){const r=this.keys;if(r.length<2)return"";let n=`M${e(r[0].frame)} ${t(r[0].value)}`;const s=this.animation.dataType;for(let a=1;a{-1!==this.props.context.activeKeyPoints?.indexOf(this)||this.props.context.activeKeyPoints?.push(this)})),this._onUnifyTangentRequiredObserver=this.props.context.onUnifyTangentRequired.add((()=>{-1!==this.props.context.activeKeyPoints?.indexOf(this)&&this._unifyTangent()})),this._onBreakTangentRequiredObserver=this.props.context.onBreakTangentRequired.add((()=>{-1!==this.props.context.activeKeyPoints?.indexOf(this)&&this._breakTangent()})),this._onFlattenTangentRequiredObserver=this.props.context.onFlattenTangentRequired.add((()=>{-1!==this.props.context.activeKeyPoints?.indexOf(this)&&this._flattenTangent()})),this._onLinearTangentRequiredObserver=this.props.context.onLinearTangentRequired.add((()=>{-1!==this.props.context.activeKeyPoints?.indexOf(this)&&this._linearTangent()})),this._onStepTangentRequiredObserver=this.props.context.onStepTangentRequired.add((()=>{-1!==this.props.context.activeKeyPoints?.indexOf(this)&&this._stepTangent()})),this._onSelectionRectangleMovedObserver=this.props.context.onSelectionRectangleMoved.add((e=>{if(!this._keyPointSVG.current)return;if(this.props.curve.animation.dataType===o.Animation.ANIMATIONTYPE_QUATERNION)return;const t=this._keyPointSVG.current.getBoundingClientRect(),r=!(e.rightt.right||e.bottomt.bottom);this.props.context.activeKeyPoints||(this.props.context.activeKeyPoints=[]);const n=this.props.context.activeKeyPoints.indexOf(this);r?-1===n&&(this.props.context.activeKeyPoints.push(this),this.props.context.onActiveKeyPointChanged.notifyObservers()):n>-1&&(this.props.context.activeKeyPoints.splice(n,1),this.props.context.onActiveKeyPointChanged.notifyObservers())})),this._onMainKeyPointSetObserver=this.props.context.onMainKeyPointSet.add((()=>{this.props.context.mainKeyPoint&&this.props.context.mainKeyPoint!==this&&(this._offsetXToMain=this.state.x-this.props.context.mainKeyPoint?.state.x,this._offsetYToMain=this.state.y-this.props.context.mainKeyPoint?.state.y)})),this._onMainKeyPointMovedObserver=this.props.context.onMainKeyPointMoved.add((()=>{const e=this.props.context.mainKeyPoint;if(e!==this&&e){if(this.state.selectedState!==Ls.None&&0!==this.props.keyId){const t=e.state.x+this._offsetXToMain;this.setState({x:t}),this.props.onFrameValueChanged(this.props.invertX(t))}if(this.state.selectedState===Ls.Selected){const t=e.state.y+this._offsetYToMain;this.setState({y:t}),this.props.onKeyValueChanged(this.props.invertY(t))}}})),this._onActiveKeyPointChangedObserver=this.props.context.onActiveKeyPointChanged.add((()=>{const e=-1!==this.props.context.activeKeyPoints?.indexOf(this);if(!e&&this.props.context.activeKeyPoints){const e=this.props.curve;let t=Ls.None;for(const r of this.props.context.activeKeyPoints)if(r.props.keyId===this.props.keyId&&e!==r.props.curve&&e.animation===r.props.curve.animation){t=Ls.Siblings;break}this.setState({selectedState:t,tangentSelectedIndex:-1})}else this.setState({selectedState:Ls.Selected,tangentSelectedIndex:-1});e&&(this.props.context.onFrameSet.notifyObservers(this.props.invertX(this.state.x)),this.props.context.onValueSet.notifyObservers(this.props.invertY(this.state.y)))})),this._onActiveKeyFrameChangedObserver=this.props.context.onActiveKeyFrameChanged.add((e=>{this.state.selectedState!==Ls.Siblings||this.props.context.mainKeyPoint||(this.setState({x:e}),this.props.onFrameValueChanged(this.props.invertX(e)))})),this._onFrameManuallyEnteredObserver=this.props.context.onFrameManuallyEntered.add((e=>{if(this.state.selectedState===Ls.None)return;let t=this.props.convertX(e);const r=this.props.getPreviousX(),n=this.props.getNextX();null!==r&&(t=Math.max(r,t)),null!==n&&(t=Math.min(n,t));const o=this.props.invertX(t);this.setState({x:t}),this.props.onFrameValueChanged(o)})),this._onValueManuallyEnteredObserver=this.props.context.onValueManuallyEntered.add((e=>{if(this.state.selectedState!==Ls.Selected)return;const t=this.props.convertY(e);this.setState({y:t}),this.props.onKeyValueChanged(e)}))}componentWillUnmount(){this._onSelectAllKeysObserver&&this.props.context.onSelectAllKeys.remove(this._onSelectAllKeysObserver),this._onUnifyTangentRequiredObserver&&this.props.context.onUnifyTangentRequired.remove(this._onUnifyTangentRequiredObserver),this._onBreakTangentRequiredObserver&&this.props.context.onBreakTangentRequired.remove(this._onBreakTangentRequiredObserver),this._onFlattenTangentRequiredObserver&&this.props.context.onFlattenTangentRequired.remove(this._onFlattenTangentRequiredObserver),this._onLinearTangentRequiredObserver&&this.props.context.onLinearTangentRequired.remove(this._onLinearTangentRequiredObserver),this._onStepTangentRequiredObserver&&this.props.context.onStepTangentRequired.remove(this._onStepTangentRequiredObserver),this._onSelectionRectangleMovedObserver&&this.props.context.onSelectionRectangleMoved.remove(this._onSelectionRectangleMovedObserver),this._onMainKeyPointSetObserver&&this.props.context.onMainKeyPointSet.remove(this._onMainKeyPointSetObserver),this._onMainKeyPointMovedObserver&&this.props.context.onMainKeyPointMoved.remove(this._onMainKeyPointMovedObserver),this._onActiveKeyPointChangedObserver&&this.props.context.onActiveKeyPointChanged.remove(this._onActiveKeyPointChangedObserver),this._onActiveKeyFrameChangedObserver&&this.props.context.onActiveKeyFrameChanged.remove(this._onActiveKeyFrameChangedObserver),this._onFrameManuallyEnteredObserver&&this.props.context.onFrameManuallyEntered.remove(this._onFrameManuallyEnteredObserver),this._onValueManuallyEnteredObserver&&this.props.context.onValueManuallyEntered.remove(this._onValueManuallyEnteredObserver)}shouldComponentUpdate(e,t){return e!==this.props&&(t.x=e.x,t.y=e.y),!0}_breakTangent(){this.props.context.onInterpolationModeSet.notifyObservers({keyId:this.props.keyId,value:o.AnimationKeyInterpolation.NONE}),this.props.curve.updateLockedTangentMode(this.props.keyId,!1),this.forceUpdate()}_unifyTangent(){this.props.context.onInterpolationModeSet.notifyObservers({keyId:this.props.keyId,value:o.AnimationKeyInterpolation.NONE}),this.props.curve.updateLockedTangentMode(this.props.keyId,!0),this.forceUpdate()}_flattenTangent(){this.props.context.onInterpolationModeSet.notifyObservers({keyId:this.props.keyId,value:o.AnimationKeyInterpolation.NONE}),-1!==this.state.tangentSelectedIndex&&0!==this.state.tangentSelectedIndex||0!==this.props.keyId&&this.props.curve.updateInTangentFromControlPoint(this.props.keyId,0),-1!==this.state.tangentSelectedIndex&&1!==this.state.tangentSelectedIndex||this.props.keyId!==this.props.curve.keys.length-1&&this.props.curve.updateOutTangentFromControlPoint(this.props.keyId,0),this.forceUpdate()}_linearTangent(){this.props.context.onInterpolationModeSet.notifyObservers({keyId:this.props.keyId,value:o.AnimationKeyInterpolation.NONE}),-1!==this.state.tangentSelectedIndex&&0!==this.state.tangentSelectedIndex||0!==this.props.keyId&&this.props.curve.storeDefaultInTangent(this.props.keyId),-1!==this.state.tangentSelectedIndex&&1!==this.state.tangentSelectedIndex||this.props.keyId!==this.props.curve.keys.length-1&&this.props.curve.storeDefaultOutTangent(this.props.keyId),this.props.curve.onDataUpdatedObservable.notifyObservers(),this.forceUpdate()}_stepTangent(){this.props.context.onInterpolationModeSet.notifyObservers({keyId:this.props.keyId,value:o.AnimationKeyInterpolation.STEP}),this.forceUpdate()}_select(e){if(!this.props.context.activeKeyPoints)return;const t=this.props.context.activeKeyPoints.indexOf(this);-1===t?(e||(this.props.context.activeKeyPoints=[]),this.props.context.activeKeyPoints.push(this),this.props.context.activeKeyPoints.length>1?(this.props.context.mainKeyPoint=this,this.props.context.onMainKeyPointSet.notifyObservers()):this.props.context.mainKeyPoint=null):e?(this.props.context.activeKeyPoints.splice(t,1),this.props.context.mainKeyPoint=null):this.props.context.activeKeyPoints.length>1?(this.props.context.mainKeyPoint=this,this.props.context.onMainKeyPointSet.notifyObservers()):this.props.context.mainKeyPoint=null}_onPointerDown(e){this.props.context.activeKeyPoints||(this.props.context.activeKeyPoints=[]),e.preventDefault();const t=this.props.curve.animation.dataType===o.Animation.ANIMATIONTYPE_QUATERNION;if(t)return;this._select(e.nativeEvent.ctrlKey),this.props.context.onActiveKeyPointChanged.notifyObservers(),this._pointerIsDown=!0,e.currentTarget.setPointerCapture(e.pointerId),this._sourcePointerX=e.nativeEvent.offsetX,this._sourcePointerY=e.nativeEvent.offsetY;const r=e.nativeEvent.target;"image"!==r.tagName||t?r.classList.contains("left-tangent")&&!t?(this._controlMode=Es.TangentLeft,this.setState({tangentSelectedIndex:0})):r.classList.contains("right-tangent")&&!t&&(this._controlMode=Es.TangentRight,this.setState({tangentSelectedIndex:1})):(this._controlMode=Es.Key,this.setState({tangentSelectedIndex:-1})),this._lockX=!1,this._lockY=!1,this._accumulatedX=0,this._accumulatedY=0,e.stopPropagation()}_extractSlope(e,t,r){r&&e.x>=0?e.x=-.01:!r&&e.x<=0&&(e.x=.01);const n=e.clone();n.normalize(),n.scaleInPlace(t);const o=this.props.curve.keys;return(r?o[this.props.keyId].value-this.props.invertY(n.y+this.state.y):this.props.invertY(n.y+this.state.y)-o[this.props.keyId].value)/(r?o[this.props.keyId].frame-this.props.invertX(n.x+this.state.x):this.props.invertX(n.x+this.state.x)-o[this.props.keyId].frame)}_processTangentMove(e,t,r,n){return t.x+=(e.nativeEvent.offsetX-this._sourcePointerX)*this.props.scale,t.y+=(e.nativeEvent.offsetY-this._sourcePointerY)*this.props.scale,this._extractSlope(t,r,n)}_onPointerMove(e){if(this._pointerIsDown&&this.state.selectedState===Ls.Selected&&!this.props.context.hasActiveQuaternionAnimationKeyPoints()){if(this._controlMode===Es.Key){const t=e.nativeEvent.offsetX-this._sourcePointerX,r=e.nativeEvent.offsetY-this._sourcePointerY;e.shiftKey?this._lockX||this._lockY||(this._accumulatedX+=Math.abs(t),this._accumulatedY+=Math.abs(r),(this._accumulatedX>5||this._accumulatedY>5)&&(this._accumulatedX>this._accumulatedY?this._lockY=!0:this._lockX=!0)):(this._lockX=!1,this._lockY=!1);let n=this.state.x+(this._lockX?0:t*this.props.scale),o=this.state.y+(this._lockY?0:r*this.props.scale);const s=this.props.getPreviousX(),a=this.props.getNextX(),i=.01;if(null!==s&&(n=Math.max(s+i,n)),null!==a&&(n=Math.min(a-i,n)),0===this.props.keyId||this.props.context.lockLastFrameFrame&&this.props.keyId===this.props.curve.keys.length-1)n=this.state.x;else{const e=this.props.invertX(n);this.props.onFrameValueChanged(e),this.props.context.onFrameSet.notifyObservers(e),n!==this.state.x&&this.props.context.onActiveKeyFrameChanged.notifyObservers(n)}this.props.context.lockLastFrameValue&&this.props.keyId===this.props.curve.keys.length-1&&(o=this.state.y);const l=this.props.invertY(o);this.props.onKeyValueChanged(l),this.props.context.onValueSet.notifyObservers(l),this.setState({x:n,y:o}),this.props.context.activeKeyPoints.length>1&&setTimeout((()=>{this.props.context.mainKeyPoint&&this.props.context.onMainKeyPointMoved.notifyObservers()}))}else{const t=this.props.curve.keys,r=t[this.props.keyId].lockedTangent&&0!==this.props.keyId&&this.props.keyId!==t.length-1;let n=0;const s=o.TmpVectors.Vector2[0];if(r){const e=o.TmpVectors.Vector2[1],t=o.TmpVectors.Vector2[2];o.Vector2.NormalizeToRef(this._inVec,e),o.Vector2.NormalizeToRef(this._outVec,t),n=Math.acos(Math.min(1,Math.max(-1,o.Vector2.Dot(e,t)))),this._inVec.rotateToRef(-n,s),o.Vector2.Distance(s,this._outVec)>.01&&(n=-n)}this._controlMode===Es.TangentLeft?(this.props.curve.updateInTangentFromControlPoint(this.props.keyId,this._processTangentMove(e,this._inVec,this._storedLengthIn,!0)),r&&(this._inVec.rotateToRef(-n,s),s.x=Math.abs(s.x),this.props.curve.updateOutTangentFromControlPoint(this.props.keyId,this._extractSlope(s,this._storedLengthOut,!1)))):this._controlMode===Es.TangentRight&&(this.props.curve.updateOutTangentFromControlPoint(this.props.keyId,this._processTangentMove(e,this._outVec,this._storedLengthOut,!1)),r&&(this._outVec.rotateToRef(n,s),s.x=-Math.abs(s.x),this.props.curve.updateInTangentFromControlPoint(this.props.keyId,this._extractSlope(s,this._storedLengthIn,!0)))),this.props.context.refreshTarget(),this.forceUpdate()}this.props.context.onActiveKeyDataChanged.notifyObservers(this.props.keyId),this._sourcePointerX=e.nativeEvent.offsetX,this._sourcePointerY=e.nativeEvent.offsetY,e.stopPropagation()}}_onPointerUp(e){this._pointerIsDown=!1,e.currentTarget.releasePointerCapture(e.pointerId),e.stopPropagation(),this._controlMode=Es.None}render(){if(!this.props.context.isChannelEnabled(this.props.curve.animation,this.props.curve.color))return null;const e=this.props.curve.animation.dataType,t=e===o.Animation.ANIMATIONTYPE_COLOR3||e===o.Animation.ANIMATIONTYPE_COLOR4,r=e===o.Animation.ANIMATIONTYPE_QUATERNION,n=this.state.selectedState===Ls.Selected?Ns:this.state.selectedState===Ls.Siblings?ks:Ms,a=this.props.curve.keys,i=a[this.props.keyId].lockedTangent??!0,l=a[this.props.keyId-1]?.interpolation??!1,p=a[this.props.keyId]?.interpolation??!1,c=this.props.curve.hasDefinedInTangent(this.props.keyId),d=this.props.curve.hasDefinedOutTangent(this.props.keyId),h=this.props.invertX(this.state.x),u=this.props.invertY(this.state.y);if(c){const e=u-this.props.curve.getInControlPoint(this.props.keyId);this._inVec=new o.Vector2(this.props.convertX(h-1)-this.state.x,this.props.convertY(e)-this.state.y)}else this._inVec=new o.Vector2;if(d){const e=u+this.props.curve.getOutControlPoint(this.props.keyId);this._outVec=new o.Vector2(this.props.convertX(h+1)-this.state.x,this.props.convertY(e)-this.state.y)}else this._outVec=new o.Vector2;return this._storedLengthIn=this._inVec.length(),this._storedLengthOut=this._outVec.length(),this._inVec.normalize(),this._inVec.scaleInPlace(100*this.props.scale),this._outVec.normalize(),this._outVec.scaleInPlace(100*this.props.scale),(0,s.jsxs)("svg",{ref:this._svgHost,onPointerDown:e=>this._onPointerDown(e),onPointerMove:e=>this._onPointerMove(e),onPointerUp:e=>this._onPointerUp(e),x:this.state.x,y:this.state.y,style:{cursor:r?"auto":"pointer",overflow:"auto",opacity:r?"25%":"100%"},children:[(0,s.jsx)("image",{x:"-"+8*this.props.scale,y:"-"+8*this.props.scale,width:""+16*this.props.scale,height:""+16*this.props.scale,ref:this._keyPointSVG,href:n}),this.state.selectedState===Ls.Selected&&(0,s.jsxs)("g",{children:[0!==this.props.keyId&&!l&&!t&&!r&&c&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("line",{x1:0,y1:0,x2:`${this._inVec.x}px`,y2:`${this._inVec.y}px`,style:{stroke:0===this.state.tangentSelectedIndex||-1===this.state.tangentSelectedIndex?"#F9BF00":"#AAAAAA",strokeWidth:""+1*this.props.scale,strokeDasharray:i?"":"2, 2"}}),(0,s.jsx)("circle",{className:"left-tangent",cx:`${this._inVec.x}px`,cy:`${this._inVec.y}px`,r:""+4*this.props.scale,style:{fill:0===this.state.tangentSelectedIndex||-1===this.state.tangentSelectedIndex?"#F9BF00":"#AAAAAA"}})]}),this.props.keyId!==a.length-1&&!p&&!t&&!r&&d&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("line",{x1:0,y1:0,x2:`${this._outVec.x}px`,y2:`${this._outVec.y}px`,style:{stroke:1===this.state.tangentSelectedIndex||-1===this.state.tangentSelectedIndex?"#F9BF00":"#AAAAAA",strokeWidth:""+1*this.props.scale,strokeDasharray:i?"":"2, 2"}}),(0,s.jsx)("circle",{className:"right-tangent",cx:`${this._outVec.x}px`,cy:`${this._outVec.y}px`,r:""+4*this.props.scale,style:{fill:1===this.state.tangentSelectedIndex||-1===this.state.tangentSelectedIndex?"#F9BF00":"#AAAAAA"}})]})]})]})}}class Is extends r.Component{constructor(e){super(e),this.state={isSelected:!1},this._onDataUpdatedObserver=this.props.curve.onDataUpdatedObservable.add((()=>this.forceUpdate())),this._onActiveAnimationChangedObserver=e.context.onActiveAnimationChanged.add((()=>{this._onDataUpdatedObserver&&this.props.curve.onDataUpdatedObservable.remove(this._onDataUpdatedObserver),this._onDataUpdatedObserver=null,this.forceUpdate()})),this._onInterpolationModeSetObserver=e.context.onInterpolationModeSet.add((({keyId:e,value:t})=>{this.props.curve.updateInterpolationMode(e,t)}))}componentWillUnmount(){this._onDataUpdatedObserver&&this.props.curve.onDataUpdatedObservable.remove(this._onDataUpdatedObserver),this._onActiveAnimationChangedObserver&&this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver),this._onInterpolationModeSetObserver&&this.props.context.onInterpolationModeSet.remove(this._onInterpolationModeSetObserver)}componentDidUpdate(){return this._onDataUpdatedObserver||(this._onDataUpdatedObserver=this.props.curve.onDataUpdatedObservable.add((()=>this.forceUpdate()))),!0}render(){if(!this.props.context.isChannelEnabled(this.props.curve.animation,this.props.curve.color))return null;const e={stroke:this.props.curve.color,fill:"none",strokeWidth:"1"};return this.props.curve.animation.dataType===o.Animation.ANIMATIONTYPE_QUATERNION&&(e["stroke-dasharray"]="5",e["stroke-opacity"]="0.5"),(0,s.jsx)("svg",{style:{cursor:"pointer",overflow:"auto"},children:(0,s.jsx)("path",{d:this.props.curve.getPathData(this.props.convertX,this.props.convertY),style:e})})}}class Ds extends r.Component{constructor(e){super(e),this._minScale=.5,this._maxScale=5,this._graphAbsoluteWidth=788,this._graphAbsoluteHeight=357,this._viewWidth=788,this._viewCurveWidth=788,this._viewHeight=357,this._viewScale=1,this._offsetX=0,this._offsetY=0,this._graphOffsetX=30,this.state={},this._svgHost=r.createRef(),this._svgHost2=r.createRef(),this._selectionRectangle=r.createRef(),this._evaluateKeys(),this.props.context.onHostWindowResized.add((()=>{this._computeSizes()})),this._onActiveAnimationChangedObserver=this.props.context.onActiveAnimationChanged.add((({evaluateKeys:e=!0,frame:t=!0,range:r=!0})=>{e&&this._evaluateKeys(t,r),this._computeSizes(),this.forceUpdate()})),this.props.context.onFrameRequired.add((()=>{this._frameFromActiveKeys(),this.forceUpdate()})),this.props.context.onRangeUpdated.add((()=>{this.forceUpdate()})),this.props.context.onDeleteKeyActiveKeyPoints.add((()=>{if(0!==this.props.context.activeAnimations.length&&this.props.context.activeKeyPoints){for(const e of this.props.context.activeAnimations){const t=e.getKeys(),r=t.slice(0);let n=null;for(const e of this.props.context.activeKeyPoints){if(0===e.props.keyId||e.props.keyId===t.length-1)continue;const o=t[e.props.keyId],s=r.indexOf(o);s>-1&&(r.splice(s,1),null===n&&(n=o.frame))}this.props.context.stop(),e.setKeys(r),null!==n&&this.props.context.moveToFrame(n)}this._evaluateKeys(!1,!1),this.props.context.activeKeyPoints=[],this.props.context.onActiveKeyPointChanged.notifyObservers(),this.props.context.onActiveAnimationChanged.notifyObservers({evaluateKeys:!1}),this.forceUpdate()}})),this.props.context.onCreateOrUpdateKeyPointRequired.add((()=>{if(0!==this.props.context.activeAnimations.length){for(const e of this.props.context.activeAnimations){if(e.dataType===o.Animation.ANIMATIONTYPE_QUATERNION)continue;const t=e.getKeys(),r=this.props.context.activeFrame;let n,s=-1;for(const e of t){if(!(e.frameo.Vector2.Zero()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#51E22D",e,"y",(()=>o.Vector2.Zero()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e))));break;case o.Animation.ANIMATIONTYPE_VECTOR3:n.push(new ws("#DB3E3E",e,"x",(()=>o.Vector3.Zero()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#51E22D",e,"y",(()=>o.Vector3.Zero()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#00A3FF",e,"z",(()=>o.Vector3.Zero()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e))));break;case o.Animation.ANIMATIONTYPE_COLOR3:n.push(new ws("#DB3E3E",e,"r",(()=>o.Color3.Black()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#51E22D",e,"g",(()=>o.Color3.Black()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#00A3FF",e,"b",(()=>o.Color3.Black()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e))));break;case o.Animation.ANIMATIONTYPE_QUATERNION:n.push(new ws("#DB3E3E",e,"x",(()=>o.Quaternion.Zero()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#51E22D",e,"y",(()=>o.Quaternion.Zero()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#00A3FF",e,"z",(()=>o.Quaternion.Zero()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#8700FF",e,"w",(()=>o.Quaternion.Zero()),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e))));break;case o.Animation.ANIMATIONTYPE_COLOR4:n.push(new ws("#DB3E3E",e,"r",(()=>new o.Color4),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#51E22D",e,"g",(()=>new o.Color4),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#00A3FF",e,"b",(()=>new o.Color4),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e)))),n.push(new ws("#8700FF",e,"a",(()=>new o.Color4),(e=>this._setDefaultInTangent(e)),(e=>this._setDefaultOutTangent(e))))}const s=this._extractValuesFromKeys(r,e.dataType,n);this._curves.push(...n),t&&(this._minValue=Math.min(this._minValue,s.min),this._maxValue=Math.max(this._maxValue,s.max),this._minFrame=Math.min(this._minFrame,r[0].frame),this._maxFrame=Math.max(this._maxFrame,r[r.length-1].frame))}e&&this._frameFromActiveKeys()}else this._curves=[]}_extractValuesFromKeys(e,t,r,n){let s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(const i of e){let e=!0;switch(void 0!==i.lockedTangent&&(e=i.lockedTangent),t){case o.Animation.ANIMATIONTYPE_FLOAT:s=Math.min(s,i.value),a=Math.max(a,i.value),r&&r[0].keys.push({frame:i.frame,value:i.value,inTangent:i.inTangent,outTangent:i.outTangent,lockedTangent:e,interpolation:i.interpolation});break;case o.Animation.ANIMATIONTYPE_VECTOR2:n&&"x"!==n||(s=Math.min(s,i.value.x),a=Math.max(a,i.value.x)),n&&"y"!==n||(s=Math.min(s,i.value.y),a=Math.max(a,i.value.y)),r&&(r[0].keys.push({frame:i.frame,value:i.value.x,inTangent:i.inTangent?.x,outTangent:i.outTangent?.x,lockedTangent:e,interpolation:i.interpolation}),r[1].keys.push({frame:i.frame,value:i.value.y,inTangent:i.inTangent?.y,outTangent:i.outTangent?.y,lockedTangent:e,interpolation:i.interpolation}));break;case o.Animation.ANIMATIONTYPE_VECTOR3:n&&"x"!==n||(s=Math.min(s,i.value.x),a=Math.max(a,i.value.x)),n&&"y"!==n||(s=Math.min(s,i.value.y),a=Math.max(a,i.value.y)),n&&"z"!==n||(s=Math.min(s,i.value.z),a=Math.max(a,i.value.z)),r&&(r[0].keys.push({frame:i.frame,value:i.value.x,inTangent:i.inTangent?.x,outTangent:i.outTangent?.x,lockedTangent:e,interpolation:i.interpolation}),r[1].keys.push({frame:i.frame,value:i.value.y,inTangent:i.inTangent?.y,outTangent:i.outTangent?.y,lockedTangent:e,interpolation:i.interpolation}),r[2].keys.push({frame:i.frame,value:i.value.z,inTangent:i.inTangent?.z,outTangent:i.outTangent?.z,lockedTangent:e,interpolation:i.interpolation}));break;case o.Animation.ANIMATIONTYPE_COLOR3:n&&"r"!==n||(s=Math.min(s,i.value.r),a=Math.max(a,i.value.r)),n&&"g"!==n||(s=Math.min(s,i.value.g),a=Math.max(a,i.value.g)),n&&"b"!==n||(s=Math.min(s,i.value.b),a=Math.max(a,i.value.b)),r&&(r[0].keys.push({frame:i.frame,value:i.value.r,inTangent:i.inTangent?.r,outTangent:i.outTangent?.r,lockedTangent:e,interpolation:i.interpolation}),r[1].keys.push({frame:i.frame,value:i.value.g,inTangent:i.inTangent?.g,outTangent:i.outTangent?.g,lockedTangent:e,interpolation:i.interpolation}),r[2].keys.push({frame:i.frame,value:i.value.b,inTangent:i.inTangent?.b,outTangent:i.outTangent?.b,lockedTangent:e,interpolation:i.interpolation}));break;case o.Animation.ANIMATIONTYPE_QUATERNION:n&&"x"!==n||(s=Math.min(s,i.value.x),a=Math.max(a,i.value.x)),n&&"y"!==n||(s=Math.min(s,i.value.y),a=Math.max(a,i.value.y)),n&&"z"!==n||(s=Math.min(s,i.value.z),a=Math.max(a,i.value.z)),n&&"w"!==n||(s=Math.min(s,i.value.w),a=Math.max(a,i.value.w)),r&&(r[0].keys.push({frame:i.frame,value:i.value.x,inTangent:i.inTangent?.x,outTangent:i.outTangent?.x,lockedTangent:e,interpolation:i.interpolation}),r[1].keys.push({frame:i.frame,value:i.value.y,inTangent:i.inTangent?.y,outTangent:i.outTangent?.y,lockedTangent:e,interpolation:i.interpolation}),r[2].keys.push({frame:i.frame,value:i.value.z,inTangent:i.inTangent?.z,outTangent:i.outTangent?.z,lockedTangent:e,interpolation:i.interpolation}),r[3].keys.push({frame:i.frame,value:i.value.w,inTangent:i.inTangent?.w,outTangent:i.outTangent?.w,lockedTangent:e,interpolation:i.interpolation}));break;case o.Animation.ANIMATIONTYPE_COLOR4:n&&"r"!==n||(s=Math.min(s,i.value.r),a=Math.max(a,i.value.r)),n&&"g"!==n||(s=Math.min(s,i.value.g),a=Math.max(a,i.value.g)),n&&"b"!==n||(s=Math.min(s,i.value.b),a=Math.max(a,i.value.b)),n&&"a"!==n||(s=Math.min(s,i.value.a),a=Math.max(a,i.value.a)),r&&(r[0].keys.push({frame:i.frame,value:i.value.r,inTangent:i.inTangent?.r,outTangent:i.outTangent?.r,lockedTangent:e,interpolation:i.interpolation}),r[1].keys.push({frame:i.frame,value:i.value.g,inTangent:i.inTangent?.g,outTangent:i.outTangent?.g,lockedTangent:e,interpolation:i.interpolation}),r[2].keys.push({frame:i.frame,value:i.value.b,inTangent:i.inTangent?.b,outTangent:i.outTangent?.b,lockedTangent:e,interpolation:i.interpolation}),r[3].keys.push({frame:i.frame,value:i.value.a,inTangent:i.inTangent?.a,outTangent:i.outTangent?.a,lockedTangent:e,interpolation:i.interpolation}))}}return{min:s,max:a}}_convertX(e){let t=this._maxFrame-this._minFrame;return 0===t&&(t=1),(e-this._minFrame)/t*this._graphAbsoluteWidth}_invertX(e){return e/this._graphAbsoluteWidth*(this._maxFrame-this._minFrame)+this._minFrame}_convertY(e){let t=this._maxValue-this._minValue;return 0===t&&(t=1),this._graphAbsoluteHeight-(e-this._minValue)/t*this._graphAbsoluteHeight}_invertY(e){let t=this._maxValue-this._minValue;return 0===t&&(t=1),(this._graphAbsoluteHeight-e)/this._graphAbsoluteHeight*t+this._minValue}_buildFrameIntervalAxis(){if(0===this.props.context.activeAnimations.length)return null;const e=this.props.context.referenceMaxFrame;let t=this.props.context.activeAnimations[0].framePerSecond;const r=e/this._graphAbsoluteWidth,n=[];0===t&&(t=1);const o=-(this._offsetX*r/t|0)*t,a=o+(this._viewWidth-40)*this._viewScale*r;for(let e=o-t;e<=a+t;e+=t)n.push(e);return n.map((e=>{const t=e/r;return(0,s.jsx)("g",{children:(0,s.jsx)("line",{x1:t,y1:0,x2:t,y2:this._viewHeight*this._viewScale,style:{stroke:"#666666",strokeWidth:1}},"line"+e)},"axis"+e)}))}_buildYAxis(){if(0===this.props.context.activeAnimations.length)return null;const e=this._maxValue!==this._minValue?this._maxValue-this._minValue:1;let t=e/10*this._viewScale;const r=e/this._graphAbsoluteHeight,n=[],o=t;let a=2;for(;(0).toFixed(a)===o.toFixed(a);)a++;const i=Math.pow(10,a);t=Math.round(t*i),t%2!=0&&(t-=1),t/=i;const l=(this._viewHeight*this._viewScale-this._graphAbsoluteHeight-this._offsetY)*r,p=Math.ceil((this._minValue-(l/t|0)*t)/t)*t,c=Math.round((p+this._viewHeight*this._viewScale*r)/t)*t;for(let e=p-t;e<=c+t;e+=t)n.push(e);return n.map((e=>{const t=this._graphAbsoluteHeight-(e-this._minValue)/r;let n=e.toFixed(a);n=parseFloat(n).toFixed(a);const o=n===(0).toFixed(a);return(0,s.jsxs)("g",{children:[(0,s.jsx)("line",{x1:this._graphOffsetX*this._viewScale,y1:t,x2:this._viewWidth*this._viewScale,y2:t,style:{stroke:o?"#666666":"#333333",strokeWidth:o?1:.5}},"line"+e),(0,s.jsx)("text",{x:0,y:t,dx:15*this._viewScale+"px",textAnchor:"middle",dy:3*this._viewScale+"px",style:{fontFamily:"acumin-pro-condensed",fontSize:10*this._viewScale+"px",fill:"#888888",textAlign:"center"},children:n},"label"+e)]},"axis"+e)}))}_frameFromActiveKeys(){if(0===this.props.context.activeAnimations.length)return;this._offsetX=20,this._offsetY=20;let e=Number.MAX_VALUE,t=-Number.MAX_VALUE,r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=!1;for(const s of this.props.context.activeAnimations){let a;const i=this.props.context.getActiveChannel(s);if(i){const e=this._curves.filter((e=>e.color===i))[0];e&&(a=e.property)}let l=s.getKeys();if(this.props.context.activeKeyPoints&&this.props.context.activeKeyPoints.length>0){const e=[];for(let t=0;t=1&&e.unshift(l[r.props.keyId-1]),t===this.props.context.activeKeyPoints.length-1&&r.props.keyId{const n=this._convertX(t.frame),o=this._convertY(t.value);return(0,s.jsx)(Ps,{x:n,y:o,context:this.props.context,scale:this._viewScale,getPreviousX:()=>r>0?this._convertX(e.keys[r-1].frame):null,getNextX:()=>rthis._invertX(e),invertY:e=>this._invertY(e),convertX:e=>this._convertX(e),convertY:e=>this._convertY(e),onFrameValueChanged:t=>{e.updateKeyFrame(r,t),this.props.context.refreshTarget()},onKeyValueChanged:t=>{e.updateKeyValue(r,t),this.props.context.refreshTarget()}},"curve-"+r)}))}_onPointerDown(e){if("svg-graph-curves"!==e.nativeEvent.target.id)return;e.preventDefault(),this._pointerIsDown=!0,e.currentTarget.setPointerCapture(e.pointerId),this._sourcePointerX=e.nativeEvent.offsetX,this._sourcePointerY=e.nativeEvent.offsetY;const t=2==e.nativeEvent.which||4==e.button;this._inSelectionMode=!t&&!e.altKey,this._inSelectionMode&&(this._selectionStartX=this._sourcePointerX+40,this._selectionStartY=this._sourcePointerY)}_onPointerMove(e){if(this._pointerIsDown){if(this._inSelectionMode){const t=this._selectionRectangle.current.style;t.visibility="visible";const r=e.nativeEvent.offsetX,n=e.nativeEvent.offsetY;return r>this._selectionStartX?(t.left=`${this._selectionStartX}px`,t.width=r-this._selectionStartX+"px"):(t.left=`${r}px`,t.width=this._selectionStartX-r+"px"),n>this._selectionStartY?(t.top=`${this._selectionStartY}px`,t.height=n-this._selectionStartY+"px"):(t.top=`${n}px`,t.height=this._selectionStartY-n+"px"),r===this._selectionStartX&&n===this._selectionStartY||(this._selectionMade=!0),void this.props.context.onSelectionRectangleMoved.notifyObservers(this._selectionRectangle.current.getBoundingClientRect())}this._offsetX+=(e.nativeEvent.offsetX-this._sourcePointerX)*this._viewScale,this._offsetY+=(e.nativeEvent.offsetY-this._sourcePointerY)*this._viewScale,this._sourcePointerX=e.nativeEvent.offsetX,this._sourcePointerY=e.nativeEvent.offsetY,this.props.context.onGraphMoved.notifyObservers(this._offsetX),this.forceUpdate()}}_onPointerUp(e){this._pointerIsDown=!1,e.currentTarget.releasePointerCapture(e.pointerId),this._selectionRectangle.current.style.visibility="hidden",this._inSelectionMode&&this._selectionMade||this.props.context.clearSelection(),this._selectionMade=!1}_onWheel(e){const t=e.deltaY<0?-.05:.05,r=this._viewScale;this._viewScale=Math.min(Math.max(this._minScale,this._viewScale+t*this._viewScale),this._maxScale);const n=e.nativeEvent.offsetX,o=e.nativeEvent.offsetY,s=n*r-n*this._viewScale,a=o*r-o*this._viewScale;this._offsetX-=s,this._offsetY-=a,this.forceUpdate(),e.stopPropagation(),this.props.context.onGraphMoved.notifyObservers(this._offsetX),this.props.context.onGraphScaled.notifyObservers(this._viewScale)}render(){const e=this._viewScale,t=`${-this._offsetX} ${-this._offsetY} ${Math.round(e*this._viewCurveWidth)} ${Math.round(e*this._viewHeight)}`,r=`0 ${-this._offsetY} ${Math.round(e*this._viewWidth)} ${Math.round(e*this._viewHeight)}`,n=`${-this._offsetX} 0 ${Math.round((this._viewWidth-40)*this._viewScale)} ${Math.round(e*this._viewHeight)}`;let o=0,a=0;if(0!==this.props.context.activeAnimations.length){const e=this.props.context.referenceMinFrame,t=this.props.context.referenceMaxFrame;o=((this.props.context.fromKey-e)/(t-e)*this._graphAbsoluteWidth+this._offsetX)/this._viewScale,a=((this.props.context.toKey-e)/(t-e)*this._graphAbsoluteWidth+this._offsetX)/this._viewScale}return(0,s.jsxs)("div",{id:"graph",onWheel:e=>this._onWheel(e),onPointerDown:e=>this._onPointerDown(e),onPointerMove:e=>this._onPointerMove(e),onPointerUp:e=>this._onPointerUp(e),children:[0!==this.props.context.activeAnimations.length&&(0,s.jsx)("div",{id:"dark-rectangle",style:{left:o+"px",width:a-o+"px"}}),(0,s.jsx)("div",{id:"block-rectangle"}),(0,s.jsx)("svg",{id:"svg-graph-grid",viewBox:r,ref:this._svgHost,children:this._buildYAxis()}),(0,s.jsx)("svg",{id:"svg-graph-horizontal",viewBox:n,children:this._buildFrameIntervalAxis()}),(0,s.jsxs)("svg",{ref:this._svgHost2,id:"svg-graph-curves",tabIndex:0,viewBox:t,children:[this._curves.map(((e,t)=>(0,s.jsx)(Is,{context:this.props.context,curve:e,convertX:e=>this._convertX(e),convertY:e=>this._convertY(e)},t))),this._curves.map((e=>this._dropKeyFrames(e)))]}),(0,s.jsx)("div",{ref:this._selectionRectangle,id:"selection-rectangle"})]})}}class Ts extends r.Component{constructor(e){super(e),this._graphAbsoluteWidth=788,this._viewScale=1,this._offsetX=0,this._offsetRange=10,this._viewWidth=748,this._rangeWidthToPlayheadWidth=40,this.state={},this._playHead=r.createRef(),this._playHeadCircle=r.createRef(),this._onActiveAnimationChangedObserver=this.props.context.onActiveAnimationChanged.add((()=>{this.forceUpdate()})),this._onRangeFrameBarResizedObserver=this.props.context.onRangeFrameBarResized.add((e=>{this._viewWidth=e-this._rangeWidthToPlayheadWidth})),this._onBeforeRenderObserver=this.props.context.scene.onBeforeRenderObservable.add((()=>{if(0===this.props.context.activeAnimations.length)return;const e=this.props.context.activeAnimations[0];if(!e)return;const t=e.runtimeAnimations[0];t?this._moveHead(t.currentFrame):this._playHeadCircle.current?.innerHTML||this._moveHead(0)})),this._onMoveToFrameRequiredObserver=this.props.context.onMoveToFrameRequired.add((e=>{this.props.context.moveToFrame(e),this._moveHead(e)})),this._onGraphMovedObserver=this.props.context.onGraphMoved.add((e=>{this._offsetX=e,this.forceUpdate(),this._moveHead(this.props.context.activeFrame)})),this._onGraphScaledObserver=this.props.context.onGraphScaled.add((e=>{this._viewScale=1/e,this.forceUpdate(),this._moveHead(this.props.context.activeFrame)}))}_moveHead(e){this._playHead.current&&this._playHeadCircle.current&&void 0!==e&&(this._playHead.current.style.left=this._frameToPixel(e)+"px",this._playHeadCircle.current.innerHTML=e.toFixed(0),this.props.context.activeFrame=e,this.props.context.onPlayheadMoved.notifyObservers(e))}_frameToPixel(e){const t=this.props.context.referenceMinFrame;return((e-t)/(this.props.context.referenceMaxFrame-t)*this._graphAbsoluteWidth+this._offsetX)*this._viewScale}_pixelToFrame(e,t){const{minFrame:r,maxFrame:n,width:o,offset:s,scale:a}=t,i=this.props.context.activeAnimations[0].getKeys();return Math.max((e/a-s)/o*(n-r)+r,i[0].frame)}componentWillUnmount(){this._onBeforeRenderObserver&&(this.props.context.scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=null),this._onActiveAnimationChangedObserver&&this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver),this._onRangeFrameBarResizedObserver&&this.props.context.onRangeFrameBarResized.remove(this._onRangeFrameBarResizedObserver),this._onMoveToFrameRequiredObserver&&this.props.context.onMoveToFrameRequired.remove(this._onMoveToFrameRequiredObserver),this._onGraphMovedObserver&&this.props.context.onGraphMoved.remove(this._onGraphMovedObserver),this._onGraphScaledObserver&&this.props.context.onGraphScaled.remove(this._onGraphScaledObserver)}_getPixelValues(e){let t,r,n,o,s;return e?(t=this.props.context.fromKey,r=this.props.context.toKey,n=this._viewWidth,o=this._offsetRange,s=1):(t=this.props.context.referenceMinFrame,r=this.props.context.referenceMaxFrame,n=this._graphAbsoluteWidth,o=this._offsetX,s=this._viewScale),{minFrame:t,maxFrame:r,width:n,offset:o,scale:s}}_onPointerDown(e,t){e.preventDefault(),this._pointerIsDown=!0,e.currentTarget.setPointerCapture(e.pointerId);const r=this._getPixelValues(t),n=this._pixelToFrame(e.nativeEvent.offsetX,r);this.props.context.moveToFrame(n),this._moveHead(n)}_onPointerMove(e,t){if(!this._pointerIsDown)return;const r=this._getPixelValues(t),n=this._pixelToFrame(e.nativeEvent.offsetX,r);this.props.context.moveToFrame(n),this._moveHead(n)}_onPointerUp(e){this._pointerIsDown=!1,e.currentTarget.releasePointerCapture(e.pointerId)}render(){return 0===this.props.context.activeAnimations.length?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{id:"play-head",ref:this._playHead,children:[(0,s.jsx)("div",{id:"play-head-bar"}),(0,s.jsx)("div",{id:"play-head-circle",ref:this._playHeadCircle})]}),(0,s.jsx)("div",{id:"play-head-control",onPointerDown:e=>this._onPointerDown(e,!1),onPointerMove:e=>this._onPointerMove(e,!1),onPointerUp:e=>this._onPointerUp(e)}),(0,s.jsx)("div",{id:"play-head-control-2",onPointerDown:e=>this._onPointerDown(e,!0),onPointerMove:e=>this._onPointerMove(e,!0),onPointerUp:e=>this._onPointerUp(e)})]})}}class _s extends r.Component{constructor(e){super(e),this._viewWidth=748,this._offsetX=10,this._isMounted=!1,this.state={},this._svgHost=r.createRef(),this.props.context.onHostWindowResized.add((()=>{this._computeSizes()})),this._onActiveAnimationChangedObserver=this.props.context.onActiveAnimationChanged.add((()=>{this._isMounted&&(this._computeSizes(),this.forceUpdate())})),this._onPlayheadMovedObserver=this.props.context.onPlayheadMoved.add((()=>{this.forceUpdate()})),this.props.context.onFrameSet.add((()=>{this._isMounted&&this.forceUpdate()})),this._onFrameManuallyEnteredObserver=this.props.context.onFrameManuallyEntered.add((()=>{this._isMounted&&this.forceUpdate()})),this.props.context.onRangeUpdated.add((()=>{this._isMounted&&this.forceUpdate()}))}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._onActiveAnimationChangedObserver&&this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver),this._onPlayheadMovedObserver&&this.props.context.onPlayheadMoved.remove(this._onPlayheadMovedObserver),this._onFrameManuallyEnteredObserver&&this.props.context.onFrameManuallyEntered.remove(this._onFrameManuallyEnteredObserver),this._isMounted=!1}_computeSizes(){this._svgHost.current&&(this._viewWidth=this._svgHost.current.clientWidth,this.props.context.onRangeFrameBarResized.notifyObservers(this._viewWidth),this.forceUpdate())}_dropKeyFrames(e){const t=this.props.context.fromKey,r=(this.props.context.toKey-t)/this._viewWidth;return e.getKeys().map(((e,n)=>{const o=(e.frame-t)/r;return(0,s.jsx)("line",{x1:o,y1:"0px",x2:o,y2:"40px",style:{stroke:"#ffc017",strokeWidth:.5}},"frame-line"+e.frame+n)}))}_buildActiveFrame(){if(null===this.props.context.activeFrame||void 0===this.props.context.activeFrame)return null;const e=this.props.context.fromKey,t=(this.props.context.toKey-e)/this._viewWidth,r=(this.props.context.activeFrame-e)/t;return(0,s.jsx)("line",{x1:r,y1:"0px",x2:r,y2:"40px",style:{stroke:"#ffffff",strokeWidth:.5}},"line-activeFrame")}_buildFrames(){if(0===this.props.context.activeAnimations.length)return null;const e=this.props.context.fromKey,t=this.props.context.toKey-e,r=t/this._viewWidth,n=Math.max(Math.floor(25*r),1),o=[],a=e+t;for(let t=e;t<=a;t+=n)o.push(t);return o[o.length-1]{const o=(t-e)/r;return(0,s.jsxs)("g",{children:[(0,s.jsx)("line",{x1:o,y1:"22px",x2:o,y2:"40px",style:{stroke:"#333333",strokeWidth:.5}},"line"+t+n),(0,s.jsx)("text",{x:o,y:0,dx:"6px",textAnchor:"middle",dy:"14px",style:{fontFamily:"acumin-pro-condensed",fontSize:"12px",fill:"#555555",textAlign:"center"},children:t.toFixed(0)},"label"+t+n)]},"axis"+t+n)}))}render(){const e=`${-this._offsetX} 0 ${this._viewWidth+4*this._offsetX} 40`;return(0,s.jsx)("div",{id:"range-frame-bar",children:(0,s.jsxs)("svg",{id:"svg-range-frames",viewBox:e,ref:this._svgHost,children:[this._buildFrames(),this.props.context.activeAnimations.map((e=>this._dropKeyFrames(e))),this._buildActiveFrame()]})})}}var zs=p(8143),Rs={};Rs.styleTagTransform=Xn(),Rs.setAttributes=Zn(),Rs.insert=Wn().bind(null,"head"),Rs.domAPI=Hn(),Rs.insertStyleElement=Jn(),Gn()(zs.Z,Rs),zs.Z&&zs.Z.locals&&zs.Z.locals;class Bs extends r.Component{constructor(e){super(e),this.state={},this._onActiveAnimationChangedObserver=this.props.context.onActiveAnimationChanged.add((()=>{this.forceUpdate()}))}componentWillUnmount(){this._onActiveAnimationChangedObserver&&this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver)}render(){return(0,s.jsxs)("div",{id:"canvas-zone",children:[(0,s.jsx)(Ss,{globalState:this.props.globalState,context:this.props.context}),(0,s.jsx)(Ds,{globalState:this.props.globalState,context:this.props.context}),(0,s.jsx)(Ts,{context:this.props.context,globalState:this.props.globalState}),(0,s.jsx)(_s,{context:this.props.context,globalState:this.props.globalState}),this.props.context.activeAnimations.length>0&&(0,s.jsx)("div",{id:"angle-mode"})]})}}var Us=p(9460);class Gs extends r.Component{constructor(e){super(e);let t=!1;if(-1!==this.props.context.activeAnimations.indexOf(this.props.animation)&&this.props.context.activeKeyPoints)for(const e of this.props.context.activeKeyPoints)e.state.selectedState===Ls.Selected&&e.props.channel===this.props.color&&(t=!0);this.state={isSelected:t},this._onActiveAnimationChangedObserver=e.context.onActiveAnimationChanged.add((()=>{this.forceUpdate()})),this._onActiveKeyPointChangedObserver=this.props.context.onActiveKeyPointChanged.add((()=>{let e=!1;if(this.props.context.activeKeyPoints)for(const t of this.props.context.activeKeyPoints)if(t.props.curve.animation===this.props.animation&&t.props.channel===this.props.color&&-1!==this.props.context.activeAnimations.indexOf(this.props.animation)){e=!0;break}this.setState({isSelected:e})}))}componentWillUnmount(){this._onActiveAnimationChangedObserver&&this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver),this._onActiveKeyPointChangedObserver&&this.props.context.onActiveKeyPointChanged.remove(this._onActiveKeyPointChangedObserver)}_activate(e){const t=this.props.context.activeAnimations.indexOf(this.props.animation);-1!==t&&this.props.context.getActiveChannel(this.props.animation)===this.props.color||(e.ctrlKey?-1===t&&this.props.context.activeAnimations.push(this.props.animation):(this.props.context.activeAnimations=[this.props.animation],this.props.context.resetAllActiveChannels()),this.props.context.enableChannel(this.props.animation,this.props.color),this.props.context.onActiveAnimationChanged.notifyObservers({}))}render(){const e=-1!==this.props.context.activeAnimations.indexOf(this.props.animation)&&this.props.context.isChannelEnabled(this.props.animation,this.props.color);return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"animation-entry"+(e?" isActive":""),children:[this.state.isSelected&&(0,s.jsx)("div",{className:"animation-active-indicator",children:(0,s.jsx)("img",{src:Us})}),(0,s.jsx)("div",{className:"animation-name",style:{color:this.props.color},onClick:e=>this._activate(e),children:this.props.subName})]})})}}class Fs extends r.Component{constructor(e){super(e),this._unmount=!1,this.state={isExpanded:!1,isSelected:!1},this._onActiveAnimationChangedObserver=e.context.onActiveAnimationChanged.add((()=>{this._unmount||(-1===this.props.context.activeAnimations.indexOf(this.props.animation)&&this.setState({isSelected:!1}),this.forceUpdate())})),this._onActiveKeyPointChangedObserver=this.props.context.onActiveKeyPointChanged.add((()=>{this.setState({isSelected:this.props.animation.dataType===o.Animation.ANIMATIONTYPE_FLOAT&&-1!==this.props.context.activeAnimations.indexOf(this.props.animation)&&null!==this.props.context.activeKeyPoints&&this.props.context.activeKeyPoints.length>0&&this.props.context.activeKeyPoints.some((e=>e.props.curve.animation===this.props.animation))})})),this._onSelectToActivatedObserver=this.props.context.onSelectToActivated.add((e=>{const t=this.props.context.getAnimationSortIndex(this.props.animation),r=this.props.context.activeAnimations.indexOf(this.props.animation);t>e.from&&t<=e.to||t>=e.to&&t{this._unmount||this.forceUpdate()})),this.props.context.onEditAnimationRequired.notifyObservers(this.props.animation)}_onDelete(){this.props.context.onDeleteAnimation.notifyObservers(this.props.animation)}componentWillUnmount(){this._unmount=!0,this._onActiveAnimationChangedObserver&&this.props.context.onActiveAnimationChanged.remove(this._onActiveAnimationChangedObserver),this._onActiveKeyPointChangedObserver&&this.props.context.onActiveKeyPointChanged.remove(this._onActiveKeyPointChangedObserver),this._onSelectToActivatedObserver&&this.props.context.onSelectToActivated.remove(this._onSelectToActivatedObserver)}_activate(e){if(e.shiftKey){if(this.props.context.activeAnimations.length>0){const e=this.props.context.activeAnimations[0],t={from:this.props.context.getAnimationSortIndex(e),to:this.props.context.getAnimationSortIndex(this.props.animation)};this.props.context.onSelectToActivated.notifyObservers(t),this.props.context.onActiveAnimationChanged.notifyObservers({})}}else{if(e.ctrlKey){const e=this.props.context.activeAnimations.indexOf(this.props.animation);-1!==e?this.props.context.activeAnimations.splice(e,1):this.props.context.activeAnimations.push(this.props.animation)}else this.props.context.activeAnimations=[this.props.animation],this.props.context.resetAllActiveChannels();this.props.context.disableChannel(this.props.animation),this.props.context.onActiveAnimationChanged.notifyObservers({})}}_expandOrCollapse(){this.setState({isExpanded:!this.state.isExpanded})}render(){const e=-1!==this.props.context.activeAnimations.indexOf(this.props.animation);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"animation-entry"+(e?" isActive":""),children:[this.state.isSelected&&(0,s.jsx)("div",{className:"animation-active-indicator",children:(0,s.jsx)("img",{src:Us})}),this.props.animation.dataType===o.Animation.ANIMATIONTYPE_FLOAT&&(0,s.jsx)("div",{className:"animation-chevron",children:(0,s.jsx)("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDEwIDEwIj48Y2lyY2xlIGN4PSI1IiBjeT0iNSIgcj0iMi44OSIgc3R5bGU9ImZpbGw6Izg4OCIvPjxyZWN0IHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgc3R5bGU9ImZpbGw6bm9uZSIvPjwvc3ZnPg=="})}),this.props.animation.dataType!==o.Animation.ANIMATIONTYPE_FLOAT&&(0,s.jsx)("div",{className:"animation-chevron",onClick:()=>this._expandOrCollapse(),children:(0,s.jsx)("img",{className:"animation-chevron-image"+(this.state.isExpanded?"":" collapsed"),src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDEwIDEwIj48cGF0aCBkPSJNNS40Myw3LjMxLDcuODEsMy4xOWEuNTEuNTEsMCwwLDAtLjE1LS42OC41NS41NSwwLDAsMC0uMjgtLjA3SDIuNjJhLjQ4LjQ4LDAsMCwwLS41LjQ3LjQ1LjQ1LDAsMCwwLC4wNy4yOEw0LjU3LDcuMzFhLjQ5LjQ5LDAsMCwwLC42Ni4yQS40OC40OCwwLDAsMCw1LjQzLDcuMzFaIiBzdHlsZT0iZmlsbDojODg4Ii8+PHJlY3Qgd2lkdGg9IjEwIiBoZWlnaHQ9IjEwIiBzdHlsZT0iZmlsbDpub25lIi8+PC9zdmc+"})}),(0,s.jsx)("div",{className:"animation-name",onClick:e=>this._activate(e),children:this.props.animation.name}),(0,s.jsx)(vs,{className:"animation-options",context:this.props.context,globalState:this.props.globalState,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIj48cmVjdCB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTAsNC4xYTYuNjIsNi42MiwwLDAsMSwxLjMzLjE2bC4zNC4zOS4xLjkyYS44NS44NSwwLDAsMCwuODMuNzUsMS4wOSwxLjA5LDAsMCwwLC40LS4wN2wuODUtLjM4LjUuMUE2LDYsMCwwLDEsMTUuNyw4LjI4bC0uMTcuNDktLjc1LjU2YS44My44MywwLDAsMC0uMTgsMS4xNi43Ny43NywwLDAsMCwuMTguMThsLjc1LjU2LjE3LjQ5QTYsNiwwLDAsMSwxNC4zLDE0bC0uNS4xLS44LS4zNWEuODUuODUsMCwwLDAtLjc2LjA1LjgzLjgzLDAsMCwwLS40MS42M2wtLjEuOTItLjM0LjM5YTUuODIsNS44MiwwLDAsMS0yLjY5LDBsLS4zMy0uMzktLjEtLjkyYS44My44MywwLDAsMC0uNDEtLjYzLjg1Ljg1LDAsMCwwLS43NiwwbC0uODUuMzdMNS43LDE0YTYsNiwwLDAsMS0xLjM1LTIuMzFsLjE3LS40OS43NS0uNTZhLjgzLjgzLDAsMCwwLC4xOC0xLjE2Ljc3Ljc3LDAsMCwwLS4xOC0uMThsLS43NS0uNTYtLjE3LS40OEE2LjA2LDYuMDYsMCwwLDEsNS43LDZsLjUtLjEuODUuMzhhLjg1Ljg1LDAsMCwwLC43NiwwLC44My44MywwLDAsMCwuNDEtLjYzbC4xLS45Mi4zNC0uMzlBNi4xOCw2LjE4LDAsMCwxLDEwLDQuMVpNMTAsNWE1LjY3LDUuNjcsMCwwLDAtLjgyLjA3bC0uMDcuNTlBMS43MywxLjczLDAsMCwxLDcuMiw3LjIxYTEuNTMsMS41MywwLDAsMS0uNTEtLjEzbC0uNTUtLjI0YTUsNSwwLDAsMC0uODEsMS40bC40OC4zNkExLjc0LDEuNzQsMCwwLDEsNi4xOCwxMWExLjg1LDEuODUsMCwwLDEtLjM3LjM3bC0uNDguMzZhNS4wNyw1LjA3LDAsMCwwLC44MSwxLjQxbC41NS0uMjRBMS43NCwxLjc0LDAsMCwxLDksMTMuOGEyLDIsMCwwLDEsLjE0LjUzbC4wNy41OWE0Ljg5LDQuODksMCwwLDAsMS42MiwwbC4wNy0uNTlhMS43NCwxLjc0LDAsMCwxLDEuOTEtMS41NSwxLjgyLDEuODIsMCwwLDEsLjUyLjE0bC41NS4yNGE1LDUsMCwwLDAsLjgxLTEuNGwtLjQ4LS4zNkExLjc0LDEuNzQsMCwwLDEsMTMuODIsOWExLjg1LDEuODUsMCwwLDEsLjM3LS4zN2wuNDgtLjM2YTUsNSwwLDAsMC0uODEtMS40bC0uNTUuMjRhMS44NiwxLjg2LDAsMCwxLS43LjE0LDEuNzQsMS43NCwwLDAsMS0xLjczLTEuNTVsLS4wNy0uNTlBNC40NSw0LjQ1LDAsMCwwLDEwLDVabTAsMi43MkEyLjI3LDIuMjcsMCwxLDEsNy43MywxMCwyLjI3LDIuMjcsMCwwLDEsMTAsNy43MmgwWm0wLC45MUExLjM2LDEuMzYsMCwxLDAsMTEuMzYsMTAsMS4zNiwxLjM2LDAsMCwwLDEwLDguNjNaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+",onClick:()=>this._onGear()}),(0,s.jsx)(vs,{className:"animation-delete",context:this.props.context,globalState:this.props.globalState,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxnIGlkPSJVSSI+PHBhdGggY2xhc3M9ImNscy0xIiBkPSJNMjEuMTMsMjAsMjgsMjYuODcsMjYuODcsMjgsMjAsMjEuMTMsMTMuMTMsMjgsMTIsMjYuODcsMTguODcsMjAsMTIsMTMuMTMsMTMuMTMsMTIsMjAsMTguODcsMjYuODcsMTIsMjgsMTMuMTNaIi8+PC9nPjwvc3ZnPg==",onClick:()=>this._onDelete()})]}),this.state.isExpanded&&this.props.animation.dataType===o.Animation.ANIMATIONTYPE_COLOR3&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Gs,{globalState:this.props.globalState,context:this.props.context,animation:this.props.animation,color:"#DB3E3E",subName:"Red"}),(0,s.jsx)(Gs,{globalState:this.props.globalState,context:this.props.context,animation:this.props.animation,color:"#51E22D",subName:"Green"}),(0,s.jsx)(Gs,{globalState:this.props.globalState,context:this.props.context,animation:this.props.animation,color:"#00A3FF",subName:"Blue"})]}),this.state.isExpanded&&this.props.animation.dataType===o.Animation.ANIMATIONTYPE_VECTOR3&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Gs,{globalState:this.props.globalState,context:this.props.context,animation:this.props.animation,color:"#DB3E3E",subName:"X"}),(0,s.jsx)(Gs,{globalState:this.props.globalState,context:this.props.context,animation:this.props.animation,color:"#51E22D",subName:"Y"}),(0,s.jsx)(Gs,{globalState:this.props.globalState,context:this.props.context,animation:this.props.animation,color:"#00A3FF",subName:"Z"})]}),this.state.isExpanded&&this.props.animation.dataType===o.Animation.ANIMATIONTYPE_VECTOR2&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Gs,{globalState:this.props.globalState,context:this.props.context,animation:this.props.animation,color:"#DB3E3E",subName:"X"}),(0,s.jsx)(Gs,{globalState:this.props.globalState,context:this.props.context,animation:this.props.animation,color:"#51E22D",subName:"Y"})]})]})}}class Hs extends r.Component{constructor(e){super(e),this.state={isVisible:!0},this._onEditAnimationRequiredObserver=this.props.context.onEditAnimationRequired.add((()=>{this.setState({isVisible:!1})})),this._onEditAnimationUIClosedObserver=this.props.context.onEditAnimationUIClosed.add((()=>{this.setState({isVisible:!0})})),this._onDeleteAnimationObserver=this.props.context.onDeleteAnimation.add((()=>{this.forceUpdate()}))}componentWillUnmount(){this._onEditAnimationRequiredObserver&&this.props.context.onEditAnimationRequired.remove(this._onEditAnimationRequiredObserver),this._onEditAnimationUIClosedObserver&&this.props.context.onEditAnimationUIClosed.remove(this._onEditAnimationUIClosedObserver),this._onDeleteAnimationObserver&&this.props.context.onDeleteAnimation.remove(this._onDeleteAnimationObserver)}render(){return this.state.isVisible?(0,s.jsx)("div",{id:"animation-list",children:this.props.context.animations?.map(((e,t)=>(0,s.jsx)(Fs,{globalState:this.props.globalState,context:this.props.context,animation:this.props.context.useTargetAnimations?e.animation:e},t)))}):null}}class Vs{static _SaveAs(e,t,r){if("download"in HTMLAnchorElement.prototype){const n=window.URL||window.webkitURL,o=r.createElement("a");return o.download=t,o.rel="noopener",o.href=n.createObjectURL(e),setTimeout((()=>{n.revokeObjectURL(o.href)}),4e4),void setTimeout((()=>{this._Click(o,r)}),0)}let n=open("","_blank");n&&(n.document.title=n.document.body.innerText="downloading...");const o="application/octet-stream"===e.type,s=/constructor/i.test(window.HTMLElement)||window.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||o&&s)&&"undefined"!=typeof FileReader){const t=new FileReader;t.onloadend=()=>{let e=t.result;e=a?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=e:location=e,n=null},t.readAsDataURL(e)}else{const t=window.URL||window.webkitURL,r=t.createObjectURL(e);n?n.location.href=r:location.href=r,n=null,setTimeout((function(){t.revokeObjectURL(r)}),4e4)}}static _Click(e,t){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){const n=t.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}static DownloadAsFile(e,t,r){const n=new Blob([t],{type:"application/octet-stream"});this._SaveAs(n,r,e)}}class Ws extends r.Component{constructor(e){if(super(e),this._selectedAnimations=[],this.state={},this._root=r.createRef(),this.props.context.animations)if(this.props.context.useTargetAnimations)for(const e of this.props.context.animations)this._selectedAnimations.push(e.animation);else this._selectedAnimations=this.props.context.animations.slice(0)}_getJson(){const e={animations:[]};for(const t of this._selectedAnimations)e.animations.push(t.serialize());return JSON.stringify(e)}saveToSnippetServer(){const e=new XMLHttpRequest,t=this._root.current.ownerDocument,r=this._getJson();e.onreadystatechange=()=>{if(4==e.readyState)if(200==e.status){const r=JSON.parse(e.responseText),n=this.props.context.snippetId;this.props.context.snippetId=r.id,r.version&&"0"!=r.version&&(this.props.context.snippetId+="#"+r.version),this.forceUpdate();const o=window;o.Playground&&n&&o.Playground.onRequestCodeChangeObservable.notifyObservers({regex:new RegExp(n,"g"),replace:this.props.context.snippetId}),t.defaultView.alert("Animations saved with ID: "+this.props.context.snippetId)}else t.defaultView.alert(`Unable to save your animations. It may be too large (${(n.payload.length/1024).toFixed(2)} KB). Please try reducing the number of animations or the number of keys per animation and try again.`)},e.open("POST",o.Animation.SnippetUrl+(this.props.context.snippetId?"/"+this.props.context.snippetId:""),!0),e.setRequestHeader("Content-Type","application/json");const n={payload:JSON.stringify({animations:r}),name:"",description:"",tags:""};e.send(JSON.stringify(n))}saveToFile(){Vs.DownloadAsFile(this._root.current.ownerDocument,this._getJson(),"animations.json")}render(){return(0,s.jsxs)("div",{id:"save-animation-pane",ref:this._root,children:[(0,s.jsx)("div",{id:"save-animation-list",children:this.props.context.animations?.map(((e,t)=>{const r=this.props.context.useTargetAnimations?e.animation:e;return(0,s.jsxs)("div",{className:"save-animation-list-entry",children:[(0,s.jsx)("input",{type:"checkbox",value:r.name,defaultChecked:!0,onClick:e=>{if(e.currentTarget.checked)this._selectedAnimations.push(r);else{const e=this._selectedAnimations.indexOf(r);e>-1&&this._selectedAnimations.splice(e,1)}}}),r.name]},t)}))}),(0,s.jsxs)("div",{id:"save-animation-buttons",children:[(0,s.jsx)("button",{className:"simple-button",id:"save-snippet",type:"button",onClick:()=>{this.saveToSnippetServer()},children:"Save Snippet"}),(0,s.jsx)("button",{className:"simple-button",id:"save-file",type:"button",onClick:()=>{this.saveToFile()},children:"Save File"})]}),this.props.context.snippetId&&(0,s.jsxs)("div",{id:"save-animation-snippet",children:["Snippet ID: ",this.props.context.snippetId]})]})}}class Ys extends r.Component{constructor(e){super(e),this.state={},this._root=r.createRef(),this._textInput=r.createRef()}loadFromFile(e){const t=e.target.files;if(!t||!t.length)return;const r=t[0];o.Tools.ReadFile(r,(e=>{const t=this.props.context,r=new TextDecoder("utf-8"),n=JSON.parse(r.decode(e)).animations;t.animations=[];const s=t.animations;for(const e of n)s.push(o.Animation.Parse(e));t.stop(),t.target.animations=s,t.activeAnimations=s.length?s:[],t.prepare(),t.onAnimationsLoaded.notifyObservers(),t.onActiveAnimationChanged.notifyObservers({})}),void 0,!0),e.target.value=""}loadFromSnippetServer(){const e=this.props.context,t=this._textInput.current.value;o.Animation.ParseFromSnippetAsync(t).then((r=>{e.snippetId=t,void 0!==r.length?e.animations=r:e.animations=[r],e.stop(),e.target.animations=e.animations,e.activeAnimations=e.animations.length?e.animations:[],e.prepare(),e.onAnimationsLoaded.notifyObservers(),e.onActiveAnimationChanged.notifyObservers({})})).catch((e=>{this._root.current?.ownerDocument.defaultView.alert("Unable to load your animations: "+e)}))}render(){return(0,s.jsxs)("div",{id:"load-animation-pane",ref:this._root,children:[(0,s.jsx)("div",{id:"load-animation-snippet-id-label",children:"Snippet Id"}),(0,s.jsx)("div",{id:"load-animation-local-file-label",children:"Local File"}),(0,s.jsx)("input",{type:"text",id:"load-snippet-id",ref:this._textInput}),(0,s.jsx)("button",{className:"simple-button",id:"load-snippet",type:"button",onClick:()=>this.loadFromSnippetServer(),children:"Load"}),(0,s.jsx)("label",{htmlFor:"upload-snippet",id:"file-snippet-label",className:"simple-button",children:"Browse"}),(0,s.jsx)("input",{id:"upload-snippet",type:"file",accept:".json",onChange:e=>this.loadFromFile(e)}),this.props.context.snippetId&&(0,s.jsxs)("div",{id:"load-animation-snippet",children:["Snippet ID: ",this.props.context.snippetId]})]})}}class Zs extends r.Component{constructor(e){super(e),this.state={customPropertyMode:!1},this._root=r.createRef(),this._displayName=r.createRef(),this._property=r.createRef(),this._typeElement=r.createRef(),this._loopModeElement=r.createRef(),this._propertylement=r.createRef()}createNew(){const e=this.props.context,t=this._displayName.current.ownerDocument,r=this._displayName.current.value,n=this._property.current?this._property.current.value:this._propertylement.current.value,s=this._typeElement.current?this._typeElement.current.value:this.getInferredType(),a=this._loopModeElement.current.value;if(!r)return void t.defaultView.alert("Please define a display name");if(!n)return void t.defaultView.alert("Please define a property");const i=this.props.context.animations&&this.props.context.animations.length?this.props.context.useTargetAnimations?this.props.context.animations[0].animation.framePerSecond:this.props.context.animations[0].framePerSecond:60;let l=this.props.context.referenceMinFrame,p=this.props.context.referenceMaxFrame;if(this.props.context.animations)for(const e of this.props.context.animations){const t=this.props.context.useTargetAnimations?e.animation:e;l=Math.min(l,t.getKeys()[0].frame),p=Math.max(p,t.getKeys()[t.getKeys().length-1].frame)}let c,d,h,u,b,g,m=0,A=0;switch(s){case"Float":m=o.Animation.ANIMATIONTYPE_FLOAT,c=0,d=1,h=0,u=0,b=0,g=0;break;case"Vector2":m=o.Animation.ANIMATIONTYPE_VECTOR2,c=o.Vector2.Zero(),d=new o.Vector2(1,1),h=new o.Vector2(0,0),u=new o.Vector2(0,0),b=new o.Vector2(0,0),g=new o.Vector2(0,0);break;case"Vector3":m=o.Animation.ANIMATIONTYPE_VECTOR3,c=o.Vector3.Zero(),d=new o.Vector3(1,1,1),h=new o.Vector3(0,0,0),u=new o.Vector3(0,0,0),b=new o.Vector3(0,0,0),g=new o.Vector3(0,0,0);break;case"Quaternion":m=o.Animation.ANIMATIONTYPE_QUATERNION,c=o.Quaternion.Zero(),d=new o.Quaternion(1,1,1,0),h=new o.Quaternion(0,0,0,0),u=new o.Quaternion(0,0,0,0),b=new o.Quaternion(0,0,0,0),g=new o.Quaternion(0,0,0,0);break;case"Color3":m=o.Animation.ANIMATIONTYPE_COLOR3,c=o.Color3.Black(),d=o.Color3.White(),h=new o.Color3(0,0,0),u=new o.Color3(0,0,0),b=new o.Color3(0,0,0),g=new o.Color3(0,0,0);break;case"Color4":m=o.Animation.ANIMATIONTYPE_COLOR4,c=new o.Color4(0,0,0,0),d=new o.Color4(1,1,1,1),h=new o.Color4(0,0,0,0),u=new o.Color4(0,0,0,0),b=new o.Color4(0,0,0,0),g=new o.Color4(0,0,0,0)}switch(a){case"Cycle":A=o.Animation.ANIMATIONLOOPMODE_CYCLE;break;case"Relative":A=o.Animation.ANIMATIONLOOPMODE_RELATIVE;break;case"Constant":A=o.Animation.ANIMATIONLOOPMODE_CONSTANT}const C=new o.Animation(r,n,i,m,A),f=[];f.push({frame:l,value:c,inTangent:h,outTangent:u}),f.push({frame:p,value:d,inTangent:b,outTangent:g}),C.setKeys(f),e.stop(),e.animations&&0!==e.animations.length||(e.animations=[],e.target&&(e.target.animations=e.animations)),e.useTargetAnimations||e.animations.push(C),e.activeAnimations.push(C),e.prepare(),e.onActiveAnimationChanged.notifyObservers({}),e.onAnimationsLoaded.notifyObservers()}getInferredType(e=""){const t=this.props.context.target;this._propertylement.current&&(e=this._propertylement.current.value);const r=t[e];return isNaN(parseFloat(r))?r.getClassName():"Float"}render(){const e=[];let t="";if(this.props.context.target){let r=this.props.context.target;const n=r;for(;null!==r;){const t=Object.getOwnPropertyDescriptors(r);for(const r in t){const o=t[r];"_"!==r[0]&&null!==n[r]&&void 0!==n[r]&&(void 0===n[r].r&&void 0===n[r].x&&isNaN(parseFloat(n[r]))||-1===e.indexOf(r)&&(o.writable||o.set)&&e.push(r))}r=Object.getPrototypeOf(r)}e.sort();const o=["scaling","rotation","position"];for(const t of o){const r=e.indexOf(t);-1!==r&&(e.splice(r,1),e.splice(0,0,t))}t=this._propertylement.current?this.getInferredType():this.getInferredType(e[0])}const r=this.state.customPropertyMode||0===e.length;return(0,s.jsxs)("div",{id:"add-animation-pane",ref:this._root,children:[(0,s.jsx)("div",{id:"add-animation-display-name-label",children:"Display Name"}),(0,s.jsx)("div",{id:"add-animation-mode-label",children:"Mode"}),(0,s.jsx)("div",{id:"add-animation-property-label",children:"Property"}),(0,s.jsx)("div",{id:"add-animation-type-label",children:"Type"}),(0,s.jsx)("div",{id:"add-animation-loop-mode-label",children:"Loop Mode"}),(0,s.jsx)("input",{type:"text",id:"add-animation-name",ref:this._displayName,className:"input-text",defaultValue:""}),(0,s.jsx)("select",{id:"add-animation-mode",className:"option",value:this.state.customPropertyMode?"Custom":"List",onChange:e=>{this.setState({customPropertyMode:"Custom"===e.currentTarget.value})},children:["Custom","List"].map(((e,t)=>(0,s.jsx)("option",{value:e,title:e,children:e},e+t)))}),r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("input",{type:"text",id:"add-animation-property",ref:this._property,className:"input-text",defaultValue:""}),(0,s.jsx)("select",{id:"add-animation-type",className:"option",ref:this._typeElement,children:["Float","Vector2","Vector3","Quaternion","Color3","Color4"].map(((e,t)=>(0,s.jsx)("option",{value:e,title:e,children:e},e+t)))})]}),!r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("select",{id:"add-animation-property",className:"option",ref:this._propertylement,onClick:()=>{this.forceUpdate()},children:e.map(((e,t)=>(0,s.jsx)("option",{value:e,title:e,children:e},e+t)))}),(0,s.jsx)("div",{id:"add-animation-type",children:t})]}),(0,s.jsx)("select",{id:"add-animation-loop-mode",className:"option",ref:this._loopModeElement,children:["Cycle","Relative","Constant"].map(((e,t)=>(0,s.jsx)("option",{value:e,title:e,children:e},e+t)))}),(0,s.jsx)("button",{className:"simple-button",id:"add-animation",type:"button",onClick:()=>this.createNew(),children:"Create"})]})}}class Qs extends r.Component{constructor(e){super(e),this.state={isVisible:!1,animation:null},this._root=r.createRef(),this._displayName=r.createRef(),this._property=r.createRef(),this._loopModeElement=r.createRef(),this._onEditAnimationRequiredObserver=this.props.context.onEditAnimationRequired.add((e=>{this.setState({isVisible:!0,animation:e})}))}componentWillUnmount(){this._onEditAnimationRequiredObserver&&this.props.context.onEditAnimationRequired.remove(this._onEditAnimationRequiredObserver)}close(){this.setState({isVisible:!1}),this.props.context.onEditAnimationUIClosed.notifyObservers()}validate(){const e=this.props.context,t=this._displayName.current.ownerDocument,r=this._displayName.current.value,n=this._property.current.value,s=this._loopModeElement.current.value;if(!r)return void t.defaultView.alert("Please define a display name");if(!n)return void t.defaultView.alert("Please define a property");const a=this.state.animation;switch(a.name=r,a.targetProperty!==n&&(a.targetProperty=n,a.targetPropertyPath=n.split("."),e.stop()),s){case"Cycle":a.loopMode=o.Animation.ANIMATIONLOOPMODE_CYCLE;break;case"Relative":a.loopMode=o.Animation.ANIMATIONLOOPMODE_RELATIVE;break;case"Constant":a.loopMode=o.Animation.ANIMATIONLOOPMODE_CONSTANT}this.close()}render(){if(!this.state.isVisible)return null;const e=["Relative","Cycle","Constant"];return(0,s.jsxs)("div",{id:"edit-animation-pane",ref:this._root,children:[(0,s.jsx)("div",{id:"edit-animation-display-name-label",children:"Display Name"}),(0,s.jsx)("div",{id:"edit-animation-property-label",children:"Property"}),(0,s.jsx)("div",{id:"edit-animation-loop-mode-label",children:"Loop Mode"}),(0,s.jsx)("input",{type:"text",id:"edit-animation-name",ref:this._displayName,className:"input-text",defaultValue:this.state.animation.name||""}),(0,s.jsx)("input",{type:"text",id:"edit-animation-property",ref:this._property,className:"input-text",defaultValue:this.state.animation.targetProperty}),(0,s.jsx)("select",{id:"edit-animation-loop-mode",className:"option",ref:this._loopModeElement,defaultValue:e[this.state.animation.loopMode??1],children:e.map(((e,t)=>(0,s.jsx)("option",{value:e,title:e,children:e},e+t)))}),(0,s.jsxs)("div",{id:"edit-animation",children:[(0,s.jsx)("button",{className:"simple-button",id:"edit-animation-ok",type:"button",onClick:()=>this.validate(),children:"OK"}),(0,s.jsx)("button",{className:"simple-button",id:"edit-animation-cancel",type:"button",onClick:()=>this.close(),children:"Cancel"})]})]})}}var Js,Ks=p(1367),Xs={};Xs.styleTagTransform=Xn(),Xs.setAttributes=Zn(),Xs.insert=Wn().bind(null,"head"),Xs.domAPI=Hn(),Xs.insertStyleElement=Jn(),Gn()(Ks.Z,Xs),Ks.Z&&Ks.Z.locals&&Ks.Z.locals,function(e){e[e.Edit=0]="Edit",e[e.Add=1]="Add",e[e.Load=2]="Load",e[e.Save=3]="Save"}(Js||(Js={}));class qs extends r.Component{constructor(e){super(e),this.state={mode:Js.Edit},this.props.context.onDeleteAnimation.add((e=>{const t=this.props.context.activeAnimations.indexOf(e);-1!==t&&(this.props.context.activeAnimations.splice(t,1),this.props.context.onActiveAnimationChanged.notifyObservers({}));let r=-1;if(this.props.context.useTargetAnimations){const t=this.props.context.animations;for(let n=0;n-1&&(this.props.context.animations.splice(r,1),this.forceUpdate())})),this.props.context.onAnimationsLoaded.add((()=>this.setState({mode:Js.Edit})))}_onAddAnimation(){this.state.mode!==Js.Add&&this.setState({mode:Js.Add})}_onLoadAnimation(){this.state.mode!==Js.Load&&this.setState({mode:Js.Load})}_onSaveAnimation(){this.state.mode!==Js.Save&&this.setState({mode:Js.Save})}_onEditAnimation(){this.state.mode!==Js.Edit&&this.setState({mode:Js.Edit})}render(){let e="60";return this.props.context.animations&&this.props.context.animations.length&&(e=this.props.context.useTargetAnimations?this.props.context.animations[0].animation.framePerSecond.toString():this.props.context.animations[0].framePerSecond.toString()),(0,s.jsxs)("div",{id:"sideBar",children:[(0,s.jsxs)("div",{id:"menu-bar",className:this.props.context.useTargetAnimations?"small":"",children:[!this.props.context.useTargetAnimations&&(0,s.jsx)(vs,{tooltip:"Add new animation",isActive:this.state.mode===Js.Add,id:"add-animation",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cmVjdCB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTUsOC4yN2EuNTguNTgsMCwwLDEsLjU3LjV2NS42NWg1LjU3YS41OC41OCwwLDAsMSwuMDgsMS4xNUgxNS41OHY1LjU3YS41OC41OCwwLDAsMS0xLjE1LjA4VjE1LjU4SDguODVhLjU4LjU4LDAsMCwxLS4wOC0xLjE1aDUuNjVWOC44NUEuNTguNTgsMCwwLDEsMTUsOC4yN1oiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>this._onAddAnimation()}),!this.props.context.useTargetAnimations&&(0,s.jsx)(vs,{tooltip:"Load animations",isActive:this.state.mode===Js.Load,id:"load-animation",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cmVjdCB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAuMDYsOC4zOGEuNTkuNTksMCwwLDAsLjY2LS41MS41OS41OSwwLDAsMC0uNTEtLjY2SDkuOTNhLjU5LjU5LDAsMCwwLS41MS42Ni41Ny41NywwLDAsMCwuNTEuNTFaTTE0LjkyLDIyLjc5SDE1YS41OS41OSwwLDAsMCwuNTgtLjVWMTEuNTVsMi45LDIuODlhLjU4LjU4LDAsMCwwLC43Ni4wNmwuMDctLjA2YS41OS41OSwwLDAsMCwuMDUtLjc2bC0uMDUtLjA2LTMuOS0zLjg5YS41OC41OCwwLDAsMC0uNzYtLjA2bC0uMDYuMDUtMy45LDMuOWEuNTguNTgsMCwwLDAsMCwuODFoMGEuNTguNTgsMCwwLDAsLjc2LjA2bC4wNy0uMDYsMi44OS0yLjg5VjIyLjIxQS41OS41OSwwLDAsMCwxNC45MiwyMi43OVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>this._onLoadAnimation()}),(0,s.jsx)(vs,{tooltip:"save current animations",isActive:this.state.mode===Js.Save,id:"save-animation",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cmVjdCB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNOCwxMC4xNkEyLjEzLDIuMTMsMCwwLDEsMTAuMSw4aDcuNzhhMi41MSwyLjUxLDAsMCwxLDEuNzguNzNsMS41OCwxLjU4QTIuNTMsMi41MywwLDAsMSwyMiwxMi4xMnY3LjczQTIuMTMsMi4xMywwLDAsMSwxOS44OSwyMkgxMC4xNUEyLjE0LDIuMTQsMCwwLDEsOCwxOS44N1YxMC4xNlptMi4xMy0xYTEsMSwwLDAsMC0xLDF2OS42OWExLDEsMCwwLDAsMSwxaC4ydi00LjFBMS43NCwxLjc0LDAsMCwxLDEyLjA2LDE1aDUuODVhMS43NCwxLjc0LDAsMCwxLDEuNzQsMS43NGgwdjQuMDdoLjE5YTEsMSwwLDAsMCwxLTF2LTcuN2ExLjM4LDEuMzgsMCwwLDAtLjQtMWwtMS42LTEuNTNhMS4yNiwxLjI2LDAsMCwwLS43NC0uMzh2Mi4xMWExLjc0LDEuNzQsMCwwLDEtMS43NCwxLjc0SDEyLjg3YTEuNzMsMS43MywwLDAsMS0xLjc1LTEuNzNoMFY5LjE5Wm04LjM0LDExLjYzdi00YS41OS41OSwwLDAsMC0uNTctLjU5SDEyLjA5YS41OC41OCwwLDAsMC0uNTguNThoMHY0LjA3Wk0xMi4yOSw5LjE5djIuMTNhLjU4LjU4LDAsMCwwLC41OC41OGgzLjQ4YS41OC41OCwwLDAsMCwuNTktLjU3aDBWOS4xOVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>this._onSaveAnimation()}),(0,s.jsx)(vs,{tooltip:"Edit animations",isActive:this.state.mode===Js.Edit,id:"edit-animation",globalState:this.props.globalState,context:this.props.context,icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCIgdmlld0JveD0iMCAwIDMwIDMwIj48cmVjdCB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjIsOEEyLjc5LDIuNzksMCwwLDEsMjIsMTJoMGwtOS4zMyw5LjMzYTEuNzYsMS43NiwwLDAsMS0uNzguNDVsLTQsMS4wOWEuNTguNTgsMCwwLDEtLjcyLS4zOS42Mi42MiwwLDAsMSwwLS4zM2wxLjA5LTRhMS43NiwxLjc2LDAsMCwxLC40NS0uNzhMMTguMDYsOEEyLjgsMi44LDAsMCwxLDIyLDhabS00LjcsMi40MUw5LjU2LDE4LjE1YS40Ni40NiwwLDAsMC0uMTUuMjZsLS44MiwzLDMtLjgyYS40Ni40NiwwLDAsMCwuMjYtLjE1bDcuNzUtNy43NVptMS41OC0xLjU4LS43NS43NSwyLjI5LDIuMjkuNzUtLjc1YTEuNjIsMS42MiwwLDAsMC0yLjI5LTIuMjlaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+",onClick:()=>this._onEditAnimation()}),(0,s.jsx)(ds,{value:e,complement:" fps",isNumber:!0,onValueAsNumberChanged:e=>{this.props.context.animations?.forEach((t=>{this.props.context.useTargetAnimations?t.animation.framePerSecond=e:t.framePerSecond=e}))},tooltip:"Framerate",id:"framerate-animation",globalState:this.props.globalState,context:this.props.context})]}),this.state.mode===Js.Edit&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Hs,{globalState:this.props.globalState,context:this.props.context}),(0,s.jsx)(Qs,{globalState:this.props.globalState,context:this.props.context})]}),this.state.mode===Js.Save&&(0,s.jsx)(Ws,{globalState:this.props.globalState,context:this.props.context}),this.state.mode===Js.Load&&(0,s.jsx)(Ys,{globalState:this.props.globalState,context:this.props.context}),this.state.mode===Js.Add&&(0,s.jsx)(Zs,{globalState:this.props.globalState,context:this.props.context})]})}}var $s=p(8712),ea={};ea.styleTagTransform=Xn(),ea.setAttributes=Zn(),ea.insert=Wn().bind(null,"head"),ea.domAPI=Hn(),ea.insertStyleElement=Jn(),Gn()($s.Z,ea),$s.Z&&$s.Z.locals&&$s.Z.locals;class ta extends r.Component{constructor(e){super(e),this.state={isOpen:!1}}onCloseAnimationCurveEditor(e){null!==e&&e.close(),this.setState({isOpen:!1}),this.props.context.activeAnimations=[],this.props.context.onActiveAnimationChanged.notifyObservers({})}shouldComponentUpdate(e,t){return t.isOpen!==this.state.isOpen&&(t.isOpen&&(this.props.context.prepare(),this.props.context.animations&&this.props.context.animations.length&&setTimeout((()=>{this.props.context.activeAnimations.push(this.props.context.useTargetAnimations?this.props.context.animations[0].animation:this.props.context.animations[0]),this.props.context.onActiveAnimationChanged.notifyObservers({})}))),!0)}_onKeyDown(e){switch(e.key){case"Delete":case"Backspace":this.props.context.activeKeyPoints?.length&&!this.props.context.focusedInput&&this.props.context.onDeleteKeyActiveKeyPoints.notifyObservers();break;case" ":this.props.context.isPlaying?this.props.context.stop():this.props.context.play(!0);break;case"a":e.ctrlKey&&(this.props.context.onSelectAllKeys.notifyObservers(),this.props.context.onActiveKeyPointChanged.notifyObservers(),e.preventDefault());break;case"ArrowLeft":this.props.context.focusedInput||this.props.context.onMoveToFrameRequired.notifyObservers(Math.max(0,this.props.context.activeFrame-1));break;case"ArrowRight":this.props.context.focusedInput||this.props.context.onMoveToFrameRequired.notifyObservers(Math.min(this.props.context.clipLength,this.props.context.activeFrame+1));break;case"ArrowDown":{const e=this.props.context.getPrevKey();null!==e&&this.props.context.onMoveToFrameRequired.notifyObservers(e);break}case"ArrowUp":{const e=this.props.context.getNextKey();null!==e&&this.props.context.onMoveToFrameRequired.notifyObservers(e)}}}render(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_n,{label:"Edit",onClick:()=>{this.setState({isOpen:!0})}}),this.state.isOpen&&(0,s.jsx)(cs,{id:"curve-editor",title:"Animation Curve Editor",size:{width:1024,height:512},onResize:()=>this.props.context.onHostWindowResized.notifyObservers(),onClose:e=>this.onCloseAnimationCurveEditor(e),onKeyDown:e=>this._onKeyDown(e),children:(0,s.jsxs)("div",{id:"curve-editor",children:[(0,s.jsx)(Os,{globalState:this.props.globalState,context:this.props.context}),(0,s.jsx)(qs,{globalState:this.props.globalState,context:this.props.context}),(0,s.jsx)(Bs,{globalState:this.props.globalState,context:this.props.context}),(0,s.jsx)(xs,{globalState:this.props.globalState,context:this.props.context})]})})]})}}class ra{constructor(){this.activeAnimations=[],this.activeChannels={},this.useExistingPlayRange=!1,this.forwardAnimation=!0,this.referenceMinFrame=0,this.referenceMaxFrame=100,this.focusedInput=!1,this.onActiveAnimationChanged=new o.Observable,this.onActiveKeyPointChanged=new o.Observable,this.onHostWindowResized=new o.Observable,this.onSelectAllKeys=new o.Observable,this.onActiveKeyFrameChanged=new o.Observable,this.onFrameSet=new o.Observable,this.onFrameManuallyEntered=new o.Observable,this.onMainKeyPointSet=new o.Observable,this.onMainKeyPointMoved=new o.Observable,this.onValueSet=new o.Observable,this.onValueManuallyEntered=new o.Observable,this.onFrameRequired=new o.Observable,this.onCreateOrUpdateKeyPointRequired=new o.Observable,this.onFlattenTangentRequired=new o.Observable,this.onLinearTangentRequired=new o.Observable,this.onBreakTangentRequired=new o.Observable,this.onUnifyTangentRequired=new o.Observable,this.onStepTangentRequired=new o.Observable,this.onDeleteAnimation=new o.Observable,this.onGraphMoved=new o.Observable,this.onGraphScaled=new o.Observable,this.onRangeUpdated=new o.Observable,this.onMoveToFrameRequired=new o.Observable,this.onAnimationStateChanged=new o.Observable,this.onDeleteKeyActiveKeyPoints=new o.Observable,this.onSelectionRectangleMoved=new o.Observable,this.onAnimationsLoaded=new o.Observable,this.onEditAnimationRequired=new o.Observable,this.onEditAnimationUIClosed=new o.Observable,this.onClipLengthIncreased=new o.Observable,this.onClipLengthDecreased=new o.Observable,this.onInterpolationModeSet=new o.Observable,this.onSelectToActivated=new o.Observable,this.onRangeFrameBarResized=new o.Observable,this.onPlayheadMoved=new o.Observable,this.lockLastFrameValue=!1,this.lockLastFrameFrame=!1,this.onActiveKeyDataChanged=new o.Observable}prepare(){if(this.isPlaying=!1,!this.animations||!this.animations.length)return;const e=this.useTargetAnimations?this.animations[0].animation:this.animations[0],t=e.getKeys();this.referenceMinFrame=0,this.referenceMaxFrame=t[t.length-1].frame,this.useExistingPlayRange||(this.fromKey=this.referenceMinFrame,this.toKey=this.referenceMaxFrame),this.snippetId=e.snippetId,this.clipLength=this.referenceMaxFrame,e&&e.hasRunningRuntimeAnimations&&(this.isPlaying=!0)}play(e){let t;this.isPlaying=!0,this.scene.stopAnimation(this.target),e?this.rootAnimationGroup?this.rootAnimationGroup.start(!0,1,this.fromKey,this.toKey):t=this.scene.beginAnimation(this.target,this.fromKey,this.toKey,!0):this.rootAnimationGroup?this.rootAnimationGroup.start(!0,1,this.toKey,this.fromKey):t=this.scene.beginAnimation(this.target,this.toKey,this.fromKey,!0),this.forwardAnimation=e,this.rootAnimationGroup?this.rootAnimationGroup.goToFrame(this.activeFrame):t.goToFrame(this.activeFrame),this.onAnimationStateChanged.notifyObservers()}stop(){this.isPlaying=!1,this.rootAnimationGroup?this.rootAnimationGroup.stop():this.scene.stopAnimation(this.target),this.onAnimationStateChanged.notifyObservers()}moveToFrame(e){if(this.animations&&this.animations.length){this.activeFrame=e,this.isPlaying||(this.rootAnimationGroup?this.rootAnimationGroup.start(!1,1,this.fromKey,this.toKey):this.scene.beginAnimation(this.target,this.fromKey,this.toKey,!1));for(const t of this.animations){const r=this.useTargetAnimations?t.animation:t;if(!r.hasRunningRuntimeAnimations)return;for(const t of r.runtimeAnimations)t.goToFrame(e)}this.stop()}}refreshTarget(){this.animations&&this.animations.length&&(this.isPlaying||this.moveToFrame(this.activeFrame))}clearSelection(){this.activeKeyPoints=[],this.onActiveKeyPointChanged.notifyObservers()}enableChannel(e,t){this.activeChannels[e.uniqueId]=t}disableChannel(e){delete this.activeChannels[e.uniqueId]}isChannelEnabled(e,t){return void 0===this.activeChannels[e.uniqueId]||this.activeChannels[e.uniqueId]===t}getActiveChannel(e){return this.activeChannels[e.uniqueId]}resetAllActiveChannels(){this.clearSelection(),this.activeChannels={}}getAnimationSortIndex(e){if(!this.animations)return-1;for(let t=0;te&&(e=t.frame)}return e===-Number.MAX_VALUE&&(e=this.fromKey),e}getNextKey(){if(!this.animations||!this.animations.length)return null;let e=Number.MAX_VALUE;for(const t of this.activeAnimations){const r=t.getKeys();for(const t of r)t.frame>this.activeFrame&&t.framee.props.curve.animation.dataType)),t=e?.filter((e=>e===o.Animation.ANIMATIONTYPE_QUATERNION));return(t?.length||0)>0}}class na extends r.Component{constructor(e){super(e),this._animations=null,this._isPlaying=!1,this._animationControl={from:0,to:0,loop:!1,initialized:!1},this.state={currentFrame:0};const t=this.props.animatable;if(this._ranges=t.getAnimationRanges?t.getAnimationRanges():[],t.getAnimatables){const e=t.getAnimatables();this._animations=new Array,e.forEach((e=>{e.animations&&this._animations.push(...e.animations)})),t.animations&&this._animations.push(...t.animations),this._animations&&this._animations.length&&this._animations.forEach((e=>{const t=e.getKeys();if(t&&t.length>0){t[0].framethis._animationControl.to&&(this._animationControl.to=t[e].frame)}}))}this._timelineRef=r.createRef()}playOrPause(){const e=this.props.animatable;this._isPlaying=this.props.scene.getAllAnimatablesByTarget(e).length>0,this._isPlaying?(this.props.scene.stopAnimation(this.props.animatable),this._mainAnimatable=null):this._mainAnimatable=this.props.scene.beginAnimation(this.props.animatable,this._animationControl.from,this._animationControl.to,this._animationControl.loop),this.forceUpdate()}componentDidMount(){this._onBeforeRenderObserver=this.props.scene.onBeforeRenderObservable.add((()=>{this._isPlaying&&this._mainAnimatable&&this.setState({currentFrame:this._mainAnimatable.masterFrame})}))}componentWillUnmount(){this._onBeforeRenderObserver&&(this.props.scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=null)}onCurrentFrameChange(e){this._mainAnimatable&&(this._mainAnimatable.goToFrame(e),this.setState({currentFrame:e}))}onChangeFromOrTo(){this.playOrPause(),this._isPlaying&&this.playOrPause()}componentDidUpdate(e){e.animatable.uniqueId!==this.props.animatable.uniqueId&&(this._animationCurveEditorContext=null)}render(){const e=this.props.animatable,t=this.props.animatable,r=this.props.scene.getAllAnimatablesByTarget(e);this._isPlaying=r.length>0,this._isPlaying&&(this._mainAnimatable=r[0],this._mainAnimatable&&(this._animationControl.from=this._mainAnimatable.fromFrame,this._animationControl.to=this._mainAnimatable.toFrame,this._animationControl.loop=this._mainAnimatable.loopAnimation,this._animationControl.initialized=!0));const n=e.animations;return this._animationCurveEditorContext||(this._animationCurveEditorContext=new ra,this._animationCurveEditorContext.title=this.props.animatable.name||"",this._animationCurveEditorContext.animations=n,this._animationCurveEditorContext.target=this.props.animatable,this._animationCurveEditorContext.scene=this.props.scene,this._animationCurveEditorContext.fromKey=this._animationControl.from,this._animationCurveEditorContext.toKey=this._animationControl.to,this._animationCurveEditorContext.useExistingPlayRange=this._animationControl.initialized),(0,s.jsxs)(s.Fragment,{children:[this._ranges.length>0&&(0,s.jsx)(In,{title:"ANIMATION RANGES",selection:this.props.globalState,children:this._ranges.map(((t,r)=>(0,s.jsx)(_n,{label:t.name,onClick:()=>{this._mainAnimatable=null,this.props.scene.beginAnimation(e,t.from,t.to,!0)}},t.name+r)))}),n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(In,{title:"ANIMATIONS",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"Count",value:n.length.toString()}),n.map(((e,t)=>(0,s.jsx)(Pn,{label:"#"+t+" >",value:e.targetProperty},e.targetProperty+t))),(0,s.jsx)(ta,{globalState:this.props.globalState,context:this._animationCurveEditorContext})]}),n.length>0&&(0,s.jsxs)(In,{title:"ANIMATION GENERAL CONTROL",selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,isInteger:!0,label:"From",target:this._animationControl,propertyName:"from",onChange:()=>this.onChangeFromOrTo()}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,isInteger:!0,label:"To",target:this._animationControl,propertyName:"to",onChange:()=>this.onChangeFromOrTo()}),(0,s.jsx)(so,{label:"Loop",onSelect:e=>{this._animationControl.loop=e,r.forEach((t=>{t.loopAnimation=e}))},isSelected:()=>this._animationControl.loop}),this._isPlaying&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,ref:this._timelineRef,label:"Current frame",minimum:this._animationControl.from,maximum:this._animationControl.to,step:(this._animationControl.to-this._animationControl.from)/1e3,directValue:this.state.currentFrame,onInput:e=>this.onCurrentFrameChange(e)}),(0,s.jsx)(_n,{label:this._isPlaying?"Stop":"Play",onClick:()=>this.playOrPause()}),(this._ranges.length>0||this._animations&&this._animations.length>0)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(so,{label:"Enable override",onSelect:e=>{e?(t.animationPropertiesOverride=new o.AnimationPropertiesOverride,t.animationPropertiesOverride.blendingSpeed=.05):t.animationPropertiesOverride=null,this.forceUpdate()},isSelected:()=>null!=t.animationPropertiesOverride,onValueChanged:()=>this.forceUpdate()}),null!=t.animationPropertiesOverride&&(0,s.jsxs)("div",{children:[(0,s.jsx)(so,{label:"Enable blending",target:t.animationPropertiesOverride,propertyName:"enableBlending",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Blending speed",target:t.animationPropertiesOverride,propertyName:"blendingSpeed",minimum:0,maximum:.1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})]})]})]})}}class oa extends r.Component{constructor(e){super(e),this._localChange=!1,this._propertyChange=!0;const t=this.props.target[this.props.propertyName];this.state={value:t?this.props.isInteger?t.toFixed(0):t.toFixed(this.props.digits||3):"0"},this._store=t}componentWillUnmount(){this.unlock()}shouldComponentUpdate(e,t){if(this._localChange)return this._localChange=!1,!0;const r=e.target[e.propertyName],n=r?this.props.isInteger?r.toFixed(0):r.toFixed(this.props.digits||3):"0";return n!==t.value&&(t.value=n,!0)}raiseOnPropertyChanged(e,t){this.props.onChange&&this.props.onChange(e),this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.replaySourceReplacement??this.props.target,property:this.props.propertyName,value:e,initialValue:t})}convertToHexString(e){for(;e.length<10;)e+="0";return e}updateValue(e,t){"0x"!=e.substr(0,2)&&(e="0"!=e.substr(0,1)?"0x"+e:"0x"+e.substr(1));const r=e.substr(2);if(""!=r&&0==/^[0-9A-Fa-f]+$/g.test(r))return;if(e.length>10)return;const n=this.convertToHexString(e);let o;o=parseInt(n),isNaN(o)||void 0===this.props.min||othis.unlock(),onFocus:()=>this.lock(),onChange:e=>this.updateValue(e.target.value,!1),onKeyDown:e=>{13===e.keyCode&&this.updateValue(this.state.value,!0)}})})]})})}}class sa extends r.Component{constructor(e){super(e)}render(){const e=this.props.material;e.depthFunction=e.depthFunction??0;const t=[{label:"Clockwise",value:o.Material.ClockWiseSideOrientation},{label:"Counterclockwise",value:o.Material.CounterClockWiseSideOrientation}],r=[{label:"",value:Xo},{label:"Opaque",value:o.PBRMaterial.PBRMATERIAL_OPAQUE},{label:"Alpha test",value:o.PBRMaterial.PBRMATERIAL_ALPHATEST},{label:"Alpha blend",value:o.PBRMaterial.PBRMATERIAL_ALPHABLEND},{label:"Alpha blend and test",value:o.PBRMaterial.PBRMATERIAL_ALPHATESTANDBLEND}],n=[{label:"Combine",value:o.Constants.ALPHA_COMBINE},{label:"One one",value:o.Constants.ALPHA_ONEONE},{label:"Add",value:o.Constants.ALPHA_ADD},{label:"Subtract",value:o.Constants.ALPHA_SUBTRACT},{label:"Multiply",value:o.Constants.ALPHA_MULTIPLY},{label:"Maximized",value:o.Constants.ALPHA_MAXIMIZED},{label:"Pre-multiplied",value:o.Constants.ALPHA_PREMULTIPLIED}],a=[{label:"",value:0},{label:"Never",value:o.Engine.NEVER},{label:"Always",value:o.Engine.ALWAYS},{label:"Equal",value:o.Engine.EQUAL},{label:"Less",value:o.Engine.LESS},{label:"Less or equal",value:o.Engine.LEQUAL},{label:"Greater",value:o.Engine.GREATER},{label:"Greater or equal",value:o.Engine.GEQUAL},{label:"Not equal",value:o.Engine.NOTEQUAL}],i=[{label:"Never",value:o.Constants.NEVER},{label:"Always",value:o.Constants.ALWAYS},{label:"Equal",value:o.Constants.EQUAL},{label:"Less",value:o.Constants.LESS},{label:"Less or equal",value:o.Constants.LEQUAL},{label:"Greater",value:o.Constants.GREATER},{label:"Greater or equal",value:o.Constants.GEQUAL},{label:"Not equal",value:o.Constants.NOTEQUAL}],l=[{label:"Keep",value:o.Constants.KEEP},{label:"Zero",value:o.Constants.ZERO},{label:"Replace",value:o.Constants.REPLACE},{label:"Incr",value:o.Constants.INCR},{label:"Decr",value:o.Constants.DECR},{label:"Invert",value:o.Constants.INVERT},{label:"Incr wrap",value:o.Constants.INCR_WRAP},{label:"Decr wrap",value:o.Constants.DECR_WRAP}];return(0,s.jsxs)("div",{children:[(0,s.jsx)(ps,{globalState:this.props.globalState,target:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"ID",value:e.id}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Unique ID",value:e.uniqueId.toString()}),(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),(0,s.jsx)(so,{label:"Backface culling",target:e,propertyName:"backFaceCulling",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Orientation",options:t,target:e,propertyName:"sideOrientation",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({mode:e})}),(0,s.jsx)(so,{label:"Disable lighting",target:e,propertyName:"disableLighting",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Disable color write",target:e,propertyName:"disableColorWrite",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Disable depth write",target:e,propertyName:"disableDepthWrite",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Depth function",options:a,target:e,propertyName:"depthFunction",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({depthFunction:e})}),(0,s.jsx)(so,{label:"Need depth pre-pass",target:e,propertyName:"needDepthPrePass",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Wireframe",target:e,propertyName:"wireframe",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Point cloud",target:e,propertyName:"pointsCloud",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Point size",target:e,propertyName:"pointSize",minimum:0,maximum:100,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Z-offset Factor",target:e,propertyName:"zOffset",minimum:-10,maximum:10,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Z-offset Units",target:e,propertyName:"zOffsetUnits",minimum:-10,maximum:10,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(_n,{label:"Dispose",onClick:()=>{e.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(null)}})]}),(0,s.jsxs)(In,{title:"TRANSPARENCY",selection:this.props.globalState,children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Alpha",target:e,propertyName:"alpha",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),void 0!==e.transparencyMode&&(0,s.jsx)(qo,{allowNullValue:!0,label:"Transparency mode",options:r,target:e,propertyName:"transparencyMode",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({transparencyMode:e})}),(0,s.jsx)(qo,{label:"Alpha mode",options:n,target:e,propertyName:"alphaMode",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({alphaMode:e})}),e.diffuseTexture&&(0,s.jsx)(so,{label:"Diffuse texture has alpha",target:e.diffuseTexture,propertyName:"hasAlpha",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),void 0!==e.useAlphaFromDiffuseTexture&&(0,s.jsx)(so,{label:"Use alpha from diffuse texture",target:e,propertyName:"useAlphaFromDiffuseTexture",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.albedoTexture&&(0,s.jsx)(so,{label:"Albedo texture has alpha",target:e.albedoTexture,propertyName:"hasAlpha",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),void 0!==e.useAlphaFromAlbedoTexture&&(0,s.jsx)(so,{label:"Use alpha from albedo texture",target:e,propertyName:"useAlphaFromAlbedoTexture",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Separate culling pass",target:e,propertyName:"separateCullingPass",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),e.stencil&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(In,{title:"STENCIL",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e.stencil,propertyName:"enabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(oa,{isInteger:!0,lockObject:this.props.lockObject,label:"Mask",target:e.stencil,propertyName:"mask",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Function",options:i,target:e.stencil,propertyName:"func",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({stencilFunction:e})}),(0,s.jsx)(Jo,{isInteger:!0,lockObject:this.props.lockObject,label:"Function reference",target:e.stencil,propertyName:"funcRef",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(oa,{isInteger:!0,lockObject:this.props.lockObject,label:"Function mask",target:e.stencil,propertyName:"funcMask",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Op stencil fail",options:l,target:e.stencil,propertyName:"opStencilFail",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({opStencilFail:e})}),(0,s.jsx)(qo,{label:"Op depth fail",options:l,target:e.stencil,propertyName:"opDepthFail",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({opDepthFail:e})}),(0,s.jsx)(qo,{label:"Op stencil+depth pass",options:l,target:e.stencil,propertyName:"opStencilDepthPass",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({opStencilDepthPass:e})})]})}),(0,s.jsx)(na,{globalState:this.props.globalState,animatable:e,scene:e.getScene(),lockObject:this.props.lockObject})]})}}class aa extends r.Component{constructor(e){super(e)}render(){const e=this.props.material;return(0,s.jsx)(sa,{globalState:this.props.globalState,lockObject:this.props.lockObject,material:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}}class ia extends r.Component{constructor(e){super(e);const t=this.props.material,r=this.props.texture;this.state={isDebugSelected:t&&t.reservedDataStore&&t.reservedDataStore.debugTexture===r}}componentDidMount(){this.props.onDebugSelectionChangeObservable&&(this._onDebugSelectionChangeObserver=this.props.onDebugSelectionChangeObservable.add((e=>{e!==this&&this.setState({isDebugSelected:!1})})))}componentWillUnmount(){this.props.onDebugSelectionChangeObservable&&this._onDebugSelectionChangeObserver&&this.props.onDebugSelectionChangeObservable.remove(this._onDebugSelectionChangeObserver)}debugTexture(){if(this.props.customDebugAction){const e=!this.state.isDebugSelected;return this.props.customDebugAction(e),this.setState({isDebugSelected:e}),void(this.props.onDebugSelectionChangeObservable&&this.props.onDebugSelectionChangeObservable.notifyObservers(this))}const e=this.props.texture,t=this.props.material;if(!t||!e)return;const r=t.getScene();if(t.reservedDataStore&&t.reservedDataStore.debugTexture===e){const n=t.reservedDataStore.debugMaterial;e.level=t.reservedDataStore.level;for(const e of r.meshes)e.material===n&&(e.material=t);return n.dispose(),t.reservedDataStore.debugTexture=null,t.reservedDataStore.debugMaterial=null,void this.setState({isDebugSelected:!1})}let n=t,s=!1;t.reservedDataStore&&t.reservedDataStore.debugTexture&&(n=t.reservedDataStore.debugMaterial,s=!0);const a=new o.StandardMaterial("debugMaterial",r);a.disableLighting=!0,a.sideOrientation=t.sideOrientation,a.emissiveTexture=e,a.forceDepthWrite=!0,a.reservedDataStore={hidden:!0};for(const e of r.meshes)e.material===n&&(e.material=a);t.reservedDataStore||(t.reservedDataStore={}),t.reservedDataStore.debugTexture=e,t.reservedDataStore.debugMaterial=a,t.reservedDataStore.level=e.level,e.level=1,this.props.onDebugSelectionChangeObservable&&this.props.onDebugSelectionChangeObservable.notifyObservers(this),s&&n.dispose(),this.setState({isDebugSelected:!0})}onLink(){if(!this.props.onSelectionChangedObservable)return;const e=this.props.texture;this.props.onSelectionChangedObservable.notifyObservers(e)}updateTexture(e){const t=this.props.material??this.props.texturedObject;t&&o.Tools.ReadFile(e,(r=>{const n=new Blob([r],{type:"octet/stream"}),s=URL.createObjectURL(n),a=e.name.split(".").pop()?.toLowerCase(),i=this.props.cubeOnly?new o.CubeTexture(s,t.getScene(),[],!1,void 0,void 0,void 0,void 0,!1,a?"."+a:void 0):new o.Texture(s,t.getScene(),!1,!1);this.props.propertyName?t[this.props.propertyName]=i:this.props.onTextureCreated&&this.props.onTextureCreated(i),this.forceUpdate()}),void 0,!0)}removeTexture(){const e=this.props.material??this.props.texturedObject;e&&(this.props.propertyName?e[this.props.propertyName]=null:this.props.onTextureRemoved&&this.props.onTextureRemoved(),this.forceUpdate())}render(){const e=this.props.texture;return e?(0,s.jsxs)("div",{className:"textureLinkLine",children:[(!e.isCube||this.props.cubeOnly)&&(this.props.material||this.props.texturedObject)&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:this.state.isDebugSelected?"debug selected":"debug",children:[this.props.material&&(0,s.jsx)("span",{className:"actionIcon",onClick:()=>this.debugTexture(),title:"Render as main texture",children:(0,s.jsx)(Ir,{icon:rn})}),(0,s.jsx)("span",{className:"actionIcon",onClick:()=>this.removeTexture(),title:"Remove texture",children:(0,s.jsx)(Ir,{icon:an})})]})}),(0,s.jsx)(Pn,{label:this.props.label,value:e.name,onLink:()=>this.onLink()})]}):this.props.propertyName||this.props.onTextureCreated?(0,s.jsx)(zn,{label:`Add ${this.props.label} texture`,onClick:e=>this.updateTexture(e),accept:this.props.fileFormats??".jpg, .png, .tga, .dds, .env"}):null}}class la extends r.Component{constructor(e){super(e),this._onDebugSelectionChangeObservable=new o.Observable}renderTextures(){const e=this.props.material,t=this._onDebugSelectionChangeObservable;return(0,s.jsxs)(In,{title:"TEXTURES",selection:this.props.globalState,children:[(0,s.jsx)(ia,{label:"Diffuse",texture:e.diffuseTexture,propertyName:"diffuseTexture",material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(ia,{label:"Specular",texture:e.specularTexture,propertyName:"specularTexture",material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(ia,{label:"Reflection",texture:e.reflectionTexture,propertyName:"reflectionTexture",material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(ia,{label:"Refraction",texture:e.refractionTexture,propertyName:"refractionTexture",material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(ia,{label:"Emissive",texture:e.emissiveTexture,propertyName:"emissiveTexture",material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(ia,{label:"Bump",texture:e.bumpTexture,propertyName:"bumpTexture",material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(ia,{label:"Opacity",texture:e.opacityTexture,propertyName:"opacityTexture",material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(ia,{label:"Ambient",texture:e.ambientTexture,propertyName:"ambientTexture",material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(ia,{label:"Lightmap",texture:e.lightmapTexture,propertyName:"lightmapTexture",material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(ia,{label:"Detailmap",texture:e.detailMap.texture,material:e,onTextureCreated:t=>e.detailMap.texture=t,onTextureRemoved:()=>e.detailMap.texture=null,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(so,{label:"Use lightmap as shadowmap",target:e,propertyName:"useLightmapAsShadowmap",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use detailmap",target:e.detailMap,propertyName:"isEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.decalMap&&(0,s.jsx)(so,{label:"Use decalmap",target:e.decalMap,propertyName:"isEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}render(){const e=this.props.material;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(sa,{globalState:this.props.globalState,lockObject:this.props.lockObject,material:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),this.renderTextures(),(0,s.jsxs)(In,{title:"LIGHTING & COLORS",selection:this.props.globalState,children:[(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Diffuse",target:e,propertyName:"diffuseColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Specular",target:e,propertyName:"specularColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Specular power",target:e,propertyName:"specularPower",minimum:0,maximum:128,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Emissive",target:e,propertyName:"emissiveColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Ambient",target:e,propertyName:"ambientColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use specular over alpha",target:e,propertyName:"useSpecularOverAlpha",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"LEVELS",closed:!0,selection:this.props.globalState,children:[e.diffuseTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Diffuse level",target:e.diffuseTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.specularTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Specular level",target:e.specularTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.reflectionTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Reflection level",target:e.reflectionTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.refractionTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Refraction level",target:e.refractionTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.emissiveTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Emissive level",target:e.emissiveTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.bumpTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Bump level",target:e.bumpTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.opacityTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Opacity level",target:e.opacityTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.ambientTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Ambient level",target:e.ambientTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.lightmapTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Lightmap level",target:e.lightmapTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.detailMap.isEnabled&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Detailmap diffuse",target:e.detailMap,propertyName:"diffuseBlendLevel",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Detailmap bump",target:e.detailMap,propertyName:"bumpLevel",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]}),(0,s.jsxs)(In,{title:"NORMAL MAP",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Invert X axis",target:e,propertyName:"invertNormalMapX",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Invert Y axis",target:e,propertyName:"invertNormalMapY",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}o.Effect.ShadersStore.lodPixelShader="\n#extension GL_EXT_shader_texture_lod : enable\n\nprecision highp float;\n\nconst float GammaEncodePowerApprox = 1.0 / 2.2;\n\nvarying vec2 vUV;\nuniform sampler2D textureSampler;\nuniform float lod;\nuniform vec2 texSize;\nuniform bool gamma;\nvoid main(void)\n{\n gl_FragColor = textureLod(textureSampler,vUV,lod);\n if (!gamma) {\n gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(GammaEncodePowerApprox));\n }\n}";o.Effect.ShadersStore.lodCubePixelShader="\nprecision highp float;\n\nconst float GammaEncodePowerApprox = 1.0 / 2.2;\n\nvarying vec2 vUV;\nuniform samplerCube textureSampler;\nuniform float lod;\nuniform bool gamma;\nvoid main(void)\n{\n vec2 uv=vUV*2.0-1.0;\n #ifdef POSITIVEX\n gl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x),lod);\n #endif\n #ifdef NEGATIVEX\n gl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x),lod);\n #endif\n #ifdef POSITIVEY\n gl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x),lod);\n #endif\n #ifdef NEGATIVEY\n gl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x),lod);\n #endif\n #ifdef POSITIVEZ\n gl_FragColor=textureCube(textureSampler,vec3(uv,1.001),lod);\n #endif\n #ifdef NEGATIVEZ\n gl_FragColor=textureCube(textureSampler,vec3(uv,-1.001),lod);\n #endif\n if (!gamma) {\n gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(GammaEncodePowerApprox));\n }\n}";class pa{static async GetTextureDataAsync(e,t,r,n,s,a,i=0){a&&(a.blockMutationUpdates=!0);try{const a=await o.TextureTools.GetTextureDataAsync(e,t,r,n,i);if(!(s.R&&s.G&&s.B&&s.A))for(let e=0;ea.getCaps().maxTextureSize&&(o=this.props.texture.getSize().width,s=this.props.texture.getSize().height);try{const r=await pa.GetTextureDataAsync(t,o,s,this.state.face,this.state.channels,this.props.globalState);e.width=o,e.height=s;const n=e.getContext("2d");if(n){const e=n.createImageData(o,s);e.data.set(r),n.putImageData(e,0,0)}e.style.height=s+"px"}catch(t){e.width=o,e.height=s,e.style.height=s+"px"}}render(){const e=this.props.texture;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"textureLine",children:[!this.props.hideChannelSelect&&e.isCube&&(0,s.jsxs)("div",{className:"control3D",children:[(0,s.jsx)("button",{className:0===this.state.face?"px command selected":"px command",onClick:()=>this.setState({face:0}),children:"+X"}),(0,s.jsx)("button",{className:1===this.state.face?"nx command selected":"nx command",onClick:()=>this.setState({face:1}),children:"-X"}),(0,s.jsx)("button",{className:2===this.state.face?"py command selected":"py command",onClick:()=>this.setState({face:2}),children:"+Y"}),(0,s.jsx)("button",{className:3===this.state.face?"ny command selected":"ny command",onClick:()=>this.setState({face:3}),children:"-Y"}),(0,s.jsx)("button",{className:4===this.state.face?"pz command selected":"pz command",onClick:()=>this.setState({face:4}),children:"+Z"}),(0,s.jsx)("button",{className:5===this.state.face?"nz command selected":"nz command",onClick:()=>this.setState({face:5}),children:"-Z"})]}),!this.props.hideChannelSelect&&!e.isCube&&(0,s.jsxs)("div",{className:"control",children:[(0,s.jsx)("button",{className:this.state.channels===ca._TextureChannelStates.R?"red command selected":"red command",onClick:()=>this.setState({channels:ca._TextureChannelStates.R}),children:"R"}),(0,s.jsx)("button",{className:this.state.channels===ca._TextureChannelStates.G?"green command selected":"green command",onClick:()=>this.setState({channels:ca._TextureChannelStates.G}),children:"G"}),(0,s.jsx)("button",{className:this.state.channels===ca._TextureChannelStates.B?"blue command selected":"blue command",onClick:()=>this.setState({channels:ca._TextureChannelStates.B}),children:"B"}),(0,s.jsx)("button",{className:this.state.channels===ca._TextureChannelStates.A?"alpha command selected":"alpha command",onClick:()=>this.setState({channels:ca._TextureChannelStates.A}),children:"A"}),(0,s.jsx)("button",{className:this.state.channels===ca._TextureChannelStates.ALL?"all command selected":"all command",onClick:()=>this.setState({channels:ca._TextureChannelStates.ALL}),children:"ALL"})]}),(0,s.jsx)("canvas",{ref:this._canvasRef,className:"preview"})]}),e.isRenderTarget&&(0,s.jsx)(_n,{label:"Refresh",onClick:()=>{this.updatePreview()}})]})}}ca._TextureChannelStates={R:{R:!0,G:!1,B:!1,A:!1},G:{R:!1,G:!0,B:!1,A:!1},B:{R:!1,G:!1,B:!0,A:!1},A:{R:!1,G:!1,B:!1,A:!0},ALL:{R:!0,G:!0,B:!0,A:!0}};var da=p(1213);const ha={vertexSource:"\n precision highp float;\n\n attribute vec3 position;\n attribute vec2 uv;\n\n uniform mat4 worldViewProjection;\n\n varying vec2 vUV;\n\n void main(void) {\n gl_Position = worldViewProjection * vec4(position, 1.0);\n vUV = uv;\n }\n ",fragmentSource:"\n precision highp float;\n \n uniform sampler2D textureSampler;\n \n uniform bool r;\n uniform bool g;\n uniform bool b;\n uniform bool a;\n\n uniform int x1;\n uniform int y1;\n uniform int x2;\n uniform int y2;\n uniform int w;\n uniform int h;\n\n uniform int time;\n uniform bool showGrid;\n \n varying vec2 vUV;\n\n float scl = 200.0;\n float speed = 10.0 / 1000.0;\n float smoothing = 0.2;\n \n void main(void) {\n vec2 pos2 = vec2(gl_FragCoord.x, gl_FragCoord.y);\n vec2 pos = floor(pos2 * 0.05);\n float pattern = mod(pos.x + pos.y, 2.0); \n if (pattern == 0.0) {\n pattern = 0.7;\n }\n vec4 bg = vec4(pattern, pattern, pattern, 1.0);\n vec4 col = texture(textureSampler, vUV);\n if (!r && !g && !b) {\n if (a) {\n col = vec4(col.a, col.a, col.a, 1.0);\n } else {\n col = vec4(0.0,0.0,0.0,0.0);\n }\n } else {\n if (!r) {\n col.r = 0.0;\n if (!b) {\n col.r = col.g;\n }\n else if (!g) {\n col.r = col.b;\n }\n }\n if (!g) {\n col.g = 0.0;\n if (!b) {\n col.g = col.r;\n }\n else if (!r) {\n col.g = col.b;\n }\n }\n if (!b) {\n col.b = 0.0;\n if (!r) {\n col.b = col.g;\n } else if (!g) {\n col.b = col.r;\n }\n }\n if (!a) {\n col.a = 1.0;\n }\n }\n gl_FragColor = col * (col.a) + bg * (1.0 - col.a);\n float wF = float(w);\n float hF = float(h);\n int xPixel = int(floor(vUV.x * wF));\n int yPixel = int(floor((1.0 - vUV.y) * hF));\n int xDis = min(abs(xPixel - x1), abs(xPixel - x2));\n int yDis = min(abs(yPixel - y1), abs(yPixel - y2));\n if (showGrid) {\n vec2 frac = fract(vUV * vec2(wF,hF));\n float thickness = 0.1;\n if (abs(frac.x) < thickness || abs (frac.y) < thickness) {\n gl_FragColor = vec4(0.75,0.75,0.75,1.0);\n }\n }\n if (xPixel >= x1 && yPixel >= y1 && xPixel <= x2 && yPixel <= y2) {\n if (xDis <= 4 || yDis <= 4) {\n float c = sin(vUV.x * scl + vUV.y * scl + float(time) * speed);\n c = smoothstep(-smoothing,smoothing,c);\n float val = 1.0 - c;\n gl_FragColor = vec4(val, val, val, 1.0) * 0.7 + gl_FragColor * 0.3;\n }\n }\n }"},ua={attributes:["position","uv"],uniforms:["worldViewProjection","textureSampler","r","g","b","a","x1","y1","x2","y2","w","h","time","showGrid"]};class ba{constructor(e,t,r,n,s,a,i,l,p,c){this._isPanning=!1,this._channels=[],this._face=0,this._mipLevel=0,this._didEdit=!1,this._keyMap={},this._buttonsPressed=0,this.ZOOM_MOUSE_SPEED=.001,this.ZOOM_KEYBOARD_SPEED=.4,this.ZOOM_IN_KEY="+",this.ZOOM_OUT_KEY="-",this.PAN_SPEED=.003,this.PAN_KEY="Space",this.MIN_SCALE=.01,this.GRID_SCALE=.047,this.MAX_SCALE=10,this.SELECT_ALL_KEY="KeyA",this.SAVE_KEY="KeyS",this.RESET_KEY="KeyR",this.DESELECT_KEY="Escape",this.PUSH_FREQUENCY=32,this._editing3D=!1,this._canPush=!0,this._shouldPush=!1,this._window=t,this._uiCanvas=r,this._2DCanvas=n,this._3DCanvas=s,this._paintCanvas=document.createElement("canvas"),this._setPixelData=a,this._metadata=i,this._onUpdate=l,this._setMetadata=p,this._setMipLevel=c,this._originalTexture=e,this._originalTextureProperties={_texture:this._originalTexture._texture,url:this._originalTexture.url,_forceSerialize:this._originalTexture._forceSerialize},this._engine=new o.Engine(this._uiCanvas,!0),this._scene=new o.Scene(this._engine,{virtual:!0}),this._scene.clearColor=new o.Color4(.11,.11,.11,1),this._camera=new o.FreeCamera("camera",new o.Vector3(0,0,-1),this._scene),this._camera.mode=o.Camera.ORTHOGRAPHIC_CAMERA,this._camera.minZ=.5,this._camera.maxZ=1.5,this._cameraPos=new o.Vector2,this.setSize(e.getSize()),this._channelsTexture=new o.HtmlElementTexture("ct",this._2DCanvas,{engine:this._engine,scene:null,samplingMode:o.Texture.NEAREST_SAMPLINGMODE,generateMipMaps:!0}),this._3DEngine=new o.Engine(this._3DCanvas),this._3DScene=new o.Scene(this._3DEngine,{virtual:!0}),this._3DScene.clearColor=new o.Color4(0,0,0,0),this._3DCanvasTexture=new o.HtmlElementTexture("canvas",this._2DCanvas,{engine:this._3DEngine,scene:this._3DScene}),this._3DCanvasTexture.hasAlpha=!0;const d=new o.FreeCamera("camera",new o.Vector3(0,0,-1),this._3DScene);d.mode=o.Camera.ORTHOGRAPHIC_CAMERA,[d.orthoBottom,d.orthoLeft,d.orthoTop,d.orthoRight]=[-.5,-.5,.5,.5],this._3DPlane=(0,o.CreatePlane)("texture",{width:1,height:1},this._3DScene),this._3DPlane.hasVertexAlpha=!0;const h=new o.StandardMaterial("material",this._3DScene);h.diffuseTexture=this._3DCanvasTexture,h.useAlphaFromDiffuseTexture=!0,h.disableLighting=!0,h.emissiveColor=o.Color3.White(),this._3DPlane.material=h,this._planeMaterial=new o.ShaderMaterial("canvasShader",this._scene,ha,ua),this.grabOriginalTexture(),this._planeMaterial.setTexture("textureSampler",this._channelsTexture),this._planeMaterial.setFloat("r",1),this._planeMaterial.setFloat("g",1),this._planeMaterial.setFloat("b",1),this._planeMaterial.setFloat("a",1),this._planeMaterial.setInt("x1",-1),this._planeMaterial.setInt("y1",-1),this._planeMaterial.setInt("x2",-1),this._planeMaterial.setInt("y2",-1),this._planeMaterial.setInt("w",this._size.width),this._planeMaterial.setInt("h",this._size.height),this._planeMaterial.setInt("time",0),this._planeMaterial.setFloat("showGrid",0),this._plane.material=this._planeMaterial,this._window.addEventListener("keydown",(e=>{this._keyMap[e.code]=!0,e.code===this.SELECT_ALL_KEY&&e.ctrlKey&&(this._setMetadata({select:{x1:0,y1:0,x2:this._size.width,y2:this._size.height}}),e.preventDefault()),e.code===this.SAVE_KEY&&e.ctrlKey&&(this.saveTexture(),e.preventDefault()),e.code===this.RESET_KEY&&e.ctrlKey&&(this.reset(),e.preventDefault()),e.code===this.DESELECT_KEY&&this._setMetadata({select:{x1:-1,y1:-1,x2:-1,y2:-1}})})),this._window.addEventListener("keyup",(e=>{this._keyMap[e.code]=!1})),this._engine.runRenderLoop((()=>{this._engine.resize(),this._scene.render(),this._planeMaterial.setInt("time",(new Date).getTime())})),this._scale=1.5/Math.max(this._size.width,this._size.height),this._isPanning=!1,this._scene.onBeforeRenderObservable.add((()=>{this._scale=Math.min(Math.max(this._scale,this.MIN_SCALE/Math.log2(Math.min(this._size.width,this._size.height))),this.MAX_SCALE),this._scale>this.GRID_SCALE?this._planeMaterial.setFloat("showGrid",1):this._planeMaterial.setFloat("showGrid",0);const e=this._uiCanvas?.width/this._uiCanvas?.height,{x:t,y:r}=this._cameraPos;this._camera.orthoBottom=r-1/this._scale,this._camera.orthoTop=r+1/this._scale,this._camera.orthoLeft=t-e/this._scale,this._camera.orthoRight=t+e/this._scale})),this._scene.onPointerObservable.add((e=>{const t=1&e.event.buttons,r=4&e.event.buttons;switch(this._isPanning?t&&this._keyMap[this.PAN_KEY]||r||(this._isPanning=!1):((t&&!(1&this._buttonsPressed)&&this._keyMap[this.PAN_KEY]||r)&&(this._isPanning=!0,this._mouseX=e.event.x,this._mouseY=e.event.y),r&&(this._isPanning=!0)),e.type){case o.PointerEventTypes.POINTERWHEEL:{const t=e.event;this._scale-=t.deltaY*this.ZOOM_MOUSE_SPEED*this._scale;break}case o.PointerEventTypes.POINTERMOVE:if(this._isPanning&&(this._cameraPos.x-=(e.event.x-this._mouseX)*this.PAN_SPEED/this._scale,this._cameraPos.y+=(e.event.y-this._mouseY)*this.PAN_SPEED/this._scale,this._mouseX=e.event.x,this._mouseY=e.event.y),e.pickInfo?.hit){const t=this.getMouseCoordinates(e),r=4*(t.x+t.y*this._size.width);this._setPixelData({x:t.x,y:t.y,r:this._imageData[r],g:this._imageData[r+1],b:this._imageData[r+2],a:this._imageData[r+3]})}else this._setPixelData({})}this._buttonsPressed=e.event.buttons})),this._scene.onKeyboardObservable.add((e=>{switch(e.type){case o.KeyboardEventTypes.KEYDOWN:switch(this._keyMap[e.event.key]=!0,e.event.key){case this.ZOOM_IN_KEY:this._scale+=this.ZOOM_KEYBOARD_SPEED*this._scale;break;case this.ZOOM_OUT_KEY:this._scale-=this.ZOOM_KEYBOARD_SPEED*this._scale}break;case o.KeyboardEventTypes.KEYUP:this._keyMap[e.event.key]=!1}}))}async updateTexture(){0!==this._mipLevel&&await this._setMipLevel(0),this._didEdit=!0;const e=this._editing3D?this._3DCanvas:this._2DCanvas;this._editing3D&&(this._3DCanvasTexture.update(),this._3DScene.render()),this._originalTexture.isCube||(this._target?this._target.element=e:this._target=new o.HtmlElementTexture("editor",e,{engine:this._originalTexture.getScene()?.getEngine(),scene:null,samplingMode:this._originalTexture.samplingMode,generateMipMaps:this._originalTextureProperties._texture?.generateMipMaps}),this.pushTexture()),this._originalTexture._texture=this._target._texture,this._originalTexture.url=null,this._originalTexture._forceSerialize=!0,this._channelsTexture.element=e,this.updateDisplay(),this._onUpdate()}async pushTexture(){if(this._canPush){const e=this._target.constructor.name!==o.HtmlElementTexture.name&&this._originalTexture.invertY;if(this._target.update(e),this._target._texture?.updateSize(this._size.width,this._size.height),this._editing3D){const e=await this._3DEngine.readPixels(0,0,this._size.width,this._size.height);this._imageData=new Uint8Array(e.buffer,0,e.byteLength)}else this._imageData=this._2DCanvas.getContext("2d").getImageData(0,0,this._size.width,this._size.height).data;this._canPush=!1,this._shouldPush=!1,setTimeout((()=>{this._canPush=!0,this._shouldPush&&this.pushTexture()}),this.PUSH_FREQUENCY)}else this._shouldPush=!0}async startPainting(){0!=this._mipLevel&&await this._setMipLevel(0);let e=0,t=0,r=this._size.width,n=this._size.height;-1!=this._metadata.select.x1&&(e=this._metadata.select.x1,t=this._metadata.select.y1,r=this._metadata.select.x2-this._metadata.select.x1,n=this._metadata.select.y2-this._metadata.select.y1),this._paintCanvas.width=r,this._paintCanvas.height=n;const o=this._paintCanvas.getContext("2d");return o.imageSmoothingEnabled=!1,o.drawImage(this._2DCanvas,e,t,r,n,0,0,r,n),o}updatePainting(){let e=0,t=0,r=this._size.width,n=this._size.height;-1!=this._metadata.select.x1&&(e=this._metadata.select.x1,t=this._metadata.select.y1,r=this._metadata.select.x2-this._metadata.select.x1,n=this._metadata.select.y2-this._metadata.select.y1);let o,s=!0;this._channels.forEach((e=>{e.editable||(s=!1)})),s||(o=this._2DCanvas.getContext("2d").getImageData(e,t,r,n).data);const a=this._paintCanvas.getContext("2d"),i=this.canvas2D.getContext("2d");if(i.globalAlpha=1,i.globalCompositeOperation="destination-out",i.fillStyle="white",i.fillRect(e,t,r,n),i.imageSmoothingEnabled=!1,s)i.globalCompositeOperation="source-over",i.globalAlpha=1,i.drawImage(a.canvas,e,t);else{const s=a.getImageData(0,0,r,n),l=s.data;this._channels.forEach(((e,t)=>{if(!e.editable)for(let e=t;e{e.visible!==this._channels[r].visible&&(t=!0,this._planeMaterial.setFloat(e.id.toLowerCase(),e.visible?1:0))})),this._channels=e,t&&this.updateDisplay()}paintPixelsOnCanvas(e,t){const r=t.getContext("2d"),n=r.createImageData(t.width,t.height);n.data.set(e),r.putImageData(n,0,0)}async grabOriginalTexture(){this.setSize(this._originalTexture.getSize());const e=await pa.GetTextureDataAsync(this._originalTexture,this._size.width,this._size.height,this._face,{R:!0,G:!0,B:!0,A:!0},void 0,this._mipLevel);return this._imageData=e,this.paintPixelsOnCanvas(e,this._2DCanvas),this._3DCanvasTexture.update(),this.updateDisplay(),e}getMouseCoordinates(e){if(e.pickInfo?.hit){const t=Math.floor(e.pickInfo.getTextureCoordinates().x*this._size.width),r=Math.floor((1-e.pickInfo.getTextureCoordinates().y)*this._size.height);return new o.Vector2(t,r)}return new o.Vector2}get scene(){return this._scene}get canvas2D(){return this._2DCanvas}get size(){return this._size}set tool(e){this._tool&&this._tool.instance.cleanup(),this._tool=e,this._tool&&(this._tool.instance.setup(),this._editing3D&&!this._tool.is3D?(this._editing3D=!1,this._2DCanvas.getContext("2d")?.drawImage(this._3DCanvas,0,0)):!this._editing3D&&this._tool.is3D&&(this._editing3D=!0,this.updateTexture()))}get tool(){return this._tool}set face(e){this._face!==e&&(this._face=e,this.grabOriginalTexture(),this.updateDisplay())}set mipLevel(e){this._mipLevel!==e&&(this._mipLevel=e,this.grabOriginalTexture())}get scene3D(){return this._3DScene}set metadata(e){this._metadata=e;const{x1:t,y1:r,x2:n,y2:o}=e.select;this._planeMaterial.setInt("x1",t),this._planeMaterial.setInt("y1",r),this._planeMaterial.setInt("x2",n),this._planeMaterial.setInt("y2",o)}makePlane(){this._plane&&this._plane.dispose(),this._plane=(0,o.CreatePlane)("plane",{width:this._size.width,height:this._size.height},this._scene),this._plane.enableEdgesRendering(),this._plane.edgesWidth=4,this._plane.edgesColor=new o.Color4(1,1,1,1),this._plane.enablePointerMoveEvents=!0,this._plane.material=this._planeMaterial}reset(){this._tool&&this._tool.instance.onReset&&this._tool.instance.onReset(),this._originalTexture._texture=this._originalTextureProperties._texture,this._originalTexture.url=this._originalTextureProperties.url,this._originalTexture._forceSerialize=this._originalTextureProperties._forceSerialize,this.grabOriginalTexture(),this.makePlane(),this._didEdit=!1,this._onUpdate()}async resize(e){const t=await pa.GetTextureDataAsync(this._originalTexture,e.width,e.height,this._face,{R:!0,G:!0,B:!0,A:!0});this.setSize(e),this.paintPixelsOnCanvas(t,this._2DCanvas),this.updateTexture(),this._didEdit=!0}setSize(e){const t=this._size;this._size=e,this._2DCanvas.width=this._size.width,this._2DCanvas.height=this._size.height,this._3DCanvas.width=this._size.width,this._3DCanvas.height=this._size.height,this._planeMaterial&&(this._planeMaterial.setInt("w",this._size.width),this._planeMaterial.setInt("h",this._size.height)),t&&t.width==e.width&&t.height==e.height||(this._cameraPos.x=0,this._cameraPos.y=0,this._scale=1.5/Math.max(this._size.width,this._size.height)),this.makePlane()}upload(e){o.Tools.ReadFile(e,(t=>{const r=new Blob([t],{type:"octet/stream"});let n;e.name.toLowerCase().indexOf(".dds")>0?n=".dds":e.name.toLowerCase().indexOf(".env")>0&&(n=".env");const s=new FileReader;s.readAsDataURL(r),s.onloadend=()=>{const e=s.result;if(".dds"===n||".env"===n)this._originalTexture.updateURL(e,n,(()=>this.grabOriginalTexture()));else{const t=new o.Texture(e,this._scene,this._originalTexture.noMipmap,!1,o.Texture.NEAREST_SAMPLINGMODE,(()=>{pa.GetTextureDataAsync(t,t.getSize().width,t.getSize().height,0,{R:!0,G:!0,B:!0,A:!0}).then((async e=>{this._tool&&this._tool.instance.onReset&&this._tool.instance.onReset(),t.dispose(),this.setSize(t.getSize()),this.paintPixelsOnCanvas(e,this._2DCanvas),await this.updateTexture(),this._setMipLevel(0)}))}))}}}),void 0,!0)}saveTexture(){const e=this._editing3D?this._3DCanvas:this._2DCanvas;o.Tools.ToBlob(e,(e=>{o.Tools.Download(e,this._originalTexture.name)}))}toolInteractionEnabled(){return!(this._keyMap[this.PAN_KEY]||this._isPanning)}dispose(){this._didEdit&&this._originalTextureProperties._texture?.dispose(),this._tool&&this._tool.instance.cleanup(),this._paintCanvas.parentNode?.removeChild(this._paintCanvas),this._3DPlane.dispose(),this._3DCanvasTexture.dispose(),this._3DScene.dispose(),this._3DEngine.dispose(),this._plane.dispose(),this._channelsTexture.dispose(),this._planeMaterial.dispose(),this._camera.dispose(),this._scene.dispose(),this._engine.dispose()}}class ga{constructor(){this.lock=!1}}class ma extends r.Component{constructor(e){super(e),this._lockObject=new ga,this.state={toolURL:"",addOpen:!1}}computeRGBAColor(){const e=Math.floor(255*this.props.metadata.alpha).toString(16).padStart(2,"0");return o.Color4.FromHexString(`${this.props.metadata.color}${e}`)}shouldComponentUpdate(e){return e.tools!=this.props.tools||e.activeToolIndex!==this.props.activeToolIndex||e.metadata!=this.props.metadata||e.pickerOpen!=this.props.pickerOpen}render(){return(0,s.jsxs)("div",{id:"toolbar",children:[(0,s.jsx)("div",{id:"tools",children:this.props.tools.map(((e,t)=>(0,s.jsx)("img",{src:`data:image/svg+xml;base64,${e.icon}`,className:t===this.props.activeToolIndex?"icon button active":"icon button",alt:e.name,title:e.name,onClick:e=>{0===e.button&&this.props.changeTool(t)}},t)))}),(0,s.jsx)("div",{id:"color",onClick:()=>{this.props.pickerOpen||this.props.setPickerOpen(!0)},title:"Color",className:"icon button"+(this.props.pickerOpen?" active":""),children:(0,s.jsx)("div",{id:"active-color-bg",children:(0,s.jsx)("div",{id:"active-color",style:{backgroundColor:this.props.metadata.color,opacity:this.props.metadata.alpha}})})}),this.props.pickerOpen&&(0,s.jsx)("div",{id:"color-picker",ref:this.props.pickerRef,children:(0,s.jsx)(eo,{lockObject:this._lockObject,color:this.computeRGBAColor(),onColorChanged:e=>{const t={color:e.toHexString(!0),alpha:e.a};t.color===this.props.metadata.color&&t.alpha===this.props.metadata.alpha||this.props.setMetadata(t)}})})]})}}class Aa extends r.PureComponent{constructor(e){super(e),this._faces=["data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTYuODksMTZ2M2gyLjgydjEuMjdIMTYuODl2M2gtMS4zdi0zSDEyLjc0VjE5aDIuODVWMTZaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTI1LjM0LDI0LjYybC0xLjc1LTQuMjFoMEwyMS44LDI0LjYySDIwbDIuNjEtNS41Ny0yLjUxLTUuMjlIMjJsMS42MywzLjhoMGwxLjY1LTMuOGgxLjc3bC0yLjQ5LDUuMTEsMi42NCw1Ljc1WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==","data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuNzUsMTguNzJ2MS40NUgxNC4zM1YxOC43MloiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjMuNzUsMjQuNjIsMjIsMjAuNDFoMGwtMS43Nyw0LjIxSDE4LjQ0bDIuNjEtNS41Ny0yLjUyLTUuMjloMS45M2wxLjYzLDMuOGgwbDEuNjUtMy44aDEuNzhMMjMsMTguODdsMi42NCw1Ljc1WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==","data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTYuODQsMTZ2M2gyLjgydjEuMjdIMTYuODR2M2gtMS4zdi0zSDEyLjY5VjE5aDIuODVWMTZaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTIyLjc5LDI0LjYyVjIwLjY4YS42My42MywwLDAsMC0uMDYtLjMyTDIwLDEzLjc2aDEuODdjLjY2LDEuNzYsMS41MSw0LDEuODMsNS4xMy40LTEuMjQsMS4yNS0zLjQ2LDEuODQtNS4xM2gxLjc4bC0yLjc3LDYuNjFhLjczLjczLDAsMCwwLS4wNS4zNHYzLjkxWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==","data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuNywxOC43MnYxLjQ1SDE0LjI4VjE4LjcyWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0yMS4yMSwyNC42MlYyMC42OGEuNjMuNjMsMCwwLDAtLjA3LS4zMmwtMi43My02LjZoMS44N2MuNjYsMS43NiwxLjUsNCwxLjgyLDUuMTMuNC0xLjI0LDEuMjUtMy40NiwxLjg0LTUuMTNoMS43OEwyMywyMC4zN2EuOS45LDAsMCwwLS4wNS4zNHYzLjkxWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==","data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTcuMSwxNnYzaDIuODJ2MS4yN0gxNy4xdjNIMTUuODF2LTNIMTNWMTloMi44NVYxNloiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjAuNjcsMjMuNDMsMjUsMTUuMjVIMjFWMTMuNzZoNS44NnYxLjM2bC00LjIzLDhIMjdsLS4yMiwxLjQ4SDIwLjY3WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==","data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTgsMTguNzJ2MS40NUgxNC41NFYxOC43MloiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMTkuMDksMjMuNDNsNC4zNS04LjE4aC00VjEzLjc2aDUuODZ2MS4zNmwtNC4yMiw4aDQuNGwtLjIzLDEuNDhIMTkuMDlaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+"],this.state={width:e.size.width,height:e.size.height}}_pixelData(e){return(0,s.jsxs)("span",{className:"pixel-data",children:[e.name,": ",(0,s.jsx)("span",{className:"value",children:void 0!==e.data?e.data:"-"})]})}_getNewDimension(e,t){return!isNaN(t)&&parseInt(t)>0&&Number.isInteger(parseInt(t))?parseInt(t):e}componentWillUpdate(e){e.size.width==this.props.size.width&&e.size.height==this.props.size.height||this.setState({width:e.size.width,height:e.size.height})}render(){const{mipLevel:e,setMipLevel:t,pixelData:r,resizeTexture:n,texture:o,face:a,setFace:i,saveTexture:l,resetTexture:p,uploadTexture:c}=this.props,d=Math.floor(Math.log2(Math.max(o.getSize().width,o.getSize().height))),h=o.getScene().getEngine(),u=!o.noMipmap&&h.getCaps().textureLOD;return(0,s.jsxs)("div",{id:"properties",children:[(0,s.jsx)("div",{className:"tab",id:"logo-tab",children:(0,s.jsx)("img",{className:"icon",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOm5vbmU7fS5jbHMtMntmaWxsOiNlMDY4NGI7fS5jbHMtM3tmaWxsOiNiYjQ2NGI7fS5jbHMtNHtmaWxsOiNlMGRlZDg7fS5jbHMtNXtmaWxsOiNkNWQyY2E7fS5jbHMtNntmaWxsOiNmZmY7fTwvc3R5bGU+PC9kZWZzPjxnIGlkPSJVSSI+PHJlY3QgY2xhc3M9ImNscy0xIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iMzIuOTEgMTMuNzggMjkuNTQgMTEuODQgMjYuMjkgMTMuNzEgMjkuNjYgMTUuNjUgMzIuOTEgMTMuNzgiLz48cG9seWdvbiBjbGFzcz0iY2xzLTIiIHBvaW50cz0iMTQuNjEgMTUuNjUgMjUuMzggOS40NCAyMi4xNCA3LjU3IDExLjM3IDEzLjc4IDE0LjYxIDE1LjY1Ii8+PHBvbHlnb24gY2xhc3M9ImNscy0yIiBwb2ludHM9IjE4Ljc3IDIxLjk1IDIyLjE0IDIzLjg5IDI1LjUxIDIxLjk1IDIyLjE0IDIwIDE4Ljc3IDIxLjk1Ii8+PHBvbHlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjI5LjY2IDE1LjY1IDI5LjY2IDI0LjM0IDIyLjE0IDI4LjY5IDE0LjYxIDI0LjM0IDE0LjYxIDE1LjY1IDExLjM3IDEzLjc4IDExLjM3IDI2LjIyIDIyLjE0IDMyLjQ0IDMyLjkxIDI2LjIyIDMyLjkxIDEzLjc4IDI5LjY2IDE1LjY1Ii8+PHBvbHlnb24gY2xhc3M9ImNscy0zIiBwb2ludHM9IjIyLjE0IDE2LjExIDE4Ljc3IDE4LjA1IDE4Ljc3IDIxLjk1IDIyLjE0IDIwIDI1LjUxIDIxLjk1IDI1LjUxIDE4LjA1IDIyLjE0IDE2LjExIi8+PHBvbHlnb24gY2xhc3M9ImNscy00IiBwb2ludHM9IjI5LjY2IDE1LjY1IDI1LjUxIDE4LjA1IDI1LjUxIDIxLjk1IDIyLjE0IDIzLjg5IDIyLjE0IDI4LjY5IDI5LjY2IDI0LjM0IDI5LjY2IDE1LjY1Ii8+PHBvbHlnb24gY2xhc3M9ImNscy01IiBwb2ludHM9IjE0LjYxIDE1LjY1IDE4Ljc3IDE4LjA1IDE4Ljc3IDIxLjk1IDIyLjE0IDIzLjg5IDIyLjE0IDI4LjY5IDE0LjYxIDI0LjM0IDE0LjYxIDE1LjY1Ii8+PHBvbHlnb24gY2xhc3M9ImNscy02IiBwb2ludHM9IjI1LjM4IDkuNDQgMjkuNTQgMTEuODQgMjYuMjkgMTMuNzEgMjkuNjYgMTUuNjUgMjUuNTEgMTguMDUgMjIuMTQgMTYuMTEgMTguNzcgMTguMDUgMTQuNjEgMTUuNjUgMjUuMzggOS40NCIvPjwvZz48L3N2Zz4="})}),(0,s.jsxs)("div",{id:"left",children:[(0,s.jsx)("div",{className:"tab",id:"dimensions-tab",children:(0,s.jsxs)("form",{onSubmit:e=>{this.props.resizeTexture(this.state.width,this.state.height),e.preventDefault()},children:[(0,s.jsxs)("label",{className:"dimensions",children:["W:"," ",(0,s.jsx)("input",{type:"text",value:this.state.width,readOnly:o.isCube,onChange:e=>this.setState({width:this._getNewDimension(this.state.width,e.target.value)})})]}),(0,s.jsxs)("label",{className:"dimensions",children:["H:"," ",(0,s.jsx)("input",{type:"text",value:this.state.height,readOnly:o.isCube,onChange:e=>this.setState({height:this._getNewDimension(this.state.height,e.target.value)})})]}),!o.isCube&&(0,s.jsx)("img",{id:"resize",className:"icon button",title:"Resize",alt:"Resize",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTIuNSwyMWEuNS41LDAsMCwxLC41LjVWMjVhMiwyLDAsMCwwLDIsMmgzLjVhLjUuNSwwLDAsMSwwLDFIMTVhMywzLDAsMCwxLTMtM1YyMS41QS41LjUsMCwwLDEsMTIuNSwyMVptMTUsMGEuNS41LDAsMCwxLC40OS40MVYyNWEzLDMsMCwwLDEtMi44MiwzSDIxLjVhLjUuNSwwLDAsMS0uMDktMUgyNWEyLDIsMCwwLDAsMi0xLjg1VjIxLjVBLjUuNSwwLDAsMSwyNy41LDIxWm0tOS05YS41LjUsMCwwLDEsLjA5LDFIMTVhMiwyLDAsMCwwLTIsMS44NVYxOC41YS41LjUsMCwwLDEtMSwuMDlWMTVhMywzLDAsMCwxLDIuODItM0gxOC41Wk0yNSwxMmEzLDMsMCwwLDEsMywyLjgyVjE4LjVhLjUuNSwwLDAsMS0xLC4wOVYxNWEyLDIsMCwwLDAtMS44NS0ySDIxLjVhLjUuNSwwLDAsMS0uMDktMUgyNVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>n(this.state.width,this.state.height)})]})}),(0,s.jsxs)("div",{className:"tab",id:"pixel-coords-tab",children:[(0,s.jsx)(this._pixelData,{name:"X",data:r.x}),(0,s.jsx)(this._pixelData,{name:"Y",data:r.y})]}),(0,s.jsxs)("div",{className:"tab",id:"pixel-color-tab",children:[(0,s.jsx)(this._pixelData,{name:"R",data:r.r}),(0,s.jsx)(this._pixelData,{name:"G",data:r.g}),(0,s.jsx)(this._pixelData,{name:"B",data:r.b}),(0,s.jsx)(this._pixelData,{name:"A",data:r.a})]}),o.isCube&&(0,s.jsx)("div",{className:"tab",id:"face-tab",children:this._faces.map(((e,t)=>(0,s.jsx)("img",{className:a==t?"icon face button active":"icon face button",src:e,onClick:()=>i(t)},t)))}),u&&(0,s.jsxs)("div",{className:"tab",id:"mip-tab",children:[(0,s.jsx)("img",{title:"Mip Preview Up",className:"icon button",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTUuNDcsMjAuMjhsLjA4LjA3YS43NS43NSwwLDAsMCwxLS4wN2wyLjcyLTIuNzJ2Ni43OUEuNzUuNzUsMCwwLDAsMjAsMjVoLjFhLjc1Ljc1LDAsMCwwLC42NS0uNzRWMTcuNTZsMi43MiwyLjcyLjA4LjA3YS43NS43NSwwLDAsMCwxLTEuMTNsLTQtNC0uMDgtLjA3YS43NS43NSwwLDAsMC0xLC4wN2wtNCw0LS4wNy4wOEEuNzUuNzUsMCwwLDAsMTUuNDcsMjAuMjhaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTMwLDIwQTEwLDEwLDAsMSwwLDIwLDMwLDEwLDEwLDAsMCwwLDMwLDIwWk0xMS41LDIwQTguNSw4LjUsMCwxLDEsMjAsMjguNSw4LjUxLDguNTEsMCwwLDEsMTEuNSwyMFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>e>0&&t(e-1)}),(0,s.jsx)("img",{title:"Mip Preview Down",className:"icon button",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjQuNTMsMTkuNzJsLS4wOC0uMDdhLjc1Ljc1LDAsMCwwLTEsLjA3bC0yLjcyLDIuNzJWMTUuNjVBLjc1Ljc1LDAsMCwwLDIwLDE1aC0uMWEuNzUuNzUsMCwwLDAtLjY1Ljc0djYuNjlsLTIuNzItMi43Mi0uMDgtLjA3YS43NS43NSwwLDAsMC0xLDEuMTNsNCw0LC4wOC4wN2EuNzUuNzUsMCwwLDAsMS0uMDdsNC00LC4wNy0uMDhBLjc1Ljc1LDAsMCwwLDI0LjUzLDE5LjcyWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0xMCwyMEExMCwxMCwwLDEsMCwyMCwxMCwxMCwxMCwwLDAsMCwxMCwyMFptMTguNSwwQTguNSw4LjUsMCwxLDEsMjAsMTEuNSw4LjUxLDguNTEsMCwwLDEsMjguNSwyMFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",onClick:()=>ep()}),(0,s.jsxs)("label",{children:[(0,s.jsx)("input",{accept:".jpg, .png, .tga, .dds, .env",type:"file",onChange:e=>{const t=e.target.files;t&&t.length&&c(t[0]),e.target.value=""}}),(0,s.jsx)("img",{title:"Upload",className:"icon button",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTMuNSwyOC41aDEzYS43Ni43NiwwLDAsMSwuNzUuNzUuNzUuNzUsMCwwLDEtLjY1Ljc0SDEzLjVhLjc1Ljc1LDAsMCwxLS4xLTEuNVptMS0xMy4yOCw1LTVhLjczLjczLDAsMCwxLDEtLjA3bC4wOS4wNyw1LDVhLjc1Ljc1LDAsMCwxLDAsMS4wNi43NS43NSwwLDAsMS0xLC4wN2wtLjA5LS4wNy0zLjcyLTMuNzJWMjYuMjVhLjc1Ljc1LDAsMCwxLS42NS43NEgyMGEuNzUuNzUsMCwwLDEtLjc0LS42NVYxMi41NmwtMy43MiwzLjcyYS43Ni43NiwwLDAsMS0xLC4wN2wtLjA4LS4wN2EuNzUuNzUsMCwwLDEtLjA3LTFsLjA3LS4wOCw1LTVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+"})]}),(0,s.jsx)("img",{title:"Save",className:"icon button",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjkuMzYsMTguMzlhMi4xOCwyLjE4LDAsMCwxLDAsMy4wOGwtNy45MSw3LjkxYTEuMjIsMS4yMiwwLDAsMS0uODkuMzdoLTEuN2EuODUuODUsMCwwLDEtLjg2LS44NnYtMS43YTEuMjIsMS4yMiwwLDAsMSwuMzctLjg5bDcuOTEtNy45MUEyLjE4LDIuMTgsMCwwLDEsMjkuMzYsMTguMzlaTTMwLDIzLjExVjI3LjVhMi4yNSwyLjI1LDAsMCwxLTIuMjUsMi4yNUgyM2wxLjUtMS41aDMuMjVhLjc2Ljc2LDAsMCwwLC43NS0uNzV2LTNaTTIzLjYzLDEwLjI1YTEuMjMsMS4yMywwLDAsMSwuNzYuMjZMMjkuNjQsMTVhMS4yMSwxLjIxLDAsMCwxLC4zNi45djEuMjNhMi40MywyLjQzLDAsMCwwLS43NS0uNDMsMiwyLDAsMCwwLS43NC0uMVYxNkwyNCwxMi4xNFYxNWExLjc1LDEuNzUsMCwwLDEtMS43NSwxLjc1aC02QTEuNzUsMS43NSwwLDAsMSwxNC41LDE1VjExLjc1SDEyLjI1YS43NS43NSwwLDAsMC0uNzUuNzV2MTVhLjc1Ljc1LDAsMCwwLC43NS43NUgxM1YyMi41MWExLjc1LDEuNzUsMCwwLDEsMS42MS0xLjc0SDIybC0xLjU1LDEuNUgxNC43NWEuMjUuMjUsMCwwLDAtLjI0LjJ2NS43OWgydjEuNUgxMi4yNUEyLjI1LDIuMjUsMCwwLDEsMTAsMjcuNXYtMTVhMi4yNSwyLjI1LDAsMCwxLDIuMjUtMi4yNVptMy43Miw5LjIxLTcuODQsNy44M3YuOTVoLjk1bDcuODMtNy44NGEuNjYuNjYsMCwwLDAtLjk0LS45NFpNMjIuNSwxMS43NUgxNlYxNWEuMjUuMjUsMCwwLDAsLjI1LjI1aDZBLjI1LjI1LDAsMCwwLDIyLjUsMTVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+",onClick:()=>l()})]})]})}}class Ca extends r.PureComponent{render(){return(0,s.jsx)("div",{id:"channels-bar",children:this.props.channels.map(((e,t)=>{const r=e.visible?"Hide":"Show",n=e.editable?"Lock":"Unlock";return(0,s.jsxs)("div",{className:e.editable?"channel":"channel uneditable",children:[(0,s.jsx)("img",{className:e.visible?"icon channel-visibility visible":"icon channel-visibility",onClick:()=>{const e=this.props.channels;e[t].visible=!e[t].visible,this.props.setChannels(e)},src:e.visible?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAsMTguMjdhMy4wOSwzLjA5LDAsMSwxLTMuMDgsMy4wOEEzLjA5LDMuMDksMCwwLDEsMjAsMTguMjdabTAsMS4xNWExLjkzLDEuOTMsMCwxLDAsMS45MywxLjkzQTEuOTQsMS45NCwwLDAsMCwyMCwxOS40MlptMC0zLjg2YTcuNzEsNy43MSwwLDAsMSw3LjQ4LDUuODQuNTguNTgsMCwxLDEtMS4xMi4yOCw2LjU2LDYuNTYsMCwwLDAtMTIuNzIsMCwuNTguNTgsMCwwLDEtMS4xMi0uMjhBNy43Miw3LjcyLDAsMCwxLDIwLDE1LjU2WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTIuNDIsMTNhLjU3LjU3LDAsMCwwLS4wNi43NWwuMDYuMDcsMy4xMywzLjEzYTcuNjksNy42OSwwLDAsMC0zLjA3LDQuNDUuNTguNTgsMCwwLDAsMS4xMy4yOSw2LjYsNi42LDAsMCwxLDIuNzctMy45MWwxLjQxLDEuNDFhMy4xLDMuMSwwLDAsMCw0LjM4LDQuMzhsNC41OSw0LjU5YS41Ny41NywwLDAsMCwuODIsMCwuNTguNTgsMCwwLDAsLjA2LS43NmwtLjA2LS4wNi00Ljc0LTQuNzRoMGwtLjkzLS45My0yLjIyLTIuMjNoMEwxNy40NiwxNy4yaDBsLS44OC0uODhMMTMuMjQsMTNBLjU3LjU3LDAsMCwwLDEyLjQyLDEzWm02LjE5LDcsMi43NCwyLjc0QTEuOTQsMS45NCwwLDAsMSwxOC42MSwyMFpNMjAsMTUuNTNhNy41NCw3LjU0LDAsMCwwLTIuMjQuMzNsMSwxQTYuNjksNi42OSwwLDAsMSwyMCwxNi42OWE2LjU5LDYuNTksMCwwLDEsNi4zOSw1LC41OS41OSwwLDAsMCwuNzEuNDIuNTguNTgsMCwwLDAsLjQyLS43QTcuNzQsNy43NCwwLDAsMCwyMCwxNS41M1ptLjE1LDIuNzIsMywyLjk1QTMuMTEsMy4xMSwwLDAsMCwyMC4xNSwxOC4yNVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",title:`${r} ${e.name}`}),(0,s.jsx)("img",{className:"icon channel-name",onClick:()=>{const e=this.props.channels;e[t].editable=!e[t].editable,this.props.setChannels(e)},src:e.icon,title:`${n} ${e.name}`})]},e.name)}))})}}class fa extends r.PureComponent{render(){const e=Math.pow(2,this.props.mipLevel),t=Math.ceil(this.props.texture.getSize().width/e),r=Math.ceil(this.props.texture.getSize().height/e);return(0,s.jsxs)("div",{id:"bottom-bar",children:[(0,s.jsx)("span",{id:"file-url",children:this.props.texture.name}),!this.props.texture.noMipmap&&(0,s.jsxs)("span",{id:"mip-level",children:["MIP Preview: ",this.props.mipLevel," ",t,"x",r]})]})}}class xa extends r.Component{render(){return(0,s.jsxs)("div",{children:[(0,s.jsx)("canvas",{id:"canvas-ui",ref:this.props.canvasUI,tabIndex:1}),(0,s.jsx)("canvas",{id:"canvas-2D",ref:this.props.canvas2D,hidden:!0}),(0,s.jsx)("canvas",{id:"canvas-3D",ref:this.props.canvas3D,hidden:!0})]})}}class va extends r.Component{render(){const e=this.props.instance;return(0,s.jsx)("div",{children:(0,s.jsxs)("label",{className:"tool-slider-input",children:[(0,s.jsxs)("span",{children:["Size: ",e.width]}),(0,s.jsx)("input",{id:"contrast-slider",type:"range",min:1,max:100,value:e.width,onChange:t=>{e.setBrushWidth(t.target.valueAsNumber),this.forceUpdate()}})]})})}}const ya={name:"Paintbrush",type:class{constructor(e){this.width=15,this.mousePos=null,this.getParameters=e}paint(e){const{getMouseCoordinates:t,metadata:r,updatePainting:n}=this.getParameters();let{x:s,y:a}=t(e);-1!=r.select.x1&&(s-=r.select.x1,a-=r.select.y1);const{ctx:i}=this;let l,p;if(p=new o.Vector2,null==this.mousePos)this.mousePos=new o.Vector2(s,a),l=1;else{const e=this.width/4,t=new o.Vector2(s-this.mousePos.x,a-this.mousePos.y);l=Math.ceil(t.length()/e);const r=t.length()/l;p=t.normalize().multiplyByFloats(r,r)}const c=this.mousePos.clone();for(let e=0;e{const{startPainting:t,stopPainting:r,metadata:n}=this.getParameters();if(this.isPainting)1===e.event.buttons&&this.getParameters().interactionEnabled()?e.pickInfo?.hit&&e.type===o.PointerEventTypes.POINTERMOVE&&this.paint(e):(this.isPainting=!1,this.circleCanvas.parentNode?.removeChild(this.circleCanvas),r(),this.mousePos=null);else if(e.type===o.PointerEventTypes.POINTERDOWN&&1===e.event.buttons&&this.getParameters().interactionEnabled()&&e.pickInfo?.hit){this.isPainting=!0;const r=document.createElement("canvas");r.width=this.width,r.height=this.width;const s=r.getContext("2d");s.imageSmoothingEnabled=!1;const a=new Array(4*this.width*this.width),i=this.width*this.width/4,l=o.Color3.FromHexString(n.color),p=Math.floor(255*l.r),c=Math.floor(255*l.g),d=Math.floor(255*l.b);let h=0;const u=-Math.floor(this.width/2),b=Math.ceil(this.width/2),g=-Math.floor(this.width/2),m=Math.ceil(this.width/2);for(let e=g;e{e.pickInfo?.hit&&(e.type===o.PointerEventTypes.POINTERDOWN&&1===e.event.buttons&&this.getParameters().interactionEnabled()&&(this.isPicking=!0,this.pick(e)),this.isPicking&&(1===e.event.buttons&&this.getParameters().interactionEnabled()?this.pick(e):this.isPicking=!1))})),this.isPicking=!1}cleanup(){this.pointerObserver&&this.getParameters().scene.onPointerObservable.remove(this.pointerObserver)}},icon:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjkuMzIsMTAu\n NjhjLTEuNjYtMS42Ni00LjA2LTEtNS41Ni41YTExLjg5LDExLjg5LDAsMCwwLTEuNjYsMi4zMUwyMiwxMy40MWExLjg5LDEuODksMCwwLDAtMi42NiwwbC0uOS45YTEuODksMS44OSwwLDAsMC0uMjIsMi4zOWwtNi4wOSw2LjA5YTIuNzUsMi43NSwwLDAsMC0uNzMs\n MS4yOGwtLjgxLDMuMjYtLjU2LjU2YTEuMTYsMS4xNiwwLDAsMCwwLDEuNjVsLjQxLjQxYTEuMTcsMS4xNywwLDAsMCwxLjY1LDBsLjU2LS41NiwzLjI2LS44MWEyLjc1LDIuNzUsMCwwLDAsMS4yOC0uNzNsNi4xNC02LjE0YTEuODcsMS44NywwLDAsMCwuODQuMjEs\n MS44MywxLjgzLDAsMCwwLDEuMzMtLjU1bC45LS45YTEuODcsMS44NywwLDAsMCwuMDgtMi41NywxMS41NCwxMS41NCwwLDAsMCwyLjMyLTEuNjZDMzAuMzIsMTQuNzQsMzEsMTIuMzUsMjkuMzIsMTAuNjhaTTE2LjE1LDI2Ljc5YTEuMjEsMS4yMSwwLDAsMS0uNTgu\n MzNMMTIsMjhsLjktMy41OWExLjIxLDEuMjEsMCwwLDEsLjMzLS41OGw2LjA3LTYuMDcsMi45NCwyLjk0Wm05LjIxLTcuMzgtLjkuOWMtLjE5LjItLjM0LjItLjU0LDBsLTQuNC00LjRhLjQuNCwwLDAsMSwwLS41NGwuOS0uOWEuNDMuNDMsMCwwLDEsLjI3LS4xMS4z\n OS4zOSwwLDAsMSwuMjcuMTFsNC40LDQuNEEuMzguMzgsMCwwLDEsMjUuMzYsMTkuNDFabTMuMzgtNS45M2EzLjcsMy43LDAsMCwxLTEsMS43LDExLjY3LDExLjY3LDAsMCwxLTIuMzUsMS42MkwyMy4yLDE0LjU5YTExLjY3LDExLjY3LDAsMCwxLDEuNjItMi4zNSwz\n LjcsMy43LDAsMCwxLDEuNy0xLDEuODMsMS44MywwLDAsMSwyLjIyLDIuMjJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PC9zdmc+",cursor:"iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAABmJLR0QA/wD/AP+gvaeTAAAByklEQVQ4jbWUv4saQRTHd+4s/BuCYRH1n7BQEhCRuyJ3RQgpRVt/tFvYSAjLxMPiWIJ1OA6OKwKBdCGBkIS4pFs76xgXhOlyyconzSrrojub4l618+a9z/u+mTdrGPdgIk0QwDZBCG3OUerqepYeCgigAbyJ+a+AEyB9lTDxAfBhPp9jWRZh+wB0u11msxnAJyCXSmkI/DIejx9Vq1Ujm83u7OdyOaPRaBi2bVeAr8BDnUIBfJRSUi6XWSwWa+B1VClw6ft+UKlUsG0b4DNw+G6AU8/zME2T5XIZAE9C/xYark983/9rmubmKM6SoNedTofRaARwqenqQkpJr9cDuI3uiYiSvbaZS4Dod1J8JrJIUoUQYgs+FLuplYk79lQ2hBAipvSggH2Vbvr9PlJKgFea2JeO49BqtQDeJgWee55HPp9ntVr9AR6H/vjtV5VSd8Vikel0CvA0CXoEfBsOh9RqNZRSd8CL2JwOlVK/6/X65rVNgWPdEeTX6/XPwWBAqVRiMpnsPFPHcSgUCliWRRAEv4BCIjAKBr67rkuz2dyBttttXNcF+AEUUwEj4GPgGfAu1v574DmQ0UI0BXYuSmepf9L/NZv3Yf8AKtG4imEra4UAAAAASUVORK5CYII="},Oa={name:"Floodfill",type:class{constructor(e){this.getParameters=e}async fill(){const{metadata:e,startPainting:t,updatePainting:r,stopPainting:n}=this.getParameters(),o=await t();o.fillStyle=e.color,o.globalAlpha=e.alpha,o.globalCompositeOperation="copy",o.fillRect(0,0,o.canvas.width,o.canvas.height),r(),n()}setup(){this.pointerObserver=this.getParameters().scene.onPointerObservable.add((e=>{e.type===o.PointerEventTypes.POINTERDOWN&&1===e.event.buttons&&this.getParameters().interactionEnabled()&&e.pickInfo?.hit&&this.fill()}))}cleanup(){this.pointerObserver&&this.getParameters().scene.onPointerObservable.remove(this.pointerObserver)}},icon:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMjAsMTAuNWEu\n NzUuNzUsMCwwLDAtMS41LDB2MS4yNWEyLjE0LDIuMTQsMCwwLDAtLjg0LjUzbC02Ljg4LDYuODhhMi4yNSwyLjI1LDAsMCwwLDAsMy4xOGw0Ljg4LDQuODhhMi4yNSwyLjI1LDAsMCwwLDMuMTgsMGw2Ljg4LTYuODhhMi4yNSwyLjI1LDAsMCwwLDAtMy4xOGwtNC44\n OC00Ljg4YTIuMjksMi4yOSwwLDAsMC0uODQtLjUzWm0tOC4xNiw5LjcyLDYuNjYtNi42NlYxNUEuNzUuNzUsMCwwLDAsMjAsMTVWMTMuNTZsNC42Niw0LjY2YS43NS43NSwwLDAsMSwwLDEuMDZsLTEsMUgxMS44Wm0uNDcsMS41M2g5Ljg4bC00LjQxLDQuNDFhLjc1\n Ljc1LDAsMCwxLTEuMDYsMFoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjcuNTEsMjEuODVhLjg4Ljg4LDAsMCwwLTEuNTQsMGwtMiwzLjc3YTMuMTUsMy4xNSwwLDEsMCw1LjU2LDBabS0yLjIzLDQuNDcsMS40Ni0yLjczLDEuNDUsMi43M2ExLjY1LDEu\n NjUsMCwxLDEtMi45MSwwWiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg=="},Sa=[{name:"Rectangle Select",type:class{constructor(e){this.isSelecting=!1,this.xStart=-1,this.yStart=-1,this.getParameters=e}setup(){const{scene:e}=this.getParameters();this.pointerObserver=e.onPointerObservable.add((e=>{const{getMouseCoordinates:t,setMetadata:r,metadata:n}=this.getParameters();if(this.isSelecting)if(1===e.event.buttons&&this.getParameters().interactionEnabled()){if(e.pickInfo?.hit&&e.type===o.PointerEventTypes.POINTERMOVE&&e.type===o.PointerEventTypes.POINTERMOVE&&this.isSelecting){const{x:n,y:o}=t(e);r({select:{x1:Math.min(n,this.xStart),y1:Math.min(o,this.yStart),x2:Math.max(n,this.xStart),y2:Math.max(o,this.yStart)}})}}else this.isSelecting=!1,n.select.x1!==n.select.x2&&n.select.y1!==n.select.y2||r({select:{x1:-1,y1:-1,x2:-1,y2:-1}});else if(e.type==o.PointerEventTypes.POINTERDOWN&&e&&1===e.event.buttons&&this.getParameters().interactionEnabled()&&e.pickInfo?.hit){this.isSelecting=!0;const{x:n,y:o}=({x:this.xStart,y:this.yStart}=t(e));r({select:{x1:n,y1:o,x2:n,y2:o}})}}))}cleanup(){this.isSelecting=!1,this.pointerObserver&&this.getParameters().scene.onPointerObservable.remove(this.pointerObserver)}},icon:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48cmVjdCB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHN0eWxlPSJmaWxsOm5vbmUiLz48cGF0aCBkPSJNMTEuNjMsMTUuNjNIMTAuMzh2LTMuN2ExLjU0LDEuNTQsMCwwLDEsMS41NS0xLjU1aDMuN3YxLjI1SDEyLjI1YS42Mi42MiwwLDAsMC0uNjIuNjJaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTExLjYzLDIyLjYzSDEwLjM4VjE3LjM4aDEuMjVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTI5LjYzLDIyLjYzSDI4LjM4VjE3LjM4aDEuMjVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTE1LjYzLDI5LjYzaC0zLjdhMS41NSwxLjU1LDAsMCwxLTEuNTUtMS41NlYyNC4zOGgxLjI1djMuMzdhLjYzLjYzLDAsMCwwLC42Mi42M2gzLjM4WiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0yOC4wNywyOS42M0gyNC4zOFYyOC4zOGgzLjM3YS42NC42NCwwLDAsMCwuNjMtLjYzVjI0LjM4aDEuMjV2My42OUExLjU2LDEuNTYsMCwwLDEsMjguMDcsMjkuNjNaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTIyLjYzLDExLjYzSDE3LjM4VjEwLjM4aDUuMjVaIiBzdHlsZT0iZmlsbDojZmZmIi8+PHBhdGggZD0iTTI5LjYzLDE1LjYzSDI4LjM4VjEyLjI1YS42My42MywwLDAsMC0uNjMtLjYySDI0LjM4VjEwLjM4aDMuNjlhMS41NSwxLjU1LDAsMCwxLDEuNTYsMS41NVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48cGF0aCBkPSJNMjIuNjMsMjkuNjNIMTcuMzhWMjguMzhoNS4yNVoiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=",cursor:"iVBORw0KGgoAAAANSUhEUgAAABUAAAAVAgMAAADUeU0FAAAACVBMVEUAAAAAAAD///+D3c/SAAAAAXRSTlMAQObYZgAAAAFiS0dEAmYLfGQAAAAnSURBVAjXY2CAAS0IpUY0BdG1ikNrFQODaqiaaBicBwfEG6aF0AQA4oYGiJg4woEAAAAASUVORK5CYII="},ya,ja,Oa];class wa extends r.Component{render(){return this.props.tool&&this.props.tool.settingsComponent?(0,s.jsx)("div",{id:"tool-ui",children:(0,s.jsx)(this.props.tool.settingsComponent,{instance:this.props.tool.instance})}):(0,s.jsx)(s.Fragment,{})}}var Ma=p(4703),Na={};Na.styleTagTransform=Xn(),Na.setAttributes=Zn(),Na.insert=Wn().bind(null,"head"),Na.domAPI=Hn(),Na.insertStyleElement=Jn(),Gn()(Ma.Z,Na),Ma.Z&&Ma.Z.locals&&Ma.Z.locals;class ka extends r.Component{constructor(e){super(e),this._uiCanvas=r.createRef(),this._2DCanvas=r.createRef(),this._3DCanvas=r.createRef(),this._pickerRef=r.createRef();const t=[{name:"Red",visible:!0,editable:!0,id:"R",icon:p(4687)},{name:"Green",visible:!0,editable:!0,id:"G",icon:p(5091)},{name:"Blue",visible:!0,editable:!0,id:"B",icon:p(269)}];this.props.texture.isCube?t.push({name:"Display",visible:!0,editable:!0,id:"A",icon:p(8652)}):t.push({name:"Alpha",visible:!0,editable:!0,id:"A",icon:p(1422)}),this.state={tools:[],activeToolIndex:-1,metadata:{color:"#ffffff",alpha:1,select:{x1:-1,y1:-1,x2:-1,y2:-1}},channels:t,pixelData:{},face:0,mipLevel:0,pickerOpen:!1},this.loadToolFromURL=this.loadToolFromURL.bind(this),this.changeTool=this.changeTool.bind(this),this.setMetadata=this.setMetadata.bind(this),this.saveTexture=this.saveTexture.bind(this),this.resetTexture=this.resetTexture.bind(this),this.resizeTexture=this.resizeTexture.bind(this),this.uploadTexture=this.uploadTexture.bind(this),this.setPickerOpen=this.setPickerOpen.bind(this),this.onPointerDown=this.onPointerDown.bind(this)}componentDidMount(){this._textureCanvasManager=new ba(this.props.texture,this.props.window.current.getWindow(),this._uiCanvas.current,this._2DCanvas.current,this._3DCanvas.current,(e=>{this.setState({pixelData:e})}),this.state.metadata,(()=>this.textureDidUpdate()),(e=>this.setMetadata(e)),(e=>this.setState({mipLevel:e}))),this.addTools(Sa)}componentDidUpdate(){const e=[];this.state.channels.forEach((t=>e.push({...t}))),this._textureCanvasManager.channels=e,this._textureCanvasManager.face=this.state.face,this._textureCanvasManager.mipLevel=this.state.mipLevel}componentWillUnmount(){this._textureCanvasManager.dispose()}textureDidUpdate(){null!=this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout((()=>{this.props.onUpdate(),this._timer=null}),ka._PREVIEW_UPDATE_DELAY_MS)}loadToolFromURL(e){o.Tools.LoadScript(e,(()=>{this.addTools([_TOOL_DATA_])}))}addTools(e){let t=[];e.forEach((e=>{const r={...e,instance:new e.type((()=>this.getToolParameters()))};t=t.concat(r)})),t=this.state.tools.concat(t),this.setState({tools:t})}getToolParameters(){return{scene:this._textureCanvasManager.scene,canvas2D:this._textureCanvasManager.canvas2D,scene3D:this._textureCanvasManager.scene3D,size:this._textureCanvasManager.size,updateTexture:()=>this._textureCanvasManager.updateTexture(),startPainting:()=>this._textureCanvasManager.startPainting(),stopPainting:()=>this._textureCanvasManager.stopPainting(),updatePainting:()=>this._textureCanvasManager.updatePainting(),metadata:this.state.metadata,setMetadata:e=>this.setMetadata(e),getMouseCoordinates:e=>this._textureCanvasManager.getMouseCoordinates(e),interactionEnabled:()=>this._textureCanvasManager.toolInteractionEnabled()}}changeTool(e){this._textureCanvasManager.tool=-1!=e?this.state.tools[e]:null,this.setState({activeToolIndex:e})}setMetadata(e){const t={...this.state.metadata,...e};this.setState({metadata:t}),this._textureCanvasManager.metadata=t}setPickerOpen(e){this.setState({pickerOpen:e})}onPointerDown(e){this._pickerRef.current?.contains(e.target)||this.setPickerOpen(!1)}saveTexture(){this._textureCanvasManager.saveTexture()}resetTexture(){this._textureCanvasManager.reset()}resizeTexture(e,t){this._textureCanvasManager.resize({width:e,height:t})}uploadTexture(e){this._textureCanvasManager.upload(e)}render(){const e=this.state.tools[this.state.activeToolIndex];let t="initial";return this._textureCanvasManager?.toolInteractionEnabled()?e&&e.cursor&&(t=`url(data:image/png;base64,${e.cursor}) 10 10, auto`):t="pointer",(0,s.jsxs)("div",{id:"texture-editor",onPointerDown:this.onPointerDown,style:{cursor:t},children:[(0,s.jsx)(Aa,{texture:this.props.texture,saveTexture:this.saveTexture,pixelData:this.state.pixelData,face:this.state.face,setFace:e=>this.setState({face:e}),resetTexture:this.resetTexture,resizeTexture:this.resizeTexture,uploadTexture:this.uploadTexture,mipLevel:this.state.mipLevel,setMipLevel:e=>this.setState({mipLevel:e}),size:this._textureCanvasManager?.size||this.props.texture.getSize()}),!this.props.texture.isCube&&(0,s.jsx)(ma,{tools:this.state.tools,activeToolIndex:this.state.activeToolIndex,addTool:this.loadToolFromURL,changeTool:this.changeTool,metadata:this.state.metadata,setMetadata:this.setMetadata,pickerOpen:this.state.pickerOpen,setPickerOpen:this.setPickerOpen,pickerRef:this._pickerRef,hasAlpha:-1===this.props.texture.textureFormat||this.props.texture.textureFormat===o.Constants.TEXTUREFORMAT_RGBA}),(0,s.jsx)(Ca,{channels:this.state.channels,setChannels:e=>{this.setState({channels:e})}}),(0,s.jsx)(xa,{canvas2D:this._2DCanvas,canvas3D:this._3DCanvas,canvasUI:this._uiCanvas,texture:this.props.texture}),(0,s.jsx)(wa,{tool:e}),(0,s.jsx)(fa,{texture:this.props.texture,mipLevel:this.state.mipLevel})]})}}ka._PREVIEW_UPDATE_DELAY_MS=160;var La=p(7077);let Ea,Pa=`https://unpkg.com/babylonjs-gui-editor@${o.Engine.Version}/babylon.guiEditor.js`;function Ia(){return void 0!==La.GUIEditor?{GUIEditor:La.GUIEditor}:"undefined"!=typeof BABYLON&&void 0!==BABYLON.GUIEditor?BABYLON:void 0}function Da(e){Ea=e}function Ta(e){Pa=e}async function _a(e,t){if(Ea=Ea||Ia(),!Ea){if("undefined"==typeof BABYLON)throw'Tried to call EditAdvancedDynamicTexture without first injecting the GUI editor. You need to call InjectGUIEditor() with a reference to @babylonjs/gui-editor. It can be imported at runtime using await import("@babylonjs/gui-editor").';if(void 0===Ea)try{await o.Tools.LoadScriptAsync(Pa),Ea=Ea||Ia()}catch{throw`Failed to load GUI editor from ${Pa}`}}Ea.GUIEditor.Show({liveGuiTexture:e},t)}const za=[{label:"Alpha",normalizable:0,value:o.Constants.TEXTUREFORMAT_ALPHA},{label:"Luminance",normalizable:0,value:o.Constants.TEXTUREFORMAT_LUMINANCE},{label:"Luminance/Alpha",normalizable:0,value:o.Constants.TEXTUREFORMAT_LUMINANCE_ALPHA},{label:"RGB",normalizable:1,value:o.Constants.TEXTUREFORMAT_RGB},{label:"RGBA",normalizable:1,value:o.Constants.TEXTUREFORMAT_RGBA},{label:"R (red)",normalizable:1,value:o.Constants.TEXTUREFORMAT_RED},{label:"RG (red/green)",normalizable:1,value:o.Constants.TEXTUREFORMAT_RG},{label:"R (red) integer",normalizable:0,value:o.Constants.TEXTUREFORMAT_RED_INTEGER},{label:"RG (red/green) integer",normalizable:0,value:o.Constants.TEXTUREFORMAT_RG_INTEGER},{label:"RGB integer",normalizable:0,value:o.Constants.TEXTUREFORMAT_RGB_INTEGER},{label:"RGBA integer",normalizable:0,value:o.Constants.TEXTUREFORMAT_RGBA_INTEGER},{label:"BGRA",normalizable:1,value:o.Constants.TEXTUREFORMAT_BGRA},{label:"Depth24/Stencil8",normalizable:0,hideType:!0,value:o.Constants.TEXTUREFORMAT_DEPTH24_STENCIL8},{label:"Depth32 float",normalizable:0,hideType:!0,value:o.Constants.TEXTUREFORMAT_DEPTH32_FLOAT},{label:"Depth16",normalizable:0,value:o.Constants.TEXTUREFORMAT_DEPTH16},{label:"Depth24",normalizable:0,value:o.Constants.TEXTUREFORMAT_DEPTH24},{label:"Depth24Unorm/Stencil8",normalizable:0,hideType:!0,value:o.Constants.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8},{label:"Depth32Float/Stencil8",normalizable:0,hideType:!0,value:o.Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8},{label:"RGBA BPTC UNorm",normalizable:0,compressed:!0,value:o.Constants.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM},{label:"RGB BPTC UFloat",normalizable:0,compressed:!0,value:o.Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT},{label:"RGB BPTC SFloat",normalizable:0,compressed:!0,value:o.Constants.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT},{label:"RGBA S3TC DXT5",normalizable:0,compressed:!0,value:o.Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5},{label:"RGBA S3TC DXT3",normalizable:0,compressed:!0,value:o.Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3},{label:"RGBA S3TC DXT1",normalizable:0,compressed:!0,value:o.Constants.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1},{label:"RGB S3TC DXT1",normalizable:0,compressed:!0,value:o.Constants.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1},{label:"RGBA ASTC 4x4",normalizable:0,compressed:!0,value:o.Constants.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4}],Ra=[{label:"unsigned byte",normalizable:1,value:o.Constants.TEXTURETYPE_UNSIGNED_BYTE},{label:"32-bit float",normalizable:0,value:o.Constants.TEXTURETYPE_FLOAT},{label:"16-bit float",normalizable:0,value:o.Constants.TEXTURETYPE_HALF_FLOAT},{label:"signed byte",normalizable:1,value:o.Constants.TEXTURETYPE_BYTE},{label:"signed short",normalizable:0,value:o.Constants.TEXTURETYPE_SHORT},{label:"unsigned short",normalizable:0,value:o.Constants.TEXTURETYPE_UNSIGNED_SHORT},{label:"signed int",normalizable:0,value:o.Constants.TEXTURETYPE_INT},{label:"unsigned int",normalizable:0,value:o.Constants.TEXTURETYPE_UNSIGNED_INTEGER},{label:"unsigned 4/4/4/4 short",normalizable:0,value:o.Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4},{label:"unsigned 5/5/5/1 short",normalizable:0,value:o.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1},{label:"unsigned 5/6/5 short",normalizable:0,value:o.Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5},{label:"unsigned 2/10/10/10 int",normalizable:0,value:o.Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV},{label:"unsigned 24/8 int",normalizable:0,value:o.Constants.TEXTURETYPE_UNSIGNED_INT_24_8},{label:"unsigned 10f/11f/11f int",normalizable:0,value:o.Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV},{label:"unsigned 5/9/9/9 int",normalizable:0,value:o.Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV},{label:"32-bits with only 8-bit used (stencil)",normalizable:0,value:o.Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV}];class Ba extends r.Component{constructor(e){super(e),this._textureInspectorSize={width:1024,height:490},this.state={isTextureEditorOpen:!1,textureEditing:null};const t=this.props.texture;if(this._textureLineRef=r.createRef(),this._popoutWindowRef=r.createRef(),!t||!t.rootContainer)return;const n=t;this._adtInstrumentation=new da.AdvancedDynamicTextureInstrumentation(n),this._adtInstrumentation.captureRenderTime=!0,this._adtInstrumentation.captureLayoutTime=!0,this.onOpenTextureEditor.bind(this),this.onCloseTextureEditor.bind(this),this.openTextureEditor.bind(this)}componentWillUnmount(){this._adtInstrumentation&&(this._adtInstrumentation.dispose(),this._adtInstrumentation=null)}updateTexture(e){const t=this.props.texture;o.Tools.ReadFile(e,(r=>{const n=new Blob([r],{type:"octet/stream"}),o=new FileReader;o.readAsDataURL(n),o.onloadend=()=>{const r=o.result;if(t.isCube){let n;e.name.toLowerCase().indexOf(".dds")>0?n=".dds":e.name.toLowerCase().indexOf(".env")>0&&(n=".env"),t.updateURL(r,n,(()=>this.forceRefresh()))}else t.updateURL(r,null,(()=>this.forceRefresh()))}}),void 0,!0)}openTextureEditor(){this.state.isTextureEditorOpen?this.onCloseTextureEditor((()=>this.openTextureEditor())):this.setState({isTextureEditorOpen:!0,textureEditing:this.props.texture})}onOpenTextureEditor(){}onCloseTextureEditor(e){this.setState({isTextureEditorOpen:!1,textureEditing:null},e)}forceRefresh(){this.forceUpdate(),this._textureLineRef.current.updatePreview()}findTextureFormat(e){for(let t=0;t=0&&"."!==g[e];e--)u=g[e]+u;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(In,{title:"PREVIEW",selection:this.props.globalState,children:[(0,s.jsx)(ca,{ref:this._textureLineRef,texture:e,width:256,height:256,globalState:this.props.globalState}),(0,s.jsx)(zn,{label:"Load texture from file",onClick:e=>this.updateTexture(e),accept:".jpg, .png, .tga, .dds, .env"}),(0,s.jsx)(_n,{label:"Edit",onClick:()=>{this.props.texture instanceof da.AdvancedDynamicTexture?_a(this.props.texture):this.openTextureEditor()}}),(0,s.jsx)(ls,{label:"URL",value:g,lockObject:this.props.lockObject,onChange:t=>{e.updateURL(t),this.forceRefresh()}})]}),this.state.isTextureEditorOpen&&(0,s.jsx)(cs,{id:"texture-editor",title:"Texture Inspector",size:this._textureInspectorSize,onOpen:this.onOpenTextureEditor,onClose:()=>this.onCloseTextureEditor,ref:this._popoutWindowRef,children:(0,s.jsx)(ka,{texture:this.props.texture,url:g,window:this._popoutWindowRef,onUpdate:()=>this.forceRefresh()})}),(0,s.jsx)(ps,{globalState:this.props.globalState,target:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"Width",value:e.getSize().width.toString()}),(0,s.jsx)(Pn,{label:"Height",value:e.getSize().height.toString()}),e.is2DArray&&(0,s.jsx)(Pn,{label:"Layers",value:e._texture?.depth.toString()??"?"}),e.is3D&&(0,s.jsx)(Pn,{label:"Depth",value:e._texture?.depth.toString()??"?"}),e.isRenderTarget&&(0,s.jsx)(_n,{label:"Scale up",onClick:()=>{const t=e.getScene();e.scale(2),setTimeout((()=>{this.props.globalState.onSelectionChangedObservable.notifyObservers(t.getTextureByUniqueId(e.uniqueId))}))}}),e.isRenderTarget&&(0,s.jsx)(_n,{label:"Scale down",onClick:()=>{const t=e.getScene();e.scale(.5),setTimeout((()=>{this.props.globalState.onSelectionChangedObservable.notifyObservers(t.getTextureByUniqueId(e.uniqueId))}))}}),(0,s.jsx)(Pn,{label:"Format",value:l?.label??"unknown"}),!l?.hideType&&!l?.compressed&&(0,s.jsx)(Pn,{label:"Type",value:p?.label??"unknown"}),!!l?.normalizable&&!l?.compressed&&!!p?.normalizable&&(0,s.jsx)(Pn,{label:"Normalized",value:p.normalizable?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Is compressed",value:l?.compressed?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Use sRGB buffers",value:e._texture?._useSRGBBuffer?"Yes":"No"}),u&&(0,s.jsx)(Pn,{label:"File format",value:u}),(0,s.jsx)(Pn,{label:"Unique ID",value:e.uniqueId.toString()}),(0,s.jsx)(Pn,{label:"Internal Unique ID",value:(e._texture?.uniqueId??"N/A").toString()}),(0,s.jsx)(Pn,{label:"Class",value:c}),d>=0&&(0,s.jsx)(Pn,{label:"Number of textures",value:d.toString()}),(0,s.jsx)(Pn,{label:"Has alpha",value:e.hasAlpha?"Yes":"No"}),(0,s.jsx)(so,{label:"Get alpha from RGB",target:e,propertyName:"getAlphaFromRGB",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Is 3D",value:e.is3D?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Is 2D array",value:e.is2DArray?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Is cube",value:e.isCube?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Is render target",value:e.isRenderTarget?"Yes":"No"}),e.isRenderTarget&&(0,s.jsx)(Pn,{label:"Depth/stencil texture format",value:h?.label??"no"}),e instanceof o.Texture&&(0,s.jsx)(Pn,{label:"Stored as inverted on Y",value:e.invertY?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Has mipmaps",value:e.noMipmap?"No":"Yes"}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"UV set",target:e,propertyName:"coordinatesIndex",minimum:0,maximum:3,step:1,onPropertyChangedObservable:this.props.onPropertyChangedObservable,decimalCount:0}),(0,s.jsx)(qo,{label:"Mode",options:n,target:e,propertyName:"coordinatesMode",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:t=>e.coordinatesMode=t}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Level",target:e,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.updateSamplingMode&&(0,s.jsx)(qo,{label:"Sampling",options:r,target:e,noDirectUpdate:!0,propertyName:"samplingMode",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:t=>e.updateSamplingMode(t)})]}),e.getScene()&&(0,s.jsx)(na,{globalState:this.props.globalState,animatable:e,scene:e.getScene(),lockObject:this.props.lockObject}),e.rootContainer&&this._adtInstrumentation&&(0,s.jsxs)(In,{title:"ADVANCED TEXTURE PROPERTIES",selection:this.props.globalState,children:[(0,s.jsx)(Dn,{label:"Last layout time",value:this._adtInstrumentation.renderTimeCounter.current,units:"ms"}),(0,s.jsx)(Dn,{label:"Last render time",value:this._adtInstrumentation.layoutTimeCounter.current,units:"ms"}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Render scale",minimum:.1,maximum:5,step:.1,target:e,propertyName:"renderScale",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Premultiply alpha",target:e,propertyName:"premulAlpha",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Ideal width",target:e,propertyName:"idealWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Ideal height",target:e,propertyName:"idealHeight",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use smallest ideal",target:e,propertyName:"useSmallestIdeal",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Render at ideal size",target:e,propertyName:"renderAtIdealSize",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Invalidate Rect optimization",target:e,propertyName:"useInvalidateRectOptimization",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"TRANSFORM",selection:this.props.globalState,children:[!e.isCube&&(0,s.jsxs)("div",{children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"U offset",target:e,propertyName:"uOffset",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"V offset",target:e,propertyName:"vOffset",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"U scale",target:e,propertyName:"uScale",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"V scale",target:e,propertyName:"vScale",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"U angle",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"uAng",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"V angle",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"vAng",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"W angle",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"wAng",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Clamp U",isSelected:()=>e.wrapU===o.Texture.CLAMP_ADDRESSMODE,onSelect:t=>e.wrapU=t?o.Texture.CLAMP_ADDRESSMODE:o.Texture.WRAP_ADDRESSMODE}),(0,s.jsx)(so,{label:"Clamp V",isSelected:()=>e.wrapV===o.Texture.CLAMP_ADDRESSMODE,onSelect:t=>e.wrapV=t?o.Texture.CLAMP_ADDRESSMODE:o.Texture.WRAP_ADDRESSMODE})]}),e.isCube&&(0,s.jsx)("div",{children:(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Rotation Y",useEuler:this.props.globalState.onlyUseEulers,minimum:0,maximum:2*Math.PI,step:.1,target:e,propertyName:"rotationY"})})]})]})}}class Ua extends r.Component{constructor(e){super(e),this._onDebugSelectionChangeObservable=new o.Observable}switchAmbientMode(e){this.props.material.debugMode=e?21:0}renderTextures(e){const t=this.props.material;return(0,s.jsxs)(In,{title:"CHANNELS",selection:this.props.globalState,children:[(0,s.jsx)(ia,{label:"Albedo",texture:t.albedoTexture,propertyName:"albedoTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{label:"Metallic Roughness",texture:t.metallicTexture,propertyName:"metallicTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{label:"Reflection",texture:t.reflectionTexture,propertyName:"reflectionTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{label:"Refraction",texture:t.refractionTexture,propertyName:"refractionTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{label:"Reflectivity",texture:t.reflectivityTexture,propertyName:"reflectivityTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{label:"Micro-surface",texture:t.microSurfaceTexture,propertyName:"microSurfaceTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{label:"Bump",texture:t.bumpTexture,propertyName:"bumpTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{label:"Emissive",texture:t.emissiveTexture,propertyName:"emissiveTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{label:"Opacity",texture:t.opacityTexture,propertyName:"opacityTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{customDebugAction:e=>this.switchAmbientMode(e),label:"Ambient",texture:t.ambientTexture,propertyName:"ambientTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{label:"Lightmap",texture:t.lightmapTexture,propertyName:"lightmapTexture",material:t,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(ia,{label:"Detailmap",texture:t.detailMap.texture,material:t,onTextureCreated:e=>t.detailMap.texture=e,onTextureRemoved:()=>t.detailMap.texture=null,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:e}),(0,s.jsx)(so,{label:"Use lightmap as shadowmap",target:t,propertyName:"useLightmapAsShadowmap",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use detailmap",target:t.detailMap,propertyName:"isEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),t.decalMap&&(0,s.jsx)(so,{label:"Use decalmap",target:t.decalMap,propertyName:"isEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}render(){const e=this.props.material,t=[{label:"Low",value:o.Constants.TEXTURE_FILTERING_QUALITY_LOW},{label:"Medium",value:o.Constants.TEXTURE_FILTERING_QUALITY_MEDIUM},{label:"High",value:o.Constants.TEXTURE_FILTERING_QUALITY_HIGH}];return e.sheen._useRoughness=e.sheen._useRoughness??null!==e.sheen.roughness,e.sheen.roughness=e.sheen.roughness??e.sheen._saveRoughness??0,e.sheen._useRoughness||(e.sheen._saveRoughness=e.sheen.roughness,e.sheen.roughness=null),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(sa,{globalState:this.props.globalState,lockObject:this.props.lockObject,material:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),this.renderTextures(this._onDebugSelectionChangeObservable),(0,s.jsxs)(In,{title:"LIGHTING & COLORS",selection:this.props.globalState,children:[(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Albedo",target:e,propertyName:"albedoColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable,isLinear:!0}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Reflectivity",target:e,propertyName:"reflectivityColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable,isLinear:!0}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Micro-surface",target:e,propertyName:"microSurface",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Emissive",target:e,propertyName:"emissiveColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable,isLinear:!0}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Ambient",target:e,propertyName:"ambientColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable,isLinear:!0}),(0,s.jsx)(so,{label:"Use physical light falloff",target:e,propertyName:"usePhysicalLightFalloff",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"METALLIC WORKFLOW",selection:this.props.globalState,children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Metallic",target:e,propertyName:"metallic",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Roughness",target:e,propertyName:"roughness",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Index of Refraction",target:e,propertyName:"indexOfRefraction",minimum:1,maximum:3,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"F0 Factor",target:e,propertyName:"metallicF0Factor",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Reflectance Color",target:e,propertyName:"metallicReflectanceColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable,isLinear:!0}),(0,s.jsx)(so,{label:"Use only metallic from MetallicReflectance texture",target:e,propertyName:"useOnlyMetallicFromMetallicReflectanceTexture",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ia,{label:"MetallicReflectance Texture",texture:e.metallicReflectanceTexture,onTextureCreated:t=>e.metallicReflectanceTexture=t,onTextureRemoved:()=>e.metallicReflectanceTexture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable}),(0,s.jsx)(ia,{label:"Reflectance Texture",texture:e.reflectanceTexture,onTextureCreated:t=>e.reflectanceTexture=t,onTextureRemoved:()=>e.reflectanceTexture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable})]}),(0,s.jsxs)(In,{title:"CLEAR COAT",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e.clearCoat,propertyName:"isEnabled",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.clearCoat.isEnabled&&(0,s.jsxs)("div",{className:"fragment",children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Intensity",target:e.clearCoat,propertyName:"intensity",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Roughness",target:e.clearCoat,propertyName:"roughness",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"IOR",target:e.clearCoat,propertyName:"indexOfRefraction",minimum:1,maximum:3,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Remap F0",target:e.clearCoat,propertyName:"remapF0OnInterfaceChange",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ia,{label:"Clear coat",texture:e.clearCoat.texture,onTextureCreated:t=>e.clearCoat.texture=t,onTextureRemoved:()=>e.clearCoat.texture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable}),(0,s.jsx)(ia,{label:"Roughness",texture:e.clearCoat.textureRoughness,onTextureCreated:t=>e.clearCoat.textureRoughness=t,onTextureRemoved:()=>e.clearCoat.textureRoughness=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable}),(0,s.jsx)(ia,{label:"Bump",texture:e.clearCoat.bumpTexture,onTextureCreated:t=>e.clearCoat.bumpTexture=t,onTextureRemoved:()=>e.clearCoat.bumpTexture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable}),e.clearCoat.bumpTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Bump strength",target:e.clearCoat.bumpTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use roughness from main texture",target:e.clearCoat,propertyName:"useRoughnessFromMainTexture",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Tint",target:e.clearCoat,propertyName:"isTintEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.clearCoat.isEnabled&&e.clearCoat.isTintEnabled&&(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Tint Color",target:e.clearCoat,propertyName:"tintColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable,isLinear:!0}),e.clearCoat.isEnabled&&e.clearCoat.isTintEnabled&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"At Distance",target:e.clearCoat,propertyName:"tintColorAtDistance",minimum:0,maximum:20,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.clearCoat.isEnabled&&e.clearCoat.isTintEnabled&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Tint Thickness",target:e.clearCoat,propertyName:"tintThickness",minimum:0,maximum:20,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.clearCoat.isEnabled&&e.clearCoat.isTintEnabled&&(0,s.jsx)(ia,{label:"Tint",texture:e.clearCoat.tintTexture,onTextureCreated:t=>e.clearCoat.tintTexture=t,onTextureRemoved:()=>e.clearCoat.tintTexture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable})]})]}),(0,s.jsxs)(In,{title:"IRIDESCENCE",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e.iridescence,propertyName:"isEnabled",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.iridescence.isEnabled&&(0,s.jsxs)("div",{className:"fragment",children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Intensity",target:e.iridescence,propertyName:"intensity",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"IOR",target:e.iridescence,propertyName:"indexOfRefraction",minimum:1,maximum:3,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Min Thickness",target:e.iridescence,propertyName:"minimumThickness",minimum:0,maximum:1e3,step:10,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Max Thickness",target:e.iridescence,propertyName:"maximumThickness",minimum:0,maximum:1e3,step:10,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ia,{label:"Iridescence",texture:e.iridescence.texture,onTextureCreated:t=>e.iridescence.texture=t,onTextureRemoved:()=>e.iridescence.texture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable}),(0,s.jsx)(ia,{label:"Thickness",texture:e.iridescence.thicknessTexture,onTextureCreated:t=>e.iridescence.thicknessTexture=t,onTextureRemoved:()=>e.iridescence.thicknessTexture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable})]})]}),(0,s.jsxs)(In,{title:"ANISOTROPIC",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e.anisotropy,propertyName:"isEnabled",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.anisotropy.isEnabled&&(0,s.jsxs)("div",{className:"fragment",children:[(0,s.jsx)(so,{label:"Legacy Mode",target:e.anisotropy,propertyName:"legacy",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Intensity",target:e.anisotropy,propertyName:"intensity",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(os,{lockObject:this.props.lockObject,label:"Direction",target:e.anisotropy,propertyName:"direction",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ia,{label:"Anisotropic",texture:e.anisotropy.texture,onTextureCreated:t=>e.anisotropy.texture=t,onTextureRemoved:()=>e.anisotropy.texture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable})]})]}),(0,s.jsxs)(In,{title:"SHEEN",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e.sheen,propertyName:"isEnabled",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.sheen.isEnabled&&(0,s.jsxs)("div",{className:"fragment",children:[(0,s.jsx)(so,{label:"Link to Albedo",target:e.sheen,propertyName:"linkSheenWithAlbedo",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Intensity",target:e.sheen,propertyName:"intensity",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Color",target:e.sheen,propertyName:"color",onPropertyChangedObservable:this.props.onPropertyChangedObservable,isLinear:!0}),(0,s.jsx)(ia,{label:"Sheen",texture:e.sheen.texture,onTextureCreated:t=>e.sheen.texture=t,onTextureRemoved:()=>e.sheen.texture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable}),(0,s.jsx)(ia,{label:"Roughness",texture:e.sheen.textureRoughness,onTextureCreated:t=>e.sheen.textureRoughness=t,onTextureRemoved:()=>e.sheen.textureRoughness=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable}),(0,s.jsx)(so,{label:"Use roughness",target:e.sheen,propertyName:"_useRoughness"}),e.sheen._useRoughness&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Roughness",target:e.sheen,propertyName:"roughness",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use roughness from main texture",target:e.sheen,propertyName:"useRoughnessFromMainTexture",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Albedo scaling",target:e.sheen,propertyName:"albedoScaling",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]}),(0,s.jsxs)(In,{title:"SUBSURFACE",selection:this.props.globalState,children:[(0,s.jsx)(ia,{label:"Thickness",texture:e.subSurface.thicknessTexture,onTextureCreated:t=>e.subSurface.thicknessTexture=t,onTextureRemoved:()=>e.subSurface.thicknessTexture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Min Thickness",target:e.subSurface,propertyName:"minimumThickness",minimum:0,maximum:10,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Max Thickness",target:e.subSurface,propertyName:"maximumThickness",minimum:0,maximum:10,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Mask From Thickness",target:e.subSurface,propertyName:"useMaskFromThicknessTexture",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"glTF-Style Textures",target:e.subSurface,propertyName:"useGltfStyleTextures",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use Thickness as Depth",target:e.subSurface,propertyName:"useThicknessAsDepth",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Tint Color",target:e.subSurface,propertyName:"tintColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable,isLinear:!0}),(0,s.jsx)(so,{label:"Scattering Enabled",target:e.subSurface,propertyName:"isScatteringEnabled",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.subSurface.isScatteringEnabled&&e.getScene().prePassRenderer&&e.getScene().subSurfaceConfiguration&&(0,s.jsx)("div",{className:"fragment",children:(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Meters per unit",target:e.getScene().subSurfaceConfiguration,propertyName:"metersPerUnit",minimum:.01,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}),(0,s.jsx)(so,{label:"Refraction Enabled",target:e.subSurface,propertyName:"isRefractionEnabled",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.subSurface.isRefractionEnabled&&(0,s.jsxs)("div",{className:"fragment",children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Intensity",target:e.subSurface,propertyName:"refractionIntensity",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ia,{label:"Refraction Intensity",texture:e.subSurface.refractionIntensityTexture,onTextureCreated:t=>e.subSurface.refractionIntensityTexture=t,onTextureRemoved:()=>e.subSurface.refractionIntensityTexture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable}),(0,s.jsx)(ia,{label:"Refraction",texture:e.subSurface.refractionTexture,onTextureCreated:t=>e.subSurface.refractionTexture=t,onTextureRemoved:()=>e.subSurface.refractionTexture=null,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:this._onDebugSelectionChangeObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Volume Index of Refraction",target:e.subSurface,propertyName:"volumeIndexOfRefraction",minimum:1,maximum:3,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Tint at Distance",target:e.subSurface,propertyName:"tintColorAtDistance",minimum:0,maximum:10,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Link refraction with transparency",target:e.subSurface,propertyName:"linkRefractionWithTransparency",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use albedo to tint surface transparency",target:e.subSurface,propertyName:"useAlbedoToTintRefraction",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsx)(so,{label:"Translucency Enabled",target:e.subSurface,propertyName:"isTranslucencyEnabled",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.subSurface.isTranslucencyEnabled&&(0,s.jsxs)("div",{className:"fragment",children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Intensity",target:e.subSurface,propertyName:"translucencyIntensity",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Diffusion Distance",target:e.subSurface,propertyName:"diffusionDistance",onPropertyChangedObservable:this.props.onPropertyChangedObservable,isLinear:!0}),(0,s.jsx)(so,{label:"Use albedo to tint surface translucency",target:e.subSurface,propertyName:"useAlbedoToTintTranslucency",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]}),(0,s.jsxs)(In,{title:"LEVELS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Environment",target:e,propertyName:"environmentIntensity",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Specular",target:e,propertyName:"specularIntensity",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Emissive",target:e,propertyName:"emissiveIntensity",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Direct",target:e,propertyName:"directIntensity",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.bumpTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Bump strength",target:e.bumpTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.ambientTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Ambient strength",target:e,propertyName:"ambientTextureStrength",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.reflectionTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Reflection strength",target:e.reflectionTexture,propertyName:"level",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.clearCoat.texture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Clear coat",target:e.clearCoat.texture,propertyName:"level",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.clearCoat.bumpTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Clear coat bump",target:e.clearCoat.bumpTexture,propertyName:"level",minimum:0,maximum:2,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.clearCoat.tintTexture&&!1,e.anisotropy.texture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Anisotropic",target:e.anisotropy.texture,propertyName:"level",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.sheen.texture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Sheen",target:e.sheen.texture,propertyName:"level",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.subSurface.thicknessTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Thickness",target:e.subSurface.thicknessTexture,propertyName:"level",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.subSurface.refractionTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Refraction",target:e.subSurface.refractionTexture,propertyName:"level",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.detailMap.isEnabled&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Detailmap diffuse",target:e.detailMap,propertyName:"diffuseBlendLevel",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Detailmap bump",target:e.detailMap,propertyName:"bumpLevel",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Detailmap roughness",target:e.detailMap,propertyName:"roughnessBlendLevel",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]}),(0,s.jsxs)(In,{title:"RENDERING",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Alpha from albedo",target:e,propertyName:"useAlphaFromAlbedoTexture",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Ambient in grayscale",target:e,propertyName:"useAmbientInGrayScale",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Radiance over alpha",target:e,propertyName:"useRadianceOverAlpha",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Micro-surface from ref. map alpha",target:e,propertyName:"useMicroSurfaceFromReflectivityMapAlpha",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Specular over alpha",target:e,propertyName:"useSpecularOverAlpha",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Specular anti-aliasing",target:e,propertyName:"enableSpecularAntiAliasing",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Realtime Filtering",target:e,propertyName:"realTimeFiltering",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{allowNullValue:!0,label:"Realtime Filtering quality",options:t,target:e,propertyName:"realTimeFilteringQuality",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"NORMAL MAP",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Invert X axis",target:e,propertyName:"invertNormalMapX",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Invert Y axis",target:e,propertyName:"invertNormalMapY",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"ADVANCED",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Energy Conservation",target:e.brdf,propertyName:"useEnergyConservation",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Spherical Harmonics",target:e.brdf,propertyName:"useSphericalHarmonics",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Radiance occlusion",target:e,propertyName:"useRadianceOcclusion",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Horizon occlusion ",target:e,propertyName:"useHorizonOcclusion",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Unlit",target:e,propertyName:"unlit",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"DEBUG",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(qo,{label:"Debug mode",options:[{label:"None",value:0},{label:"Normalized position",value:1},{label:"Normals",value:2},{label:"Tangents",value:3},{label:"Bitangents",value:4},{label:"Bump Normals",value:5},{label:"UV1",value:6},{label:"UV2",value:7},{label:"ClearCoat Normals",value:8},{label:"ClearCoat Tangents",value:9},{label:"ClearCoat Bitangents",value:10},{label:"Anisotropic Normals",value:11},{label:"Anisotropic Tangents",value:12},{label:"Anisotropic Bitangents",value:13},{label:"Albedo Map",value:20},{label:"Ambient Map",value:21},{label:"Opacity Map",value:22},{label:"Emissive Map",value:23},{label:"Light Map",value:24},{label:"Metallic Map",value:25},{label:"Reflectivity Map",value:26},{label:"ClearCoat Map",value:27},{label:"ClearCoat Tint Map",value:28},{label:"Sheen Map",value:29},{label:"Anisotropic Map",value:30},{label:"Thickness Map",value:31},{label:"Bump Map",value:32},{label:"Env Refraction",value:40},{label:"Env Reflection",value:41},{label:"Env Clear Coat",value:42},{label:"Direct Diffuse",value:50},{label:"Direct Specular",value:51},{label:"Direct Clear Coat",value:52},{label:"Direct Sheen",value:53},{label:"Env Irradiance",value:54},{label:"Surface Albedo",value:60},{label:"Reflectance 0",value:61},{label:"Metallic",value:62},{label:"Metallic F0",value:71},{label:"Roughness",value:63},{label:"AlphaG",value:64},{label:"NdotV",value:65},{label:"ClearCoat Color",value:66},{label:"ClearCoat Roughness",value:67},{label:"ClearCoat NdotV",value:68},{label:"Transmittance",value:69},{label:"Refraction Transmittance",value:70},{label:"Glossiness",value:72},{label:"Base Color",value:73},{label:"Specular Color",value:74},{label:"Emissive Color",value:75},{label:"SEO",value:80},{label:"EHO",value:81},{label:"Energy Factor",value:82},{label:"Specular Reflectance",value:83},{label:"Clear Coat Reflectance",value:84},{label:"Sheen Reflectance",value:85},{label:"Luminance Over Alpha",value:86},{label:"Alpha",value:87},{label:"Albedo Alpha",value:88}],target:e,propertyName:"debugMode"}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Split position",target:e,propertyName:"debugLimit",minimum:-1,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Output factor",target:e,propertyName:"debugFactor",minimum:0,maximum:5,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class Ga extends r.Component{constructor(e){super(e),this.state={isSelected:this.props.isSelected()}}componentDidMount(){this._onSelectionChangedObserver=this.props.onSelectionChangedObservable.add((e=>{this.setState({isSelected:e===this})}))}componentWillUnmount(){this._onSelectionChangedObserver&&(this.props.onSelectionChangedObservable.remove(this._onSelectionChangedObserver),this._onSelectionChangedObserver=null)}onChange(){this.props.onSelect(),this.props.onSelectionChangedObservable.notifyObservers(this)}render(){return(0,s.jsxs)("div",{className:"radioLine",children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,className:"icon"}),(0,s.jsx)("div",{className:"label",title:this.props.label,children:this.props.label}),(0,s.jsxs)("div",{className:"radioContainer",children:[(0,s.jsx)("input",{id:this.props.label,className:"radio",type:"radio",checked:this.state.isSelected,onChange:()=>this.onChange()}),(0,s.jsx)("label",{htmlFor:this.props.label,className:"labelForRadio"})]})]})}}class Fa extends r.Component{constructor(e){super(e),this.state={mode:this.props.scene.fogMode}}render(){const e=this.props.scene,t=[{label:"None",value:o.Scene.FOGMODE_NONE},{label:"Linear",value:o.Scene.FOGMODE_LINEAR},{label:"Exp",value:o.Scene.FOGMODE_EXP},{label:"Exp2",value:o.Scene.FOGMODE_EXP2}];return(0,s.jsxs)("div",{children:[(0,s.jsx)(qo,{label:"Fog mode",options:t,target:e,propertyName:"fogMode",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({mode:e})}),this.state.mode!==o.Scene.FOGMODE_NONE&&(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Fog color",target:e,propertyName:"fogColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(this.state.mode===o.Scene.FOGMODE_EXP||this.state.mode===o.Scene.FOGMODE_EXP2)&&(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Fog density",target:e,propertyName:"fogDensity",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),this.state.mode===o.Scene.FOGMODE_LINEAR&&(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Fog start",target:e,propertyName:"fogStart",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),this.state.mode===o.Scene.FOGMODE_LINEAR&&(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Fog end",target:e,propertyName:"fogEnd",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class Ha extends r.Component{constructor(e){super(e),this._renderingModeGroupObservable=new o.Observable}setRenderingModes(e,t){const r=this.props.scene;r.forcePointsCloud=e,r.forceWireframe=t}switchIBL(){const e=this.props.scene;e.environmentTexture?(this._storedEnvironmentTexture=e.environmentTexture,e.environmentTexture=null):(e.environmentTexture=this._storedEnvironmentTexture,this._storedEnvironmentTexture=null)}updateEnvironmentTexture(e){const t=e.name.toLowerCase().indexOf(".dds")>0,r=e.name.toLowerCase().indexOf(".env")>0;if(!t&&!r)return void console.error("Unable to update environment texture. Please select a dds or env file.");const n=this.props.scene;o.Tools.ReadFile(e,(e=>{const r=new Blob([e],{type:"octet/stream"}),s=URL.createObjectURL(r);n.environmentTexture=t?o.CubeTexture.CreateFromPrefilteredData(s,n,".dds"):new o.CubeTexture(s,n,void 0,void 0,void 0,(()=>{}),(e=>{e&&console.error(e)}),void 0,void 0,".env")}),void 0,!0)}updateGravity(e){this.props.scene.getPhysicsEngine().setGravity(e)}updateTimeStep(e){this.props.scene.getPhysicsEngine().setTimeStep(e)}normalizeScene(){this.props.scene.meshes.forEach((e=>{e.normalizeToUnitCube(!0),e.computeWorldMatrix(!0)}))}render(){const e=this.props.scene,t=e.getPhysicsEngine();let r=null;t&&(r={gravity:t.gravity,timeStep:t.getTimeStep()});const n=e.imageProcessingConfiguration,a=[{label:"Standard",value:o.ImageProcessingConfiguration.TONEMAPPING_STANDARD},{label:"ACES",value:o.ImageProcessingConfiguration.TONEMAPPING_ACES}],i=[{label:"Multiply",value:o.ImageProcessingConfiguration.VIGNETTEMODE_MULTIPLY},{label:"Opaque",value:o.ImageProcessingConfiguration.VIGNETTEMODE_OPAQUE}];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(In,{title:"RENDERING MODE",selection:this.props.globalState,children:[(0,s.jsx)(Ga,{onSelectionChangedObservable:this._renderingModeGroupObservable,label:"Point",isSelected:()=>e.forcePointsCloud,onSelect:()=>this.setRenderingModes(!0,!1)}),(0,s.jsx)(Ga,{onSelectionChangedObservable:this._renderingModeGroupObservable,label:"Wireframe",isSelected:()=>e.forceWireframe,onSelect:()=>this.setRenderingModes(!1,!0)}),(0,s.jsx)(Ga,{onSelectionChangedObservable:this._renderingModeGroupObservable,label:"Solid",isSelected:()=>!e.forcePointsCloud&&!e.forceWireframe,onSelect:()=>this.setRenderingModes(!1,!1)})]}),(0,s.jsxs)(In,{title:"ENVIRONMENT",selection:this.props.globalState,children:[(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Clear color",target:e,propertyName:"clearColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Clear color enabled",target:e,propertyName:"autoClear",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Ambient color",target:e,propertyName:"ambientColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Environment texture (IBL)",isSelected:()=>null!=e.environmentTexture,onSelect:()=>this.switchIBL()}),e.environmentTexture&&(0,s.jsx)(ia,{label:"Env. texture",texture:e.environmentTexture,onSelectionChangedObservable:this.props.onSelectionChangedObservable}),(0,s.jsx)(zn,{label:"Update environment texture",onClick:e=>this.updateEnvironmentTexture(e),accept:".dds, .env"}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:2,step:.01,label:"IBL Intensity",target:e,propertyName:"environmentIntensity",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Fa,{globalState:this.props.globalState,lockObject:this.props.lockObject,scene:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsx)(na,{globalState:this.props.globalState,animatable:e,scene:e,lockObject:this.props.lockObject}),(0,s.jsxs)(In,{title:"MATERIAL IMAGE PROCESSING",selection:this.props.globalState,children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:4,step:.1,label:"Contrast",target:n,propertyName:"contrast",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:4,step:.1,label:"Exposure",target:n,propertyName:"exposure",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Tone mapping",target:n,propertyName:"toneMappingEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Tone mapping type",options:a,target:n,propertyName:"toneMappingType",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({mode:e})}),(0,s.jsx)(so,{label:"Vignette",target:n,propertyName:"vignetteEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:4,step:.1,label:"Vignette weight",target:n,propertyName:"vignetteWeight",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:1,step:.1,label:"Vignette stretch",target:n,propertyName:"vignetteStretch",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:Math.PI,step:.1,label:"Vignette FOV",target:n,propertyName:"vignetteCameraFov",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:1,step:.1,label:"Vignette center X",target:n,propertyName:"vignetteCenterX",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:1,step:.1,label:"Vignette center Y",target:n,propertyName:"vignetteCenterY",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Vignette color",target:n,propertyName:"vignetteColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Vignette blend mode",options:i,target:n,propertyName:"vignetteBlendMode",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({mode:e})}),(0,s.jsx)(so,{label:"Dithering",target:n,propertyName:"ditheringEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:1,step:.5/255,label:"Dithering intensity",target:n,propertyName:"ditheringIntensity",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),null!==r&&(0,s.jsxs)(In,{title:"PHYSICS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Time step",target:r,propertyName:"timeStep",onChange:e=>this.updateTimeStep(e),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Gravity",target:r,propertyName:"gravity",onChange:e=>this.updateGravity(e),onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsx)(In,{title:"COLLISIONS",closed:!0,selection:this.props.globalState,children:(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Gravity",target:e,propertyName:"gravity",onPropertyChangedObservable:this.props.onPropertyChangedObservable})}),(0,s.jsx)(In,{title:"SHADOWS",closed:!0,selection:this.props.globalState,children:(0,s.jsx)(_n,{label:"Normalize scene",onClick:()=>this.normalizeScene()})})]})}}class Va extends r.Component{constructor(e){super(e)}_getNameForSortingAndDisplay(e){return"string"==typeof e.name?e.name:"no name"}render(){const e=this.props.node,t=e.getScene().getNodes().filter((t=>t!==e)).sort(((e,t)=>this._getNameForSortingAndDisplay(e).localeCompare(this._getNameForSortingAndDisplay(t)))),r=t.map(((e,t)=>({label:this._getNameForSortingAndDisplay(e),value:t})));return r.splice(0,0,{label:"None",value:-1}),(0,s.jsxs)(s.Fragment,{children:[e.parent&&(0,s.jsx)(Pn,{label:"Link to parent",value:e.parent.name,onLink:()=>this.props.globalState.onSelectionChangedObservable.notifyObservers(e.parent)}),(0,s.jsx)(qo,{label:"Parent",options:r,target:e,propertyName:"parent",noDirectUpdate:!0,onSelect:r=>{const n=e;if("number"!=typeof r||r<0)n.setParent?n.setParent(null):e.parent=null;else{const o=t[r];n.setParent?n.setParent(o):e.parent=o}this.props.globalState.onSelectionRenamedObservable.notifyObservers()},extractValue:()=>e.parent?t.indexOf(e.parent):-1,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class Wa extends r.Component{constructor(e){super(e)}render(){const e=this.props.light;return(0,s.jsxs)("div",{children:[(0,s.jsx)(ps,{globalState:this.props.globalState,target:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"ID",value:e.id}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Unique ID",value:e.uniqueId.toString()}),(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),(0,s.jsx)(Va,{globalState:this.props.globalState,node:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Intensity",target:e,propertyName:"intensity",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(_n,{label:"Dispose",onClick:()=>{e.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(null)}})]}),(0,s.jsx)(na,{globalState:this.props.globalState,animatable:e,scene:e.getScene(),lockObject:this.props.lockObject})]})}}class Ya extends r.Component{constructor(e){super(e)}render(){const e=this.props.light;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Wa,{globalState:this.props.globalState,lockObject:this.props.lockObject,light:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"SETUP",selection:this.props.globalState,children:[(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Diffuse",target:e,propertyName:"diffuse",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Ground",target:e,propertyName:"groundColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Direction",target:e,propertyName:"direction",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class Za extends r.Component{constructor(e){super(e),this._internals={generatorType:0,mapSize:1024}}createShadowGenerator(){const e=this.props.light,t=e.getScene(),r=this._internals,n=0===r.generatorType?new o.ShadowGenerator(r.mapSize,e):new o.CascadedShadowGenerator(r.mapSize,e);t.meshes.forEach((e=>{e.infiniteDistance||(n.addShadowCaster(e),e.isAnInstance||(e.receiveShadows=!0))})),this.forceUpdate()}disposeShadowGenerator(){const e=this.props.light;e.getShadowGenerator()?.dispose(),this.forceUpdate()}render(){const e=this.props.light,t=this._internals,r=e.getShadowGenerator()||null,n=r instanceof o.CascadedShadowGenerator,a=e.getScene().activeCamera,i=[{label:"Shadow Generator",value:0}];let l;e instanceof o.DirectionalLight&&i.push({label:"Cascaded Shadow Generator",value:1}),l=r instanceof o.CascadedShadowGenerator?[{label:"None",value:o.ShadowGenerator.FILTER_NONE},{label:"PCF",value:o.ShadowGenerator.FILTER_PCF},{label:"PCSS",value:o.ShadowGenerator.FILTER_PCSS}]:[{label:"None",value:o.ShadowGenerator.FILTER_NONE},{label:"PCF",value:o.ShadowGenerator.FILTER_PCF},{label:"PCSS",value:o.ShadowGenerator.FILTER_PCSS},{label:"Poisson",value:o.ShadowGenerator.FILTER_POISSONSAMPLING},{label:"Exponential",value:o.ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP},{label:"Blurred exponential",value:o.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP},{label:"Close exponential",value:o.ShadowGenerator.FILTER_CLOSEEXPONENTIALSHADOWMAP},{label:"Blurred close exponential",value:o.ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP}];const p=[{label:"Low",value:o.ShadowGenerator.QUALITY_LOW},{label:"Medium",value:o.ShadowGenerator.QUALITY_MEDIUM},{label:"High",value:o.ShadowGenerator.QUALITY_HIGH}],c=a?a.minZ:0,d=a?a.maxZ?a.maxZ:5e5:0,h=r?r.filter:0;return(0,s.jsxs)("div",{children:[(0,s.jsxs)(In,{title:"SHADOWS",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Shadows enabled",target:e,propertyName:"shadowEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),!n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Shadows near plane",target:e,propertyName:"shadowMinZ",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Shadows far plane",target:e,propertyName:"shadowMaxZ",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]}),null==r&&(0,s.jsxs)(In,{title:"SHADOW GENERATOR",selection:this.props.globalState,children:[(0,s.jsx)(qo,{label:"Type",options:i,target:t,propertyName:"generatorType"}),(0,s.jsx)(qo,{label:"Map size",options:[{label:"4096x4096",value:4096},{label:"2048x2048",value:2048},{label:"1024x1024",value:1024},{label:"512x512",value:512},{label:"256x256",value:256}],target:t,propertyName:"mapSize"}),(0,s.jsx)(_n,{label:"Create generator",onClick:()=>this.createShadowGenerator()})]}),null!==r&&(0,s.jsxs)(In,{title:"SHADOW GENERATOR",selection:this.props.globalState,children:[(0,s.jsx)(_n,{label:"Dispose generator",onClick:()=>this.disposeShadowGenerator()}),n&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(qo,{label:"Num cascades",options:[{label:"2",value:2},{label:"3",value:3},{label:"4",value:4}],target:r,propertyName:"numCascades",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Debug mode",target:r,propertyName:"debug",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Stabilize cascades",target:r,propertyName:"stabilizeCascades",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Lambda",minimum:0,maximum:1,step:.01,target:r,propertyName:"lambda",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Cascade blend",minimum:0,maximum:1,step:.01,target:r,propertyName:"cascadeBlendPercentage",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Depth clamp",target:r,propertyName:"depthClamp",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Auto-Calc depth bounds",target:r,propertyName:"autoCalcDepthBounds",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Shadow MaxZ",minimum:c,maximum:d,step:.5,target:r,propertyName:"shadowMaxZ",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,digits:4,step:"0.0001",label:"Bias",target:r,propertyName:"bias",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Normal bias",target:r,propertyName:"normalBias",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Darkness",target:r,minimum:0,maximum:1,step:.01,propertyName:"darkness",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Allow transparent shadows",target:r,propertyName:"transparencyShadow",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Filter",options:l,onSelect:()=>{this.forceUpdate()},target:r,propertyName:"filter",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(h===o.ShadowGenerator.FILTER_PCF||h===o.ShadowGenerator.FILTER_PCSS)&&(0,s.jsx)(qo,{label:"Filtering quality",options:p,onSelect:()=>{this.forceUpdate()},target:r,propertyName:"filteringQuality",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),h===o.ShadowGenerator.FILTER_PCSS&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Penumbra ratio",minimum:0,maximum:.5,step:.001,target:r,propertyName:"contactHardeningLightSizeUVRatio",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),!n&&(h===o.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP||h===o.ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)&&(0,s.jsx)(so,{label:"Use kernel blur",target:r,propertyName:"useKernelBlur",onValueChanged:()=>this.forceUpdate(),onPropertyChangedObservable:this.props.onPropertyChangedObservable}),r instanceof o.ShadowGenerator&&(h===o.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP||h===o.ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)&&!r.useKernelBlur&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Blur box offset",target:r,propertyName:"blurBoxOffset",minimum:1,maximum:64,step:1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),r instanceof o.ShadowGenerator&&(h===o.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP||h===o.ShadowGenerator.FILTER_BLURCLOSEEXPONENTIALSHADOWMAP)&&r.useKernelBlur&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Blur kernel",target:r,propertyName:"blurKernel",minimum:1,maximum:64,step:1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),r instanceof o.ShadowGenerator&&(h===o.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP||h===o.ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP)&&(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Depth scale",target:r,propertyName:"depthScale",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),r instanceof o.ShadowGenerator&&(h===o.ShadowGenerator.FILTER_BLUREXPONENTIALSHADOWMAP||h===o.ShadowGenerator.FILTER_EXPONENTIALSHADOWMAP)&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Blur scale",target:r,propertyName:"blurScale",minimum:1,maximum:4,step:1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),n&&h===o.ShadowGenerator.FILTER_PCSS&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Penumbra darkness",minimum:0,maximum:1,step:.01,target:r,propertyName:"penumbraDarkness",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class Qa extends r.Component{constructor(e){super(e)}render(){const e=this.props.light;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Wa,{globalState:this.props.globalState,lockObject:this.props.lockObject,light:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"SETUP",selection:this.props.globalState,children:[(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Diffuse",target:e,propertyName:"diffuse",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Specular",target:e,propertyName:"specular",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Position",target:e,propertyName:"position",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsx)(Za,{globalState:this.props.globalState,lockObject:this.props.lockObject,light:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class Ja extends r.Component{constructor(e){super(e),this.state={mode:this.props.camera.mode}}render(){const e=this.props.camera,t=[{label:"Perspective",value:o.Camera.PERSPECTIVE_CAMERA},{label:"Orthographic",value:o.Camera.ORTHOGRAPHIC_CAMERA}];return(0,s.jsxs)("div",{children:[(0,s.jsx)(ps,{globalState:this.props.globalState,target:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"ID",value:e.id}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Unique ID",value:e.uniqueId.toString()}),(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Near plane",target:e,propertyName:"minZ",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Va,{globalState:this.props.globalState,node:e,lockObject:this.props.lockObject}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Far plane",target:e,propertyName:"maxZ",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Inertia",target:e,propertyName:"inertia",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(oa,{isInteger:!0,lockObject:this.props.lockObject,label:"Layer mask",target:e,propertyName:"layerMask",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Mode",options:t,target:e,propertyName:"mode",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({mode:e})}),e.mode===o.Camera.PERSPECTIVE_CAMERA&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Field of view",target:e,useEuler:this.props.globalState.onlyUseEulers,propertyName:"fov",minimum:.1,maximum:Math.PI,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.mode===o.Camera.ORTHOGRAPHIC_CAMERA&&(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Left",target:e,propertyName:"orthoLeft",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.mode===o.Camera.ORTHOGRAPHIC_CAMERA&&(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Top",target:e,propertyName:"orthoTop",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.mode===o.Camera.ORTHOGRAPHIC_CAMERA&&(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Right",target:e,propertyName:"orthoRight",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.mode===o.Camera.ORTHOGRAPHIC_CAMERA&&(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Bottom",target:e,propertyName:"orthoBottom",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(_n,{label:"Dispose",onClick:()=>{e.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(null)}})]}),(0,s.jsx)(na,{globalState:this.props.globalState,animatable:e,scene:e.getScene(),lockObject:this.props.lockObject})]})}}class Ka extends r.Component{constructor(e){super(e)}render(){const e=this.props.camera;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ja,{globalState:this.props.globalState,lockObject:this.props.lockObject,camera:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"TRANSFORMS",selection:this.props.globalState,children:[(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Target",target:e,propertyName:"target",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Position",target:e,propertyName:"position",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Rotation",noSlider:!0,useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"rotation",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"CONTROLS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Angular sensitivity",target:e,propertyName:"angularSensibility",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Speed",target:e,propertyName:"speed",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"COLLISIONS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Check collisions",target:e,propertyName:"checkCollisions",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Apply gravity",target:e,propertyName:"applyGravity",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Ellipsoid",target:e,propertyName:"ellipsoid",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Ellipsoid offset",target:e,propertyName:"ellipsoidOffset",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class Xa extends r.Component{constructor(e){super(e)}render(){const e=this.props.camera;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ja,{globalState:this.props.globalState,lockObject:this.props.lockObject,camera:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"TRANSFORMS",selection:this.props.globalState,children:[(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Target",target:e,propertyName:"target",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Alpha",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"alpha",minimum:e.lowerAlphaLimit||0,maximum:e.upperAlphaLimit||2*Math.PI,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Beta",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"beta",minimum:e.lowerAlphaLimit||0,maximum:e.upperBetaLimit||2*Math.PI,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Radius",target:e,propertyName:"radius",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"CONTROLS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Angular sensitivity X",target:e,propertyName:"angularSensibilityX",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Angular sensitivity Y",target:e,propertyName:"angularSensibilityY",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Panning sensitivity",target:e,propertyName:"panningSensibility",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Pinch delta percentage",target:e,propertyName:"pinchDeltaPercentage",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Wheel delta percentage",target:e,propertyName:"wheelDeltaPercentage",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Speed",target:e,propertyName:"speed",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"COLLISIONS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Check collisions",target:e,propertyName:"checkCollisions",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Collision radius",target:e,propertyName:"collisionRadius",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"LIMITS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Lower alpha limit",target:e,propertyName:"lowerAlphaLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Upper alpha limit",target:e,propertyName:"upperAlphaLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Lower beta limit",target:e,propertyName:"lowerBetaLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Upper beta limit",target:e,propertyName:"upperBetaLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Lower radius limit",target:e,propertyName:"lowerRadiusLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Upper radius limit",target:e,propertyName:"upperRadiusLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"BEHAVIORS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Auto rotation",target:e,propertyName:"useAutoRotationBehavior",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Bouncing",target:e,propertyName:"useBouncingBehavior",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Framing",target:e,propertyName:"useFramingBehavior",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class qa extends r.Component{render(){const e=this.props;return(0,s.jsx)(rs,{...e})}}class $a extends r.Component{constructor(e){super(e)}onLink(){this.props.url?window.open(this.props.url,"_blank"):this.props.onLink&&this.props.onLink()}renderContent(){return this.props.onLink||this.props.url?(0,s.jsx)("div",{className:"link-value",title:this.props.value,onClick:()=>this.onLink(),children:this.props.url?"doc":this.props.value||"no name"}):(0,s.jsx)("div",{className:"value",title:this.props.value,style:{color:this.props.color?this.props.color:""},children:this.props.value||"no name"})}render(){return(0,s.jsx)("div",{className:"indented "+(this.props.underline?"textLine underline":"textLine"+(this.props.additionalClass?" "+this.props.additionalClass:"")),children:this.renderContent()})}}class ei extends r.Component{constructor(e){super(e)}renderLevel(e){const t=[];for(const r in e){const n=e[r];switch(Object.prototype.toString.call(n)){case"[object String]":t.push((0,s.jsx)(Pn,{label:r,ignoreValue:!0},r)),t.push((0,s.jsx)($a,{value:n},r+n));break;case"[object Array]":t.push((0,s.jsx)(Pn,{label:r,ignoreValue:!0},r));for(const e of n)t.push((0,s.jsx)($a,{value:e},r+e));break;case"[object Object]":t.push((0,s.jsx)(Pn,{label:r,ignoreValue:!0},r));for(const e in n)t.push((0,s.jsx)(Pn,{label:e,value:n[e],additionalClass:"reduced-opacity"},r+e))}}return t}render(){return this.props.host.metadata&&this.props.host.metadata.xmp?(0,s.jsx)("div",{children:(0,s.jsx)(In,{title:"XMP METADATA",selection:this.props.globalState,children:this.renderLevel(this.props.host.metadata.xmp)})}):null}}class ti extends r.Component{constructor(e){super(e)}_getVariantsExtension(){return this.props.globalState?.glTFLoaderExtensions.KHR_materials_variants}render(){const e=this._getVariantsExtension();if(!e)return null;const t=e.getAvailableVariants(this.props.host);if(!t||0===t.length)return null;const r=t.sort().map(((e,t)=>({label:e,value:t+1})));return r.splice(0,0,{label:"Original",value:0}),(0,s.jsx)("div",{children:(0,s.jsx)(In,{title:"VARIANTS",selection:this.props.globalState,children:(0,s.jsx)(qo,{label:"Active variant",options:r,noDirectUpdate:!0,target:this.props.host,propertyName:"",onSelect:r=>{const n=r;0===n?e.reset(this.props.host):e.selectVariant(this.props.host,t[n-1]),this.forceUpdate()},extractValue:()=>{const r=e.getLastSelectedVariant(this.props.host)||0;let n=0;return r&&"[object String]"===Object.prototype.toString.call(r)&&(n=t.indexOf(r),n>-1&&(n+=1)),n}})})})}}class ri extends r.Component{constructor(e){super(e);const t=this.props.mesh;this.state={displayNormals:!1,displayVertexColors:!1,displayBoneWeights:!(!t.material||"BoneWeightShader"!==t.material.getClassName()),displayBoneIndex:0,displaySkeletonMap:!1}}renderWireframeOver(){const e=this.props.mesh,t=e.getScene();if(e.reservedDataStore&&e.reservedDataStore.wireframeOver)return e.reservedDataStore.wireframeOver.dispose(!1,!0),e.reservedDataStore.wireframeOver=null,void this.forceUpdate();const r=e.clone(e.name+"_wireframeover",null,!0,!1);r.reservedDataStore={hidden:!0},r.parent=e,r.position=o.Vector3.Zero(),r.scaling=new o.Vector3(1,1,1),r.rotation=o.Vector3.Zero(),r.rotationQuaternion=null;const n=new o.StandardMaterial("wireframeOver",t);n.reservedDataStore={hidden:!0},r.material=n,n.zOffset=1,n.disableLighting=!0,n.backFaceCulling=!1,n.emissiveColor=o.Color3.White(),n.wireframe=!0,e.reservedDataStore||(e.reservedDataStore={}),e.reservedDataStore.wireframeOver=r,this.forceUpdate()}renderNormalVectors(){const e=this.props.mesh,t=e.getScene();if(e.reservedDataStore&&e.reservedDataStore.normalLines)return e.reservedDataStore.normalLines.dispose(),e.reservedDataStore.normalLines=null,void this.forceUpdate();const r=e.getVerticesData(o.VertexBuffer.NormalKind),n=e.getVerticesData(o.VertexBuffer.PositionKind),s=o.Color3.White(),a=e.getBoundingInfo(),i=.05*a.maximum.subtractToRef(a.minimum,o.TmpVectors.Vector3[0]).length(),l=[];for(let e=0;e(e.name||"no name").localeCompare(t.name||"no name"))),b=u.map(((e,t)=>({label:e.name||"no name",value:t})));b.splice(0,0,{label:"None (Default Fallback)",value:-1});const g=e.skeleton?e.skeleton.bones.filter((e=>e.getIndex()>=0)).sort(((e,t)=>e.getIndex()-t.getIndex())).map((e=>({label:e.name,value:e.getIndex()}))):[];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ps,{globalState:this.props.globalState,target:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"ID",value:this._getIdForDisplay(e.id)}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Unique ID",value:e.uniqueId.toString()}),(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),(0,s.jsx)(Pn,{label:"Vertices",value:e.getTotalVertices().toString()}),(0,s.jsx)(Pn,{label:"Faces",value:(e.getTotalIndices()/3).toFixed(0)}),(0,s.jsx)(Pn,{label:"Sub-meshes",value:e.subMeshes?e.subMeshes.length.toString():"0"}),(0,s.jsx)(Va,{globalState:this.props.globalState,node:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.skeleton&&(0,s.jsx)(Pn,{label:"Skeleton",value:e.skeleton.name,onLink:()=>this.onSkeletonLink()}),(0,s.jsx)(so,{label:"Is enabled",isSelected:()=>e.isEnabled(),onSelect:t=>{const r=e.isEnabled();e.setEnabled(t),this.props.onPropertyChangedObservable?.notifyObservers({object:e,property:"isEnabled",value:t,initialValue:r})}}),(0,s.jsx)(so,{label:"Is pickable",target:e,propertyName:"isPickable",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.material&&(!e.material.reservedDataStore||!e.material.reservedDataStore.hidden)&&(0,s.jsx)(Pn,{label:"Link to material",value:e.material.name,onLink:()=>this.onMaterialLink()}),!e.isAnInstance&&(0,s.jsx)(qo,{label:"Active material",options:b,target:e,propertyName:"material",noDirectUpdate:!0,onSelect:t=>{e.material=t<0?null:u[t],this.forceUpdate()},extractValue:()=>e.material?u.indexOf(e.material):-1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.isAnInstance&&(0,s.jsx)(Pn,{label:"Source",value:e.sourceMesh.name,onLink:()=>this.onSourceMeshLink()}),(0,s.jsx)(_n,{label:"Dispose",onClick:()=>{e.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(null)}})]}),(0,s.jsx)(ei,{host:e,lockObject:this.props.lockObject,globalState:this.props.globalState}),(0,s.jsx)(ti,{host:e,lockObject:this.props.lockObject,globalState:this.props.globalState}),(0,s.jsxs)(In,{title:"TRANSFORMS",selection:this.props.globalState,children:[(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Position",target:e,propertyName:"position",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),!e.rotationQuaternion&&(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Rotation",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"rotation",step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.rotationQuaternion&&(0,s.jsx)(as,{lockObject:this.props.lockObject,label:"Rotation",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"rotationQuaternion",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Scaling",target:e,propertyName:"scaling",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),e._internalMetadata&&e._internalMetadata.nodeGeometry&&(0,s.jsx)(In,{title:"NODE GEOMETRY",selection:this.props.globalState,children:(0,s.jsx)(_n,{label:"Edit",onClick:()=>{e._internalMetadata.nodeGeometry.edit({nodeGeometryEditorConfig:{backgroundColor:e.getScene().clearColor,hostMesh:e,hostScene:e.getScene()}})}})}),(0,s.jsxs)(In,{title:"DISPLAY",closed:!0,selection:this.props.globalState,children:[!e.isAnInstance&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Visibility",target:e,propertyName:"visibility",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Alpha index",target:e,propertyName:"alphaIndex",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Receive shadows",target:e,propertyName:"receiveShadows",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.isVerticesDataPresent(o.VertexBuffer.ColorKind)&&(0,s.jsx)(so,{label:"Use vertex colors",target:e,propertyName:"useVertexColors",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.isVerticesDataPresent(o.VertexBuffer.ColorKind)&&(0,s.jsx)(so,{label:"Has vertex alpha",target:e,propertyName:"hasVertexAlpha",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),t.fogMode!==o.Scene.FOGMODE_NONE&&(0,s.jsx)(so,{label:"Apply fog",target:e,propertyName:"applyFog",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),!e.parent&&(0,s.jsx)(so,{label:"Infinite distance",target:e,propertyName:"infiniteDistance",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Rendering group ID",decimalCount:0,target:e,propertyName:"renderingGroupId",minimum:o.RenderingManager.MIN_RENDERINGGROUPS,maximum:o.RenderingManager.MAX_RENDERINGGROUPS-1,step:1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(oa,{isInteger:!0,lockObject:this.props.lockObject,label:"Layer mask",target:e,propertyName:"layerMask",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),null!=e.morphTargetManager&&(0,s.jsx)(In,{title:"MORPH TARGETS",closed:!0,selection:this.props.globalState,children:c.map(((e,t)=>(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:e.name,target:e,propertyName:"influence",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable},t)))}),(0,s.jsx)(na,{globalState:this.props.globalState,animatable:e,scene:e.getScene(),lockObject:this.props.lockObject}),(0,s.jsxs)(In,{title:"ADVANCED",closed:!0,selection:this.props.globalState,children:[e.useBones&&(0,s.jsx)(so,{label:"Compute bones using shaders",target:e,propertyName:"computeBonesUsingShaders",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Collisions",target:e,propertyName:"checkCollisions",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Geometry ID",value:e.geometry?.uniqueId.toString()}),(0,s.jsx)(Pn,{label:"Has normals",value:e.isVerticesDataPresent(o.VertexBuffer.NormalKind)?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Has vertex colors",value:e.isVerticesDataPresent(o.VertexBuffer.ColorKind)?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Has UV set 0",value:e.isVerticesDataPresent(o.VertexBuffer.UVKind)?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Has UV set 1",value:e.isVerticesDataPresent(o.VertexBuffer.UV2Kind)?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Has UV set 2",value:e.isVerticesDataPresent(o.VertexBuffer.UV3Kind)?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Has UV set 3",value:e.isVerticesDataPresent(o.VertexBuffer.UV4Kind)?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Has tangents",value:e.isVerticesDataPresent(o.VertexBuffer.TangentKind)?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Has matrix weights",value:e.isVerticesDataPresent(o.VertexBuffer.MatricesWeightsKind)?"Yes":"No"}),(0,s.jsx)(Pn,{label:"Has matrix indices",value:e.isVerticesDataPresent(o.VertexBuffer.MatricesIndicesKind)?"Yes":"No"})]}),null!=e.physicsImpostor&&(0,s.jsxs)(In,{title:"PHYSICS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Mass",target:e.physicsImpostor,propertyName:"mass",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Friction",target:e.physicsImpostor,propertyName:"friction",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Restitution",target:e.physicsImpostor,propertyName:"restitution",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Type",value:this.convertPhysicsTypeToString()})]}),(0,s.jsxs)(In,{title:"OCCLUSIONS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(qo,{label:"Type",options:h,target:e,propertyName:"occlusionType",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Retry count",minimum:-1,maximum:10,decimalCount:0,step:1,target:e,propertyName:"occlusionRetryCount",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Algorithm",options:d,target:e,propertyName:"occlusionQueryAlgorithmType",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"EDGE RENDERING",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enable",target:e,isSelected:()=>null!=e.edgesRenderer,onSelect:t=>{t?e.enableEdgesRendering():e.disableEdgesRendering()},onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Edge width",minimum:0,maximum:10,step:.1,target:e,propertyName:"edgesWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qa,{lockObject:this.props.lockObject,label:"Edge color",target:e,propertyName:"edgesColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),!e.isAnInstance&&(0,s.jsxs)(In,{title:"OUTLINE & OVERLAY",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Render overlay",target:e,propertyName:"renderOverlay",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Overlay color",target:e,propertyName:"overlayColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Render outline",target:e,propertyName:"renderOutline",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Outline color",target:e,propertyName:"outlineColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"DEBUG",closed:!0,selection:this.props.globalState,children:[!e.isAnInstance&&(0,s.jsx)(so,{label:"Display normals",isSelected:()=>r,onSelect:()=>this.displayNormals()}),!e.isAnInstance&&(0,s.jsx)(so,{label:"Display vertex colors",isSelected:()=>n,onSelect:()=>this.displayVertexColors()}),e.isVerticesDataPresent(o.VertexBuffer.NormalKind)&&(0,s.jsx)(so,{label:"Render vertex normals",isSelected:()=>a,onSelect:()=>this.renderNormalVectors()}),!e.isAnInstance&&(0,s.jsx)(so,{label:"Render wireframe over mesh",isSelected:()=>i,onSelect:()=>this.renderWireframeOver()}),!e.isAnInstance&&e.skeleton&&(0,s.jsx)(so,{label:"Display BoneWeights",isSelected:()=>l,onSelect:()=>this.displayBoneWeights()}),!e.isAnInstance&&this.state.displayBoneWeights&&e.skeleton&&(0,s.jsx)(qo,{label:"Target Bone Name",options:g,target:e.reservedDataStore,propertyName:"displayBoneIndex",noDirectUpdate:!0,onSelect:e=>{this.onBoneDisplayIndexChange(e),this.forceUpdate()}}),!e.isAnInstance&&this.state.displayBoneWeights&&e.skeleton&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Target Bone",decimalCount:0,target:e.reservedDataStore,propertyName:"displayBoneIndex",minimum:0,maximum:g.length-1||0,step:1,onChange:e=>{this.onBoneDisplayIndexChange(e),this.forceUpdate()}}),!e.isAnInstance&&e.skeleton&&(0,s.jsx)(so,{label:"Display SkeletonMap",isSelected:()=>p,onSelect:()=>this.displaySkeletonMap()})]})]})}}class ni extends r.Component{constructor(e){super(e)}render(){const e=this.props.transformNode;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ps,{globalState:this.props.globalState,target:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"ID",value:e.id}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Unique ID",value:e.uniqueId.toString()}),(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),(0,s.jsx)(so,{label:"IsEnabled",isSelected:()=>e.isEnabled(),onSelect:t=>e.setEnabled(t)}),(0,s.jsx)(Va,{globalState:this.props.globalState,node:e,lockObject:this.props.lockObject}),(0,s.jsx)(_n,{label:"Dispose",onClick:()=>{e.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(null)}})]}),(0,s.jsx)(ei,{host:e,lockObject:this.props.lockObject,globalState:this.props.globalState}),(0,s.jsx)(ti,{host:e,lockObject:this.props.lockObject,globalState:this.props.globalState}),(0,s.jsxs)(In,{title:"TRANSFORMATIONS",selection:this.props.globalState,children:[(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Position",target:e,propertyName:"position",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),!e.rotationQuaternion&&(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Rotation",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"rotation",step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.rotationQuaternion&&(0,s.jsx)(as,{lockObject:this.props.lockObject,label:"Rotation",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"rotationQuaternion",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Scaling",target:e,propertyName:"scaling",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsx)(na,{globalState:this.props.globalState,animatable:e,scene:e.getScene(),lockObject:this.props.lockObject})]})}}class oi extends r.Component{constructor(e){super(e),this._onDebugSelectionChangeObservable=new o.Observable}renderTextures(){const e=this.props.material,t=this._onDebugSelectionChangeObservable;return(0,s.jsxs)(In,{title:"TEXTURES",selection:this.props.globalState,children:[(0,s.jsx)(ia,{label:"Diffuse",texture:e.diffuseTexture,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),(0,s.jsx)(ia,{label:"Reflection",texture:e.reflectionTexture,material:e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t}),e.reflectionTexture&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Reflection blur",target:e,propertyName:"reflectionBlur",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}render(){const e=this.props.material;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(sa,{globalState:this.props.globalState,lockObject:this.props.lockObject,material:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"LIGHTING & COLORS",selection:this.props.globalState,children:[(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Primary",target:e,propertyName:"primaryColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Shadow level",target:e,propertyName:"primaryColorShadowLevel",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Highlight level",target:e,propertyName:"primaryColorHighlightLevel",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),this.renderTextures(),(0,s.jsxs)(In,{title:"RENDERING",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enable noise",target:e,propertyName:"enableNoise",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Opacity fresnel",target:e,propertyName:"opacityFresnel",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Reflection fresnel",target:e,propertyName:"reflectionFresnel",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Reflection amount",target:e,propertyName:"reflectionAmount",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class si extends r.Component{constructor(e){super(e)}renderGridInformation(e){if(!e.parent)return null;const t=e.parent;if(void 0===t.rowCount)return null;const r=t.getChildCellInfo(e);if(void 0===r)return null;const n=r.split(":");return(0,s.jsxs)(In,{title:"GRID",children:[(0,s.jsx)(Pn,{label:"Row",value:n[0]}),(0,s.jsx)(Pn,{label:"Column",value:n[1]})]})}render(){let e;if(this.props.controls)e=this.props.controls;else{if(!this.props.control)return;e=[this.props.control]}const t=e[0],r=[{label:"Left",value:da.Control.HORIZONTAL_ALIGNMENT_LEFT},{label:"Right",value:da.Control.HORIZONTAL_ALIGNMENT_RIGHT},{label:"Center",value:da.Control.HORIZONTAL_ALIGNMENT_CENTER}],n=[{label:"Top",value:da.Control.VERTICAL_ALIGNMENT_TOP},{label:"Bottom",value:da.Control.VERTICAL_ALIGNMENT_BOTTOM},{label:"Center",value:da.Control.VERTICAL_ALIGNMENT_CENTER}];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(In,{title:"GENERAL",children:[(0,s.jsx)(Pn,{label:"Class",value:t.getClassName()}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:no(e,this.props.onPropertyChangedObservable),propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Unique ID",value:t.uniqueId.toString()}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Alpha",target:no(e,this.props.onPropertyChangedObservable),propertyName:"alpha",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),void 0!==t.color&&(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Color",target:no(e,this.props.onPropertyChangedObservable),propertyName:"color",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),void 0!==t.background&&(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Background",target:no(e,this.props.onPropertyChangedObservable),propertyName:"background",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"ZIndex",target:no(e,this.props.onPropertyChangedObservable),propertyName:"zIndex",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),this.renderGridInformation(t),(0,s.jsxs)(In,{title:"ALIGNMENT",children:[(0,s.jsx)(qo,{label:"Horizontal",options:r,target:no(e,this.props.onPropertyChangedObservable),propertyName:"horizontalAlignment",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Vertical",options:n,target:no(e,this.props.onPropertyChangedObservable),propertyName:"verticalAlignment",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"POSITION",children:[(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Left",target:no(e,this.props.onPropertyChangedObservable),propertyName:"left",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Top",target:no(e,this.props.onPropertyChangedObservable),propertyName:"top",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Width",target:no(e,this.props.onPropertyChangedObservable),propertyName:"width",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Height",target:no(e,this.props.onPropertyChangedObservable),propertyName:"height",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Padding left",target:no(e,this.props.onPropertyChangedObservable),propertyName:"paddingLeft",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Padding top",target:no(e,this.props.onPropertyChangedObservable),propertyName:"paddingTop",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Padding right",target:no(e,this.props.onPropertyChangedObservable),propertyName:"paddingRight",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Padding bottom",target:no(e,this.props.onPropertyChangedObservable),propertyName:"paddingBottom",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"TRANSFORMATION",closed:!0,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"ScaleX",target:no(e,this.props.onPropertyChangedObservable),propertyName:"scaleX",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"ScaleY",target:no(e,this.props.onPropertyChangedObservable),propertyName:"scaleY",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Rotation",target:no(e,this.props.onPropertyChangedObservable),propertyName:"rotation",minimum:0,maximum:2*Math.PI,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Transform center X",target:no(e,this.props.onPropertyChangedObservable),propertyName:"transformCenterX",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Transform center Y",target:no(e,this.props.onPropertyChangedObservable),propertyName:"transformCenterY",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"FONT",closed:!0,children:[(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Family",target:no(e,this.props.onPropertyChangedObservable),propertyName:"fontFamily",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Size",target:no(e,this.props.onPropertyChangedObservable),propertyName:"fontSize",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Weight",target:no(e,this.props.onPropertyChangedObservable),propertyName:"fontWeight",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Style",target:no(e,this.props.onPropertyChangedObservable),propertyName:"fontStyle",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"SHADOWS",closed:!0,children:[(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Color",target:no(e,this.props.onPropertyChangedObservable),propertyName:"shadowColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Offset X",target:no(e,this.props.onPropertyChangedObservable),propertyName:"shadowOffsetX",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Offset Y",target:no(e,this.props.onPropertyChangedObservable),propertyName:"shadowOffsetY",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Blur",target:no(e,this.props.onPropertyChangedObservable),propertyName:"shadowBlur",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class ai extends r.Component{constructor(e){super(e)}render(){const e=this.props.control;return(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}}class ii extends r.Component{constructor(e){super(e)}render(){const e=this.props.textBlock,t=[{label:"Left",value:da.Control.HORIZONTAL_ALIGNMENT_LEFT},{label:"Right",value:da.Control.HORIZONTAL_ALIGNMENT_RIGHT},{label:"Center",value:da.Control.HORIZONTAL_ALIGNMENT_CENTER}],r=[{label:"Top",value:da.Control.VERTICAL_ALIGNMENT_TOP},{label:"Bottom",value:da.Control.VERTICAL_ALIGNMENT_BOTTOM},{label:"Center",value:da.Control.VERTICAL_ALIGNMENT_CENTER}],n=[{label:"Clip",value:da.TextWrapping.Clip},{label:"Ellipsis",value:da.TextWrapping.Ellipsis},{label:"Word wrap",value:da.TextWrapping.WordWrap},{label:"Word wrap ellipsis",value:da.TextWrapping.WordWrapEllipsis}];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"TEXTBLOCK",children:[(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Text",target:e,propertyName:"text",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Horizontal text alignment",options:t,target:e,propertyName:"textHorizontalAlignment",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Vertical text alignment",options:r,target:e,propertyName:"textVerticalAlignment",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Resize to fit",target:e,propertyName:"resizeToFit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Wrapping",options:n,target:e,propertyName:"textWrapping",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Line spacing",target:e,propertyName:"lineSpacing",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"OUTLINE",children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Outline width",target:e,propertyName:"outlineWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Outline color",target:e,propertyName:"outlineColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class li extends r.Component{constructor(e){super(e)}render(){const e=this.props.inputText;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"INPUTTEXT",children:[(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Text",target:e,propertyName:"text",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Prompt",target:e,propertyName:"promptMessage",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Max width",target:e,propertyName:"maxWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Highlight color",target:e,propertyName:"textHighlightColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Highligher opacity",minimum:0,maximum:1,step:.01,target:e,propertyName:"highligherOpacity",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"On focus select all",target:e,propertyName:"onFocusSelectAll",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Focused background",target:e,propertyName:"focusedBackground",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Max width",target:e,propertyName:"maxWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Margin",target:e,propertyName:"margin",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Auto stretch width",target:e,propertyName:"autoStretchWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Thickness",target:e,propertyName:"thickness",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Placeholder text",target:e,propertyName:"placeholderText",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Placeholder color",target:e,propertyName:"placeholderColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class pi extends r.Component{constructor(e){super(e)}render(){const e=this.props.colorPicker;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(In,{title:"COLORPICKER",children:(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Color",target:e,propertyName:"value",onPropertyChangedObservable:this.props.onPropertyChangedObservable})})]})}}class ci extends r.Component{constructor(e){super(e);const t=this.props.animationGroup;this.state={playButtonText:t.isPlaying?"Pause":"Play",currentFrame:0},this._timelineRef=r.createRef()}componentDidMount(){this.connect(this.props.animationGroup),this._onBeforeRenderObserver=this.props.scene.onBeforeRenderObservable.add((()=>{this.updateCurrentFrame(this.props.animationGroup)}))}disconnect(e){this._onAnimationGroupPlayObserver&&(e.onAnimationGroupPlayObservable.remove(this._onAnimationGroupPlayObserver),this._onAnimationGroupPlayObserver=null),this._onAnimationGroupPauseObserver&&(e.onAnimationGroupPauseObservable.remove(this._onAnimationGroupPauseObserver),this._onAnimationGroupPauseObserver=null)}connect(e){this._onAnimationGroupPlayObserver=e.onAnimationGroupPlayObservable.add((()=>{this.forceUpdate()})),this._onAnimationGroupPauseObserver=e.onAnimationGroupPauseObservable.add((()=>{this.forceUpdate()})),this.updateCurrentFrame(e)}updateCurrentFrame(e){const t=e.targetedAnimations;if(t.length>0){const e=t[0].animation.runtimeAnimations.find((e=>e.target===t[0].target));e?this.setState({currentFrame:e.currentFrame}):this.setState({currentFrame:0})}}shouldComponentUpdate(e){return this.props.animationGroup!==e.animationGroup&&(this.disconnect(this.props.animationGroup),this.connect(e.animationGroup)),!0}componentWillUnmount(){this.disconnect(this.props.animationGroup),this._onBeforeRenderObserver&&(this.props.scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver),this._onBeforeRenderObserver=null)}playOrPause(){const e=this.props.animationGroup;e.isPlaying?(this.setState({playButtonText:"Play"}),e.pause()):(this.setState({playButtonText:"Pause"}),e.play(!0))}onCurrentFrameChange(e){const t=this.props.animationGroup;t.isPlaying?t.goToFrame(e):(t.play(!0),t.goToFrame(e),t.pause()),this.setState({currentFrame:e})}render(){const e=this.props.animationGroup,t=e.isPlaying?"Pause":"Play";return this._animationCurveEditorContext||(this._animationCurveEditorContext=new ra,this._animationCurveEditorContext.title=e.name||"",this._animationCurveEditorContext.animations=e.targetedAnimations,this._animationCurveEditorContext.scene=this.props.scene,this._animationCurveEditorContext.useTargetAnimations=!0,this._animationCurveEditorContext.rootAnimationGroup=e),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(In,{title:"GENERAL",children:[(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"CONTROLS",children:[(0,s.jsx)(_n,{label:t,onClick:()=>this.playOrPause()}),(0,s.jsx)(_n,{label:"Stop",onClick:()=>this.props.animationGroup.stop()}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Speed ratio",minimum:0,maximum:10,step:.1,target:e,propertyName:"speedRatio",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,ref:this._timelineRef,label:"Current frame",minimum:e.from,maximum:e.to,step:(e.to-e.from)/1e3,directValue:this.state.currentFrame,onInput:e=>this.onCurrentFrameChange(e)}),(0,s.jsx)(so,{label:"Blending",target:e,propertyName:"enableBlending",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Blending speed",minimum:0,maximum:1,step:.01,target:e,propertyName:"blendingSpeed",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Is additive",target:e,propertyName:"isAdditive",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Weight",target:e,propertyName:"weight",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Play order",target:e,propertyName:"playOrder",isInteger:!0,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"INFOS",children:[(0,s.jsx)(Pn,{label:"Animation count",value:e.targetedAnimations.length.toString()}),(0,s.jsx)(ta,{globalState:this.props.globalState,context:this._animationCurveEditorContext}),(0,s.jsx)(Pn,{label:"From",value:e.from.toFixed(2)}),(0,s.jsx)(Pn,{label:"To",value:e.to.toFixed(2)}),(0,s.jsx)(Pn,{label:"Unique ID",value:e.uniqueId.toString()})]})]})}}class di extends r.Component{constructor(e){super(e)}render(){const e=this.props.image,t=[{label:"None",value:da.Image.STRETCH_NONE},{label:"Fill",value:da.Image.STRETCH_FILL},{label:"Uniform",value:da.Image.STRETCH_UNIFORM},{label:"Extend",value:da.Image.STRETCH_EXTEND},{label:"NinePatch",value:da.Image.STRETCH_NINE_PATCH}];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"IMAGE",children:[(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Source",target:e,propertyName:"source",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Source left",target:e,propertyName:"sourceLeft",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Source top",target:e,propertyName:"sourceTop",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Source width",target:e,propertyName:"sourceWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Source height",target:e,propertyName:"sourceHeight",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Autoscale",target:e,propertyName:"autoScale",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Stretch",options:t,target:e,propertyName:"stretch",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({mode:e})})]}),(0,s.jsxs)(In,{title:"ANIMATION SHEET",children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Cell Id",isInteger:!0,target:e,propertyName:"cellId",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Cell width",target:e,propertyName:"cellWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Cell height",target:e,propertyName:"cellHeight",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class hi extends r.Component{constructor(e){super(e)}render(){const e=this.props.slider;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"SLIDER",children:[(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Border color",target:e,propertyName:"borderColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Display thumb",target:e,propertyName:"displayThumb",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Thumb circle",target:e,propertyName:"isThumbCircle",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Vertical",target:e,propertyName:"isVertical",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Thumb clamped",target:e,propertyName:"isThumbClamped",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Bar offset",target:e,propertyName:"barOffset",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Thumb width",target:e,propertyName:"thumbWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Minimum",target:e,propertyName:"minimum",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Maximum",target:e,propertyName:"maximum",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Value",target:e,propertyName:"value",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class ui extends r.Component{constructor(e){super(e)}render(){const e=this.props.imageBasedSlider;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"IMAGE BASED SLIDER",children:[(0,s.jsx)(so,{label:"Display thumb",target:e,propertyName:"displayThumb",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Vertical",target:e,propertyName:"isVertical",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Thumb clamped",target:e,propertyName:"isThumbClamped",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Bar offset",target:e,propertyName:"barOffset",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Thumb width",target:e,propertyName:"thumbWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Minimum",target:e,propertyName:"minimum",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Maximum",target:e,propertyName:"maximum",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Value",target:e,propertyName:"value",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class bi extends r.Component{constructor(e){super(e)}render(){const e=this.props.rectangle;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"RECTANGLE",children:[(0,s.jsx)(so,{label:"Clip children",target:e,propertyName:"clipChildren",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Thickness",target:e,propertyName:"thickness",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Corner radius",target:e,propertyName:"cornerRadius",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class gi extends r.Component{constructor(e){super(e)}render(){const e=this.props.ellipse;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"ELLIPSE",children:[(0,s.jsx)(so,{label:"Clip children",target:e,propertyName:"clipChildren",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Thickness",target:e,propertyName:"thickness",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class mi extends r.Component{constructor(e){super(e)}render(){const e=this.props.checkbox;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"CHECKBOX",children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Check size ratio",target:e,propertyName:"checkSizeRatio",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Checked",target:e,propertyName:"isChecked",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class Ai extends r.Component{constructor(e){super(e)}render(){const e=this.props.radioButtons;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,controls:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"RADIO BUTTON",children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Thickness",target:no(e,this.props.onPropertyChangedObservable),propertyName:"thickness",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Check size ratio",target:no(e,this.props.onPropertyChangedObservable),propertyName:"checkSizeRatio",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Group",target:no(e,this.props.onPropertyChangedObservable),propertyName:"group",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Checked",target:no(e,this.props.onPropertyChangedObservable),propertyName:"isChecked",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class Ci extends r.Component{constructor(e){super(e)}onDashChange(e){const t=this.props.line,r=e.split(",");t.dash=[],r.forEach((e=>{const r=parseInt(e);isNaN(r)||t.dash.push(r)}))}render(){const e=this.props.line;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"LINE",children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Line width",target:e,propertyName:"lineWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"X1",target:e,propertyName:"x1",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Y1",target:e,propertyName:"y1",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"X2",target:e,propertyName:"x2",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Y2",target:e,propertyName:"y2",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Dash pattern",target:e,value:e.dash.join(","),onChange:e=>this.onDashChange(e)})]})]})}}class fi extends r.Component{constructor(e){super(e)}render(){const e=this.props.scrollViewer;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(si,{lockObject:this.props.lockObject,control:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"RECTANGLE",children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Thickness",target:e,propertyName:"thickness",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Corner radius",target:e,propertyName:"cornerRadius",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"SCROLLVIEWER",children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Bar size",target:e,propertyName:"barSize",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Bar color",target:e,propertyName:"barColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Bar background",target:e,propertyName:"barBackground",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Wheel precision",target:e,propertyName:"wheelPrecision",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class xi extends r.Component{constructor(e){super(e)}renderRows(){const e=this.props.grid,t=[];for(let r=0;r(0,s.jsx)(Pn,{label:`Row ${r}`,value:t.toString(e.host,2),underline:r===e.rowCount-1},`r${r}`)))}renderColumns(){const e=this.props.grid,t=[];for(let r=0;r(0,s.jsx)(Pn,{label:`Column ${r}`,value:t.toString(e.host,2)},`c${r}`)))}render(){const e=this.props.grid,t=[];for(let r=0;r{e.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(null)}})]})]})}}class Si extends r.Component{constructor(e){super(e)}edit(){this.props.postProcess.nodeMaterialSource.edit()}render(){const e=this.props.postProcess;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Oi,{globalState:this.props.globalState,lockObject:this.props.lockObject,postProcess:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.nodeMaterialSource&&(0,s.jsx)(In,{title:"CONFIGURATION",selection:this.props.globalState,children:(0,s.jsx)(_n,{label:"Node Material Editor",onClick:()=>this.edit()})})]})}}class wi extends r.Component{constructor(e){super(e)}render(){const e=this.props.renderPipeline,t=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)(ps,{globalState:this.props.globalState,target:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"Name",value:e.name}),(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),void 0!==t.samples&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Samples",minimum:1,maximum:64,step:1,decimalCount:0,target:e,propertyName:"samples",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class Mi extends r.Component{constructor(e){super(e)}render(){const e=this.props.renderPipeline;return(0,s.jsx)(wi,{globalState:this.props.globalState,lockObject:this.props.lockObject,renderPipeline:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}}class Ni extends r.Component{constructor(e){super(e)}render(){const e=this.props.renderPipeline,t=e.scene.activeCamera,r=[{label:"Standard",value:o.ImageProcessingConfiguration.TONEMAPPING_STANDARD},{label:"ACES",value:o.ImageProcessingConfiguration.TONEMAPPING_ACES}],n=[{label:"Multiply",value:o.ImageProcessingConfiguration.VIGNETTEMODE_MULTIPLY},{label:"Opaque",value:o.ImageProcessingConfiguration.VIGNETTEMODE_OPAQUE}],a=[{label:"Low",value:o.DepthOfFieldEffectBlurLevel.Low},{label:"Medium",value:o.DepthOfFieldEffectBlurLevel.Medium},{label:"High",value:o.DepthOfFieldEffectBlurLevel.High}];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(wi,{globalState:this.props.globalState,lockObject:this.props.lockObject,renderPipeline:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"BLOOM",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e,onValueChanged:()=>this.forceUpdate(),propertyName:"bloomEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.bloomEnabled&&(0,s.jsxs)("div",{children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Threshold",minimum:0,maximum:2,step:.01,target:e,propertyName:"bloomThreshold",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Weight",minimum:0,maximum:1,step:.05,target:e,propertyName:"bloomWeight",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Kernel",minimum:0,maximum:128,step:1,target:e,propertyName:"bloomKernel",onPropertyChangedObservable:this.props.onPropertyChangedObservable,decimalCount:0}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Scale",minimum:0,maximum:1,step:.25,target:e,propertyName:"bloomScale",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]}),(0,s.jsxs)(In,{title:"CHROMATIC ABERRATION",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e,onValueChanged:()=>this.forceUpdate(),propertyName:"chromaticAberrationEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.chromaticAberrationEnabled&&(0,s.jsxs)("div",{children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"aberrationAmount",minimum:0,maximum:128,step:.1,target:e.chromaticAberration,propertyName:"aberrationAmount",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Radial intensity",minimum:0,maximum:1,step:.01,target:e.chromaticAberration,propertyName:"radialIntensity",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(os,{lockObject:this.props.lockObject,label:"Center",target:e.chromaticAberration,propertyName:"centerPosition",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(os,{lockObject:this.props.lockObject,label:"Direction",target:e.chromaticAberration,propertyName:"direction",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]}),(0,s.jsxs)(In,{title:"DEPTH OF FIELD",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e,onValueChanged:()=>this.forceUpdate(),propertyName:"depthOfFieldEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.depthOfFieldEnabled&&(0,s.jsxs)("div",{children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Focal length",minimum:0,maximum:t.maxZ,step:.1,target:e.depthOfField,propertyName:"focalLength",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"fStop",minimum:0,maximum:32,step:.1,target:e.depthOfField,propertyName:"fStop",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Distance",minimum:0,maximum:t.maxZ,step:.1,target:e.depthOfField,propertyName:"focusDistance",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Lens size",minimum:0,maximum:1e3,step:1,target:e.depthOfField,propertyName:"lensSize",onPropertyChangedObservable:this.props.onPropertyChangedObservable,decimalCount:0}),(0,s.jsx)(qo,{label:"Blur level",options:a,target:e,propertyName:"depthOfFieldBlurLevel",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({mode:e})})]})]}),(0,s.jsx)(In,{title:"FXAA",selection:this.props.globalState,children:(0,s.jsx)(so,{label:"Enabled",target:e,propertyName:"fxaaEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable})}),(0,s.jsxs)(In,{title:"GLOW LAYER",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e,propertyName:"glowLayerEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.glowLayerEnabled&&(0,s.jsxs)("div",{children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Blur kernel size",minimum:1,maximum:128,step:1,decimalCount:0,target:e.glowLayer,propertyName:"blurKernelSize",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Intensity",minimum:0,maximum:10,step:.1,target:e.glowLayer,propertyName:"intensity",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]}),(0,s.jsxs)(In,{title:"GRAIN",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e,onValueChanged:()=>this.forceUpdate(),propertyName:"grainEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.grainEnabled&&(0,s.jsxs)("div",{children:[(0,s.jsx)(so,{label:"Animated",target:e.grain,propertyName:"animated",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Intensity",minimum:0,maximum:50,step:.1,target:e.grain,propertyName:"intensity",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]}),(0,s.jsxs)(In,{title:"IMAGE PROCESSING",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e,onValueChanged:()=>this.forceUpdate(),propertyName:"imageProcessingEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.imageProcessing&&(0,s.jsxs)("div",{children:[(0,s.jsx)(_n,{label:"Convert clear color to linear",onClick:()=>e.scene.clearColor=e.scene.clearColor.toLinearSpace(e.scene.getEngine().useExactSrgbConversions)}),(0,s.jsx)(_n,{label:"Convert clear color to gamma",onClick:()=>e.scene.clearColor=e.scene.clearColor.toGammaSpace(e.scene.getEngine().useExactSrgbConversions)}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:4,step:.1,label:"Contrast",target:e.imageProcessing,propertyName:"contrast",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:4,step:.1,label:"Exposure",target:e.imageProcessing,propertyName:"exposure",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Tone mapping",target:e.imageProcessing,propertyName:"toneMappingEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Tone mapping type",options:r,target:e.imageProcessing,propertyName:"toneMappingType",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({mode:e})}),(0,s.jsx)(so,{label:"Vignette",target:e.imageProcessing,propertyName:"vignetteEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:4,step:.1,label:"Vignette weight",target:e.imageProcessing,propertyName:"vignetteWeight",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:1,step:.1,label:"Vignette stretch",target:e.imageProcessing,propertyName:"vignetteStretch",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:Math.PI,step:.1,label:"Vignette FOV",target:e.imageProcessing,propertyName:"vignetteCameraFov",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:1,step:.1,label:"Vignette center X",target:e.imageProcessing,propertyName:"vignetteCenterX",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:1,step:.1,label:"Vignette center Y",target:e.imageProcessing,propertyName:"vignetteCenterY",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Vignette color",target:e.imageProcessing,propertyName:"vignetteColor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Vignette blend mode",options:n,target:e.imageProcessing,propertyName:"vignetteBlendMode",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({mode:e})}),(0,s.jsx)(so,{label:"Dithering",target:e.imageProcessing,propertyName:"ditheringEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,minimum:0,maximum:1,step:.5/255,label:"Dithering intensity",target:e.imageProcessing,propertyName:"ditheringIntensity",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]}),(0,s.jsxs)(In,{title:"SHARPEN",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e,onValueChanged:()=>this.forceUpdate(),propertyName:"sharpenEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.sharpenEnabled&&(0,s.jsxs)("div",{children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Color amount",minimum:0,maximum:1,step:.05,target:e.sharpen,propertyName:"colorAmount",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Edge amount",minimum:0,maximum:5,step:.05,target:e.sharpen,propertyName:"edgeAmount",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})]})}}class ki extends r.Component{constructor(e){super(e)}render(){const e=this.props.renderPipeline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(wi,{globalState:this.props.globalState,lockObject:this.props.lockObject,renderPipeline:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"SSAO",selection:this.props.globalState,children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Strength",minimum:0,maximum:2,step:.05,target:e,propertyName:"totalStrength",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Base",minimum:0,maximum:1,step:.05,target:e,propertyName:"base",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Radius",minimum:1e-4,maximum:.001,step:1e-4,target:e,propertyName:"radius",onPropertyChangedObservable:this.props.onPropertyChangedObservable,decimalCount:4}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Area",minimum:1e-4,maximum:.01,step:1e-4,target:e,propertyName:"area",onPropertyChangedObservable:this.props.onPropertyChangedObservable,decimalCount:4}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Falloff",minimum:0,maximum:1e-5,step:1e-6,target:e,propertyName:"fallOff",onPropertyChangedObservable:this.props.onPropertyChangedObservable,decimalCount:6})]})]})}}class Li extends r.Component{constructor(e){super(e)}render(){const e=this.props.renderPipeline,t=e.scene.activeCamera;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(wi,{globalState:this.props.globalState,lockObject:this.props.lockObject,renderPipeline:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"SSAO",selection:this.props.globalState,children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Strength",minimum:0,maximum:2,step:.05,target:e,propertyName:"totalStrength",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Base",minimum:0,maximum:1,step:.05,target:e,propertyName:"base",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Max Z",minimum:0,maximum:t.maxZ,step:1,target:e,propertyName:"maxZ",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Min Z aspect",minimum:0,maximum:.5,step:.01,target:e,propertyName:"minZAspect",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Radius",minimum:0,maximum:10,step:.05,target:e,propertyName:"radius",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Epsilon",minimum:0,maximum:1,step:.001,target:e,propertyName:"epsilon",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"Denoiser",children:[(0,s.jsx)(so,{label:"Bypass Blur",propertyName:"bypassBlur",onPropertyChangedObservable:this.props.onPropertyChangedObservable,target:e}),(0,s.jsx)(so,{label:"Expensive Blur",propertyName:"expensiveBlur",onPropertyChangedObservable:this.props.onPropertyChangedObservable,target:e}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Samples",minimum:2,maximum:32,step:1,target:e,propertyName:"bilateralSamples",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Soften",minimum:0,maximum:1,step:.01,target:e,propertyName:"bilateralSoften",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Tolerance",minimum:0,maximum:1,step:.01,target:e,propertyName:"bilateralTolerance",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class Ei extends r.Component{constructor(e){super(e)}render(){const e=this.props.renderPipeline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"Name",value:e.name}),(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()})]}),(0,s.jsxs)(In,{title:"SSR",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e,propertyName:"isEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Debug",target:e,propertyName:"debug",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Strength",minimum:0,maximum:5,step:.05,target:e,propertyName:"strength",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Reflection exponent",minimum:0,maximum:5,step:.05,target:e,propertyName:"reflectionSpecularFalloffExponent",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Reflectivity threshold",minimum:0,maximum:1,step:.01,target:e,propertyName:"reflectivityThreshold",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Thickness",minimum:0,maximum:10,step:.01,target:e,propertyName:"thickness",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Step",minimum:1,maximum:50,step:1,target:e,propertyName:"step",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Smooth reflections",target:e,propertyName:"enableSmoothReflections",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Max steps",minimum:1,maximum:3e3,step:10,target:e,propertyName:"maxSteps",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Max distance",minimum:1,maximum:3e3,step:10,target:e,propertyName:"maxDistance",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Roughness factor",minimum:0,maximum:1,step:.01,target:e,propertyName:"roughnessFactor",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Self collision skips",minimum:1,maximum:10,step:1,target:e,propertyName:"selfCollisionNumSkip",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"SSR downsample",minimum:0,maximum:5,step:1,target:e,propertyName:"ssrDownsample",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Clip to frustum",target:e,propertyName:"clipToFrustum",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"Automatic thickness computation",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",target:e,propertyName:"enableAutomaticThicknessComputation",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Force write transparent",target:e,propertyName:"backfaceForceDepthWriteTransparentMeshes",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Downsample",minimum:0,maximum:5,step:1,target:e,propertyName:"backfaceDepthTextureDownsample",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"Blur",selection:this.props.globalState,children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Strength",minimum:0,maximum:.15,step:.001,target:e,propertyName:"blurDispersionStrength",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Downsample",minimum:0,maximum:5,step:1,target:e,propertyName:"blurDownsample",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"Attenuations",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Screen borders",target:e,propertyName:"attenuateScreenBorders",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Distance",target:e,propertyName:"attenuateIntersectionDistance",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Step iterations",target:e,propertyName:"attenuateIntersectionIterations",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Facing camera",target:e,propertyName:"attenuateFacingCamera",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Backface reflections",target:e,propertyName:"attenuateBackfaceReflection",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"Environment",selection:this.props.globalState,children:[(0,s.jsx)(ia,{label:"Cube",texture:e.environmentTexture,propertyName:"environmentTexture",texturedObject:e,fileFormats:".dds",cubeOnly:!0}),(0,s.jsx)(so,{label:"Is probe",target:e,propertyName:"environmentTextureIsProbe",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"Color space",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Input is in gamma space",target:e,propertyName:"inputTextureColorIsInGammaSpace",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Output to gamma space",target:e,propertyName:"generateOutputInGammaSpace",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})]})}}class Pi extends r.Component{constructor(e){super(e),this._skeletonViewersEnabled=!1,this._skeletonViewerDisplayOptions={displayMode:Eo.SkeletonViewer.DISPLAY_LINES,sphereBaseSize:.15,sphereScaleUnit:2,sphereFactor:.865,midStep:.235,midStepFactor:.155},this._skeletonViewers=new Array,this.checkSkeletonViewerState(this.props)}switchSkeletonViewers(){this._skeletonViewersEnabled=!this._skeletonViewersEnabled;const e=this.props.skeleton.getScene();if(this._skeletonViewersEnabled){for(const t of e.meshes)if(t.skeleton===this.props.skeleton){let r=!1;for(let e=0;e0}changeDisplayMode(){if(this._skeletonViewersEnabled)for(let e=0;eEo.SkeletonViewer.DISPLAY_LINES?(0,s.jsxs)(In,{title:"DISPLAY OPTIONS",selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"sphereBaseSize",target:this._skeletonViewerDisplayOptions,propertyName:"sphereBaseSize",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onChange:e=>{this.changeDisplayOptions("sphereBaseSize",e)}}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"sphereScaleUnit",target:this._skeletonViewerDisplayOptions,propertyName:"sphereScaleUnit",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onChange:e=>{this.changeDisplayOptions("sphereScaleUnit",e)}}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"sphereFactor",target:this._skeletonViewerDisplayOptions,propertyName:"sphereFactor",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onChange:e=>{this.changeDisplayOptions("sphereFactor",e)}}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"midStep",target:this._skeletonViewerDisplayOptions,propertyName:"midStep",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onChange:e=>{this.changeDisplayOptions("midStep",e)}}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"midStepFactor",target:this._skeletonViewerDisplayOptions,propertyName:"midStepFactor",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onChange:e=>{this.changeDisplayOptions("midStepFactor",e)}})]}):null,(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ps,{globalState:this.props.globalState,target:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"ID",value:e.id}),(0,s.jsx)(Pn,{label:"Bone count",value:e.bones.length.toString()}),(0,s.jsx)(so,{label:"Use texture to store matrices",target:e,propertyName:"useTextureToStoreBoneMatrices",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(_n,{label:"Return to rest",onClick:()=>e.returnToRest()})]}),(0,s.jsxs)(In,{title:"DEBUG",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Enabled",isSelected:()=>this._skeletonViewersEnabled,onSelect:()=>this.switchSkeletonViewers()}),(0,s.jsx)(qo,{label:"displayMode",options:t,target:this._skeletonViewerDisplayOptions,propertyName:"displayMode",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:()=>this.changeDisplayMode()}),r]}),(0,s.jsx)(na,{globalState:this.props.globalState,animatable:e,scene:e.getScene(),lockObject:this.props.lockObject})]})}}class Ii extends r.Component{constructor(e){super(e)}onTransformNodeLink(){if(!this.props.globalState.onSelectionChangedObservable)return;const e=this.props.bone.getTransformNode();this.props.globalState.onSelectionChangedObservable.notifyObservers(e)}render(){const e=this.props.bone;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"Name",value:e.name}),(0,s.jsx)(Pn,{label:"Index",value:e.getIndex().toString()}),(0,s.jsx)(Pn,{label:"Unique ID",value:e.uniqueId.toString()}),e.getParent()&&(0,s.jsx)(Pn,{label:"Parent",value:e.getParent().name,onLink:()=>this.props.globalState.onSelectionChangedObservable.notifyObservers(e.getParent())}),e.getTransformNode()&&(0,s.jsx)(Pn,{label:"Linked node",value:e.getTransformNode().name,onLink:()=>this.onTransformNodeLink()})]}),(0,s.jsxs)(In,{title:"TRANSFORMATIONS",selection:this.props.globalState,children:[(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Position",target:e,propertyName:"position",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),!e.rotationQuaternion&&(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Rotation",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"rotation",step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.rotationQuaternion&&(0,s.jsx)(as,{lockObject:this.props.lockObject,label:"Rotation",useEuler:this.props.globalState.onlyUseEulers,target:e,propertyName:"rotationQuaternion",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Scaling",target:e,propertyName:"scaling",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class Di extends r.Component{constructor(e){super(e)}displayFrustum(){const e=this.props.light,t=e.getScene().activeCamera,r=e._displayFrustum=!e._displayFrustum;if(e._displayFrustumObservable&&(e.getScene().onAfterRenderObservable.remove(e._displayFrustumObservable),e._displayFrustumDLH.dispose()),r&&t){const r=e._displayFrustumDLH=new o.DirectionalLightFrustumViewer(e,t);e._displayFrustumObservable=e.getScene().onAfterRenderObservable.add((()=>{r.update()}))}}render(){const e=this.props.light,t=(e.getShadowGenerator()||null)instanceof o.CascadedShadowGenerator,r=e._displayFrustum??!1;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Wa,{globalState:this.props.globalState,lockObject:this.props.lockObject,light:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"SETUP",selection:this.props.globalState,children:[(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Diffuse",target:e,propertyName:"diffuse",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Specular",target:e,propertyName:"specular",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Position",target:e,propertyName:"position",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Direction",target:e,propertyName:"direction",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),!t&&(0,s.jsx)(so,{label:"Auto Calc Shadow ZBounds",target:e,propertyName:"autoCalcShadowZBounds",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsx)(Za,{globalState:this.props.globalState,lockObject:this.props.lockObject,light:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(In,{title:"DEBUG",closed:!0,selection:this.props.globalState,children:(0,s.jsx)(so,{label:"Display frustum",isSelected:()=>r,onSelect:()=>this.displayFrustum()})})]})}}class Ti extends r.Component{constructor(e){super(e)}render(){const e=this.props.light;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Wa,{globalState:this.props.globalState,lockObject:this.props.lockObject,light:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"SETUP",selection:this.props.globalState,children:[(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Diffuse",target:e,propertyName:"diffuse",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:"Specular",target:e,propertyName:"specular",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Position",target:e,propertyName:"position",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Direction",target:e,propertyName:"direction",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,useEuler:this.props.globalState.onlyUseEulers,label:"Angle",target:e,propertyName:"angle",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,useEuler:this.props.globalState.onlyUseEulers,label:"Inner angle",target:e,propertyName:"innerAngle",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Exponent",target:e,propertyName:"exponent",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsx)(Za,{globalState:this.props.globalState,lockObject:this.props.lockObject,light:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class _i extends r.Component{constructor(e){super(e)}render(){const e=this.props.renderPipeline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(wi,{globalState:this.props.globalState,lockObject:this.props.lockObject,renderPipeline:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"OPTIONS",selection:this.props.globalState,children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Edge blur",minimum:0,maximum:5,step:.1,target:e,propertyName:"edgeBlur",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Edge distortion",minimum:0,maximum:5,step:.1,target:e,propertyName:"edgeDistortion",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Grain amount",minimum:0,maximum:1,step:.1,target:e,propertyName:"grainAmount",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Chromatic aberration",minimum:0,maximum:5,step:.1,target:e,propertyName:"chromaticAberration",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Darken out of focus",minimum:0,maximum:5,step:.1,target:e,propertyName:"darkenOutOfFocus",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Blur noise",target:e,propertyName:"blurNoise",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"DEPTH OF FIELD",selection:this.props.globalState,children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Aperture",minimum:0,maximum:10,step:.1,target:e,propertyName:"dofAperture",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Distortion",minimum:0,maximum:1e3,step:.1,target:e,propertyName:"dofDistortion",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Pentagon bokeh",target:e,propertyName:"pentagonBokeh",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Highlight gain",minimum:0,maximum:5,step:.1,target:e,propertyName:"highlightsGain",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Highlight threshold",minimum:0,maximum:5,step:.1,target:e,propertyName:"highlightsThreshold",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class zi extends r.Component{constructor(e){super(e),this._localChange=!1,this.state={isExpanded:!1,value:this.getCurrentValue().clone()}}getCurrentValue(){return this.props.value||this.props.target[this.props.propertyName]}shouldComponentUpdate(e,t){const r=e.value||e.target[e.propertyName];return!(r.equals(t.value)&&!this._localChange||(t.value=r.clone(),this._localChange=!1,0))}switchExpandState(){this._localChange=!0,this.setState({isExpanded:!this.state.isExpanded})}raiseOnPropertyChanged(e){this.props.onChange&&this.props.onChange(this.state.value),this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.propertyName||"",value:this.state.value,initialValue:e})}updateVector4(){const e=this.getCurrentValue().clone();this.props.value?this.props.value.copyFrom(this.state.value):this.props.target[this.props.propertyName]=this.state.value,this.setState({value:e}),this.raiseOnPropertyChanged(e)}updateStateX(e){this._localChange=!0,this.state.value.x=e,this.updateVector4()}updateStateY(e){this._localChange=!0,this.state.value.y=e,this.updateVector4()}updateStateZ(e){this._localChange=!0,this.state.value.z=e,this.updateVector4()}updateStateW(e){this._localChange=!0,this.state.value.w=e,this.updateVector4()}render(){const e=this.state.isExpanded?(0,s.jsx)(Ir,{icon:hn}):(0,s.jsx)(Ir,{icon:vn});return(0,s.jsxs)("div",{className:"vector3Line",children:[(0,s.jsxs)("div",{className:"firstLine",children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,className:"icon"}),(0,s.jsx)("div",{className:"label",title:this.props.label,children:this.props.label}),(0,s.jsx)("div",{className:"vector",children:`X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}, W: ${this.state.value.w.toFixed(2)}`}),(0,s.jsx)("div",{className:"expand hoverIcon",onClick:()=>this.switchExpandState(),title:"Expand",children:e})]}),(0,s.jsxs)("div",{className:"secondLine",children:[(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"x",step:this.props.step,value:this.state.value.x,onChange:e=>this.updateStateX(e)}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"y",step:this.props.step,value:this.state.value.y,onChange:e=>this.updateStateY(e)}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"z",step:this.props.step,value:this.state.value.z,onChange:e=>this.updateStateZ(e)}),(0,s.jsx)($o,{lockObject:this.props.lockObject,label:"w",step:this.props.step,value:this.state.value.w,onChange:e=>this.updateStateW(e)})]})]})}}zi.defaultProps={step:.001};class Ri extends r.Component{constructor(e){super(e),this.state={gradient:e.step.step}}updateColor(e){this.props.step.color=o.Color3.FromHexString(e),this.props.onUpdateStep(),this.forceUpdate()}updateStep(e){this.props.step.step=e,this.setState({gradient:e}),this.props.onUpdateStep()}onPointerUp(){this.props.onCheckForReOrder()}render(){const e=this.props.step;return(0,s.jsxs)("div",{className:"gradient-step",children:[(0,s.jsx)("div",{className:"step",children:`#${this.props.lineIndex}`}),(0,s.jsx)("div",{className:"color",children:(0,s.jsx)(to,{lockObject:this.props.lockObject,value:e.color,onColorChanged:e=>{this.updateColor(e)}})}),(0,s.jsx)("div",{className:"step-value",children:e.step.toFixed(2)}),(0,s.jsx)("div",{className:"step-slider slider",children:(0,s.jsx)("input",{className:"range",type:"range",step:.01,min:0,max:1,value:e.step,onPointerUp:()=>this.onPointerUp(),onChange:e=>this.updateStep(parseFloat(e.target.value))})}),(0,s.jsx)("div",{className:"gradient-copy",onClick:()=>{this.props.onCopy&&this.props.onCopy()},title:"Copy Step",children:(0,s.jsx)("img",{className:"img",src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4NCiAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1OS4xICg4NjE0NCkgLSBodHRwczovL3NrZXRjaC5jb20gLS0+DQogIDx0aXRsZT5pY19mbHVlbnRfY29weV8yNF9yZWd1bGFyPC90aXRsZT4NCiAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogIDxnIGlkPSLwn5SNLVByb2R1Y3QtSWNvbnMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPg0KICAgIDxnIGlkPSJpY19mbHVlbnRfY29weV8yNF9yZWd1bGFyIiBmaWxsPSJ3aGl0ZSIgZmlsbC1ydWxlPSJub256ZXJvIj4NCiAgICAgIDxwYXRoIGQ9Ik01LjUwMjgwMzgxLDQuNjI3MDQwMzggTDUuNSw2Ljc1IEw1LjUsMTcuMjU0MjA4NyBDNS41LDE5LjA0OTEzNDIgNi45NTUwNzQ1NiwyMC41MDQyMDg3IDguNzUsMjAuNTA0MjA4NyBMMTcuMzY2Mjg2OCwyMC41MDQ0NjIyIEMxNy4wNTczMzgsMjEuMzc4MjI0MSAxNi4yMjM5NzUxLDIyLjAwNDIwODcgMTUuMjQ0NDA1NywyMi4wMDQyMDg3IEw4Ljc1LDIyLjAwNDIwODcgQzYuMTI2NjQ3NDQsMjIuMDA0MjA4NyA0LDE5Ljg3NzU2MTMgNCwxNy4yNTQyMDg3IEw0LDYuNzUgQzQsNS43NjkyODg0OCA0LjYyNzQ0NTIzLDQuOTM1MTI0NjQgNS41MDI4MDM4MSw0LjYyNzA0MDM4IFogTTE3Ljc1LDIgQzE4Ljk5MjY0MDcsMiAyMCwzLjAwNzM1OTMxIDIwLDQuMjUgTDIwLDE3LjI1IEMyMCwxOC40OTI2NDA3IDE4Ljk5MjY0MDcsMTkuNSAxNy43NSwxOS41IEw4Ljc1LDE5LjUgQzcuNTA3MzU5MzEsMTkuNSA2LjUsMTguNDkyNjQwNyA2LjUsMTcuMjUgTDYuNSw0LjI1IEM2LjUsMy4wMDczNTkzMSA3LjUwNzM1OTMxLDIgOC43NSwyIEwxNy43NSwyIFogTTE3Ljc1LDMuNSBMOC43NSwzLjUgQzguMzM1Nzg2NDQsMy41IDgsMy44MzU3ODY0NCA4LDQuMjUgTDgsMTcuMjUgQzgsMTcuNjY0MjEzNiA4LjMzNTc4NjQ0LDE4IDguNzUsMTggTDE3Ljc1LDE4IEMxOC4xNjQyMTM2LDE4IDE4LjUsMTcuNjY0MjEzNiAxOC41LDE3LjI1IEwxOC41LDQuMjUgQzE4LjUsMy44MzU3ODY0NCAxOC4xNjQyMTM2LDMuNSAxNy43NSwzLjUgWiIgaWQ9IvCfjqgtQ29sb3IiPjwvcGF0aD4NCiAgICA8L2c+DQogIDwvZz4NCjwvc3ZnPg=="})}),(0,s.jsx)("div",{className:"gradient-delete",onClick:()=>this.props.onDelete(),title:"Delete Step",children:(0,s.jsx)("img",{className:"img",src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4NCiAgPCEtLSBHZW5lcmF0b3I6IFNrZXRjaCA1OS4xICg4NjE0NCkgLSBodHRwczovL3NrZXRjaC5jb20gLS0+DQogIDx0aXRsZT5pY19mbHVlbnRfZGVsZXRlXzI0X3JlZ3VsYXI8L3RpdGxlPg0KICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4NCiAgPGcgaWQ9IvCflI0tUHJvZHVjdC1JY29ucyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgPGcgaWQ9ImljX2ZsdWVudF9kZWxldGVfMjRfcmVndWxhciIgZmlsbD0id2hpdGUiIGZpbGwtcnVsZT0ibm9uemVybyI+DQogICAgICA8cGF0aCBkPSJNMTIsMS43NSBDMTMuNzMzMDMxNSwxLjc1IDE1LjE0OTI0NTksMy4xMDY0NTQ3NyAxNS4yNDQ4NTUyLDQuODE1NTc2MDkgTDE1LjI1LDUgTDIwLjUsNSBDMjAuOTE0MjEzNiw1IDIxLjI1LDUuMzM1Nzg2NDQgMjEuMjUsNS43NSBDMjEuMjUsNi4xMjk2OTU3NyAyMC45Njc4NDYxLDYuNDQzNDkwOTYgMjAuNjAxNzcwNiw2LjQ5MzE1MzM4IEwyMC41LDYuNSBMMTkuNzA0LDYuNSBMMTguNDIzODYyNywxOS41MTkxOTI3IEMxOC4yOTExNjY2LDIwLjg2ODI2OTYgMTcuMTk4NDMwOSwyMS45MDk5OTYxIDE1Ljg2MjYyNDksMjEuOTk0NDY0NSBMMTUuNjg3MDY5OCwyMiBMOC4zMTI5MzAyMiwyMiBDNi45NTczNDMwMiwyMiA1LjgxMzY1MzUyLDIxLjAxNDQ4NTEgNS41OTg4MzEwNiwxOS42OTMzNjI5IEw1LjU3NjEzNzM0LDE5LjUxOTE5MjcgTDQuMjk1LDYuNSBMMy41LDYuNSBDMy4xMjAzMDQyMyw2LjUgMi44MDY1MDkwNCw2LjIxNzg0NjEyIDIuNzU2ODQ2NjIsNS44NTE3NzA1NiBMMi43NSw1Ljc1IEMyLjc1LDUuMzcwMzA0MjMgMy4wMzIxNTM4OCw1LjA1NjUwOTA0IDMuMzk4MjI5NDQsNS4wMDY4NDY2MiBMMy41LDUgTDguNzUsNSBDOC43NSwzLjIwNTA3NDU2IDEwLjIwNTA3NDYsMS43NSAxMiwxLjc1IFogTTE4LjE5Nyw2LjUgTDUuODAyLDYuNSBMNy4wNjg5MzM0NiwxOS4zNzIzNjAzIEM3LjEyNzY3NjM5LDE5Ljk2OTU4MDEgNy42MDAzMzAxOSwyMC40MzQyODkxIDguMTg1ODQ1MDEsMjAuNDkzNTk2IEw4LjMxMjkzMDIyLDIwLjUgTDE1LjY4NzA2OTgsMjAuNSBDMTYuMjg3MTcxNiwyMC41IDE2Ljc5NTkxNiwyMC4wNzUxMDU3IDE2LjkxMjI1MzEsMTkuNDk4MjA4MyBMMTYuOTMxMDY2NSwxOS4zNzIzNjAzIEwxOC4xOTcsNi41IFogTTEzLjc1LDkuMjUgQzE0LjEyOTY5NTgsOS4yNSAxNC40NDM0OTEsOS41MzIxNTM4OCAxNC40OTMxNTM0LDkuODk4MjI5NDQgTDE0LjUsMTAgTDE0LjUsMTcgQzE0LjUsMTcuNDE0MjEzNiAxNC4xNjQyMTM2LDE3Ljc1IDEzLjc1LDE3Ljc1IEMxMy4zNzAzMDQyLDE3Ljc1IDEzLjA1NjUwOSwxNy40Njc4NDYxIDEzLjAwNjg0NjYsMTcuMTAxNzcwNiBMMTMsMTcgTDEzLDEwIEMxMyw5LjU4NTc4NjQ0IDEzLjMzNTc4NjQsOS4yNSAxMy43NSw5LjI1IFogTTEwLjI1LDkuMjUgQzEwLjYyOTY5NTgsOS4yNSAxMC45NDM0OTEsOS41MzIxNTM4OCAxMC45OTMxNTM0LDkuODk4MjI5NDQgTDExLDEwIEwxMSwxNyBDMTEsMTcuNDE0MjEzNiAxMC42NjQyMTM2LDE3Ljc1IDEwLjI1LDE3Ljc1IEM5Ljg3MDMwNDIzLDE3Ljc1IDkuNTU2NTA5MDQsMTcuNDY3ODQ2MSA5LjUwNjg0NjYyLDE3LjEwMTc3MDYgTDkuNSwxNyBMOS41LDEwIEM5LjUsOS41ODU3ODY0NCA5LjgzNTc4NjQ0LDkuMjUgMTAuMjUsOS4yNSBaIE0xMiwzLjI1IEMxMS4wODE4MjY2LDMuMjUgMTAuMzI4ODA3NywzLjk1NzExMDI3IDEwLjI1NTgwMTIsNC44NTY0NzI3OSBMMTAuMjUsNSBMMTMuNzUsNSBDMTMuNzUsNC4wMzM1MDE2OSAxMi45NjY0OTgzLDMuMjUgMTIsMy4yNSBaIiBpZD0i8J+OqC1Db2xvciI+PC9wYXRoPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+"})})]})}}class Bi extends r.Component{constructor(e){super(e),this._gradientBlock=this.props.block}forceRebuild(){this._gradientBlock.colorStepsUpdated(),this.forceUpdate()}deleteStep(e){const t=this._gradientBlock.colorSteps.indexOf(e);t>-1&&(this._gradientBlock.colorSteps.splice(t,1),this.forceRebuild())}copyStep(e){const t=this.props.block,r=new o.GradientBlockColorStep(1,e.color);t.colorSteps.push(r),t.colorStepsUpdated(),this.forceRebuild(),this.forceUpdate()}addNewStep(){const e=new o.GradientBlockColorStep(1,o.Color3.White());this._gradientBlock.colorSteps.push(e),this.forceRebuild()}checkForReOrder(){this._gradientBlock.colorSteps.sort(((e,t)=>e.step-t.step)),this.forceRebuild()}render(){return(0,s.jsxs)("div",{children:[(0,s.jsx)(_n,{label:"Add new step",onClick:()=>this.addNewStep()}),this._gradientBlock.colorSteps.map(((e,t)=>(0,s.jsx)(Ri,{globalState:this.props.globalState,onCheckForReOrder:()=>this.checkForReOrder(),onUpdateStep:()=>this.forceRebuild(),lineIndex:t,step:e,onCopy:()=>this.copyStep(e),onDelete:()=>this.deleteStep(e)},"step-"+t)))]})}}class Ui extends r.Component{constructor(e){super(e),this._onDebugSelectionChangeObservable=new o.Observable}edit(){this.props.material.edit({nodeEditorConfig:{backgroundColor:this.props.material.getScene().clearColor}})}renderTextures(){const e=this.props.material,t=this._onDebugSelectionChangeObservable,r=e.getTextureBlocks();return r&&0!==r.length?(0,s.jsx)(In,{title:"TEXTURES",selection:this.props.globalState,children:r.map(((r,n)=>(0,s.jsx)(ia,{label:r.name,texture:r.texture,material:e,onTextureCreated:e=>r.texture=e,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onDebugSelectionChangeObservable:t},"nodematText"+n)))}):null}renderInputBlock(e){switch(e.type){case o.NodeMaterialBlockConnectionPointTypes.Float:{const t=isNaN(e.min)||isNaN(e.max)||e.min===e.max;return(0,s.jsxs)("div",{children:[e.isBoolean&&(0,s.jsx)(so,{label:e.name,target:e,propertyName:"value",onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.name),!e.isBoolean&&t&&(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:e.name,target:e,propertyName:"value",onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.name),!e.isBoolean&&!t&&(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:e.name,target:e,propertyName:"value",step:(e.max-e.min)/100,minimum:e.min,maximum:e.max,onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.name)]},e.name)}case o.NodeMaterialBlockConnectionPointTypes.Color3:return(0,s.jsx)(ns,{lockObject:this.props.lockObject,label:e.name,target:e,propertyName:"value",onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.name);case o.NodeMaterialBlockConnectionPointTypes.Color4:return(0,s.jsx)(qa,{lockObject:this.props.lockObject,label:e.name,target:e,propertyName:"value",onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.name);case o.NodeMaterialBlockConnectionPointTypes.Vector2:return(0,s.jsx)(os,{lockObject:this.props.lockObject,label:e.name,target:e,propertyName:"value",onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.name);case o.NodeMaterialBlockConnectionPointTypes.Vector3:return(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:e.name,target:e,propertyName:"value",onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.name);case o.NodeMaterialBlockConnectionPointTypes.Vector4:return(0,s.jsx)(zi,{lockObject:this.props.lockObject,label:e.name,target:e,propertyName:"value",onPropertyChangedObservable:this.props.onPropertyChangedObservable},e.name)}return null}renderInputValues(){const e=this.props.material.getInputBlocks().filter((e=>e.visibleInInspector&&e.isUniform&&!e.isSystemValue)).sort(((e,t)=>e.name.localeCompare(t.name))),t=[];e.forEach((e=>{e.groupInInspector&&-1===t.indexOf(e.groupInInspector)&&t.push(e.groupInInspector)})),t.sort();const r=this.props.material.attachedBlocks.filter((e=>e.visibleInInspector&&"GradientBlock"===e.getClassName())).sort(((e,t)=>e.name.localeCompare(t.name))),n=e.length>0?(0,s.jsxs)(In,{title:"INPUTS",selection:this.props.globalState,children:[" ",e.filter((e=>!e.groupInInspector)).map((e=>this.renderInputBlock(e)))]}):null;return(0,s.jsxs)(s.Fragment,{children:[n,t.map(((t,r)=>(0,s.jsx)(In,{title:t.toUpperCase(),selection:this.props.globalState,children:e.filter((e=>e.groupInInspector===t)).map((e=>this.renderInputBlock(e)))},"inputValue"+r))),r.map(((e,t)=>(0,s.jsx)(In,{title:e.name.toUpperCase(),selection:this.props.globalState,children:(0,s.jsx)(Bi,{globalState:this.props.globalState,block:e})},e.name+t)))]})}render(){const e=this.props.material;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(sa,{globalState:this.props.globalState,lockObject:this.props.lockObject,material:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"CONFIGURATION",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Ignore alpha",target:e,propertyName:"ignoreAlpha",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(_n,{label:"Node Material Editor",onClick:()=>this.edit()})]}),this.renderInputValues(),this.renderTextures()]})}}class Gi extends r.Component{constructor(e){super(e)}onMaterialLink(e){this.props.onSelectionChangedObservable&&this.props.onSelectionChangedObservable.notifyObservers(e)}renderChildMaterial(){const e=this.props.material;return(0,s.jsx)(In,{title:"CHILDREN",selection:this.props.globalState,children:e.subMaterials.map(((e,t)=>e?(0,s.jsx)(Pn,{label:"Material #"+t,value:e.name,onLink:()=>this.onMaterialLink(e)},"Material #"+t):null))})}render(){const e=this.props.material;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(sa,{globalState:this.props.globalState,lockObject:this.props.lockObject,material:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),this.renderChildMaterial()]})}}class Fi extends r.Component{constructor(e){super(e)}render(){const e=this.props.emitter;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Direction 1",target:e,propertyName:"direction1",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Direction 2",target:e,propertyName:"direction2",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Min emit box",target:e,propertyName:"minEmitBox",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Max emit box",target:e,propertyName:"maxEmitBox",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class Hi extends r.Component{constructor(e){super(e)}render(){const e=this.props.emitter;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Radius range",target:e,propertyName:"radiusRange",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Height range",target:e,propertyName:"heightRange",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Emit from spawn point only",target:e,propertyName:"emitFromSpawnPointOnly",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Direction randomizer",target:e,propertyName:"directionRandomizer",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class Vi extends r.Component{constructor(e){super(e)}render(){const e=this.props.emitter;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Radius",target:e,propertyName:"radius",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Height",target:e,propertyName:"height",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Radius range",target:e,propertyName:"radiusRange",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Direction randomizer",target:e,propertyName:"directionRandomizer",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class Wi extends r.Component{constructor(e){super(e)}render(){const e=this.props.emitter;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Radius",target:e,propertyName:"radius",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Radius range",target:e,propertyName:"radiusRange",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Direction randomizer",target:e,propertyName:"directionRandomizer",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class Yi extends r.Component{constructor(e){super(e)}render(){const e=this.props.emitter;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Direction 1",target:e,propertyName:"direction1",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Direction 2",target:e,propertyName:"direction2",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class Zi extends r.Component{constructor(e){super(e)}render(){const e=this.props.emitter;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Radius",target:e,propertyName:"radius",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Radius range",target:e,propertyName:"radiusRange",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Direction randomizer",target:e,propertyName:"directionRandomizer",minimum:0,maximum:1,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class Qi extends r.Component{constructor(e){super(e)}render(){const e=this.props.scene.meshes.filter((e=>!!e.name));e.sort(((e,t)=>e.name.localeCompare(t.name)));const t=[{label:"None",value:-1}];return e.sort(((e,t)=>e.name.localeCompare(t.name))),t.push(...e.map(((e,t)=>({label:e.name,value:t})))),(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(qo,{label:this.props.label,options:t,target:this.props.target,propertyName:this.props.property,noDirectUpdate:!0,onSelect:t=>{const r=this.props.target[this.props.property];this.props.target[this.props.property]=-1===t?null:e[t],this.props.onPropertyChangedObservable&&this.props.onPropertyChangedObservable.notifyObservers({object:this.props.target,property:this.props.property,value:this.props.target[this.props.property],initialValue:r}),this.forceUpdate()},extractValue:()=>{if(!this.props.target[this.props.property])return-1;const t=e.indexOf(this.props.target[this.props.property]);return t>-1?t:-1}})})}}class Ji extends r.Component{constructor(e){super(e)}render(){const e=this.props.emitter;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Qi,{globalState:this.props.globalState,label:"Source",scene:this.props.scene,onPropertyChangedObservable:this.props.onPropertyChangedObservable,target:this.props.emitter,property:"mesh"}),!e.useMeshNormalsForDirection&&(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Direction 1",target:e,propertyName:"direction1",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),!e.useMeshNormalsForDirection&&(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Direction 2",target:e,propertyName:"direction2",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use normals for direction",target:e,propertyName:"useMeshNormalsForDirection",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})}}class Ki extends r.Component{constructor(e){super(e),this.state={gradient:e.gradient.gradient,factor1:this.props.gradient.factor1.toString(),factor2:this.props.gradient.factor2?.toString()}}shouldComponentUpdate(e,t){return e.gradient!==this.props.gradient&&(t.gradient=e.gradient.gradient,t.factor1=e.gradient.factor1.toString(),t.factor2=e.gradient.factor2?.toString()),!0}updateFactor1(e){if(/[^0-9.-]/g.test(e))return;const t=parseFloat(e);this.setState({factor1:e}),isNaN(t)||(this.props.gradient.factor1=t,this.props.onUpdateGradient(),this.forceUpdate())}updateFactor2(e){if(/[^0-9.-]/g.test(e))return;const t=parseFloat(e);this.setState({factor2:e}),isNaN(t)||(this.props.gradient.factor2=t,this.props.onUpdateGradient(),this.forceUpdate())}updateGradient(e){this.props.gradient.gradient=e,this.setState({gradient:e}),this.props.onUpdateGradient()}onPointerUp(){this.props.onCheckForReOrder()}lock(){this.props.lockObject&&(this.props.lockObject.lock=!0)}unlock(){this.props.lockObject&&(this.props.lockObject.lock=!1)}render(){const e=this.props.gradient;return(0,s.jsxs)("div",{className:"gradient-step",children:[(0,s.jsx)("div",{className:"step",children:`#${this.props.lineIndex}`}),(0,s.jsx)("div",{className:"factor1",children:(0,s.jsx)("input",{type:"number",step:"0.01",className:"numeric-input",value:this.state.factor1,onBlur:()=>this.unlock(),onFocus:()=>this.lock(),onChange:e=>this.updateFactor1(e.target.value)})}),this.props.host instanceof o.ParticleSystem&&(0,s.jsx)("div",{className:"factor2",children:(0,s.jsx)("input",{type:"number",step:"0.01",className:"numeric-input"+(this.state.factor1===this.state.factor2||void 0===e.factor2?" grayed":""),value:this.state.factor2,onBlur:()=>this.unlock(),onFocus:()=>this.lock(),onChange:e=>this.updateFactor2(e.target.value)})}),(0,s.jsx)("div",{className:"step-value",children:e.gradient.toFixed(2)}),(0,s.jsx)("div",{className:"step-slider",children:(0,s.jsx)("input",{className:"range",type:"range",step:.01,min:0,max:1,value:e.gradient,onPointerUp:()=>this.onPointerUp(),onChange:e=>this.updateGradient(parseFloat(e.target.value))})}),(0,s.jsx)("div",{className:"gradient-delete hoverIcon",onClick:()=>this.props.onDelete(),children:(0,s.jsx)(Ir,{icon:an})})]})}}class Xi extends r.Component{constructor(e){super(e),this.state={gradient:e.gradient.gradient}}updateColor1(e){this.props.gradient instanceof o.ColorGradient?this.props.gradient.color1=o.Color4.FromHexString(e):this.props.gradient.color=o.Color3.FromHexString(e),this.props.onUpdateGradient(),this.forceUpdate()}updateColor2(e){this.props.gradient instanceof o.ColorGradient&&(this.props.gradient.color2=o.Color4.FromHexString(e)),this.props.onUpdateGradient(),this.forceUpdate()}updateGradient(e){this.props.gradient.gradient=e,this.setState({gradient:e}),this.props.onUpdateGradient()}onPointerUp(){this.props.onCheckForReOrder()}lock(){this.props.lockObject&&(this.props.lockObject.lock=!0)}unlock(){this.props.lockObject&&(this.props.lockObject.lock=!1)}render(){const e=this.props.gradient;return(0,s.jsxs)("div",{className:"gradient-step",children:[(0,s.jsx)("div",{className:"step",children:`#${this.props.lineIndex}`}),(0,s.jsx)("div",{className:"color1",children:(0,s.jsx)(to,{lockObject:this.props.lockObject,value:e instanceof o.Color3Gradient?e.color:e.color1,onColorChanged:e=>{this.updateColor1(e)}})}),this.props.host instanceof o.ParticleSystem&&e instanceof o.ColorGradient&&(0,s.jsx)("div",{className:"color2",children:(0,s.jsx)(to,{lockObject:this.props.lockObject,value:e.color2?e.color2:new o.Color4,onColorChanged:e=>{this.updateColor2(e)}})}),(0,s.jsx)("div",{className:"step-value",children:e.gradient.toFixed(2)}),(0,s.jsx)("div",{className:"step-slider",children:(0,s.jsx)("input",{className:"range",type:"range",step:.01,min:0,max:1,value:e.gradient,onPointerUp:()=>this.onPointerUp(),onChange:e=>this.updateGradient(parseFloat(e.target.value))})}),(0,s.jsx)("div",{className:"gradient-delete hoverIcon",onClick:()=>this.props.onDelete(),children:(0,s.jsx)(Ir,{icon:an})})]})}}class qi extends r.Component{constructor(e){super(e)}onLink(){this.props.url&&window.open(this.props.url,"_blank")}render(){return(0,s.jsxs)("div",{className:"linkButtonLine",children:[(0,s.jsx)("div",{className:"link",title:this.props.label,onClick:()=>this.onLink(),children:this.props.label}),(0,s.jsx)("div",{className:"link-button",children:(0,s.jsx)("button",{onClick:()=>this.props.onClick(),children:this.props.buttonLabel})}),this.props.icon&&(0,s.jsx)("div",{className:"link-icon hoverIcon",onClick:()=>{this.props.onIconClick&&this.props.onIconClick()},children:(0,s.jsx)(Ir,{icon:this.props.icon})})]})}}var $i;!function(e){e[e.Factor=0]="Factor",e[e.Color3=1]="Color3",e[e.Color4=2]="Color4"}($i||($i={}));class el extends r.Component{constructor(e){super(e)}deleteStep(e){const t=this.props.gradients,r=t.indexOf(e);r>-1&&(t.splice(r,1),this.updateAndSync())}addNewStep(){const e=this.props.gradients;switch(this.props.mode){case $i.Factor:{const t=new o.FactorGradient(1,1,1);e.push(t);break}case $i.Color4:{const t=new o.ColorGradient(1,new o.Color4(1,1,1,1),new o.Color4(1,1,1,1));e.push(t);break}case $i.Color3:{const t=new o.Color3Gradient(1,o.Color3.White());e.push(t);break}}this.props.host.forceRefreshGradients(),this.forceUpdate()}checkForReOrder(){this.props.gradients.sort(((e,t)=>e.gradient===t.gradient?0:e.gradient>t.gradient?1:-1)),this.forceUpdate()}updateAndSync(){this.props.host.forceRefreshGradients(),this.forceUpdate()}render(){const e=this.props.gradients;return(0,s.jsxs)("div",{children:[e&&e.length>0&&(0,s.jsxs)("div",{className:"gradient-container",children:[(0,s.jsx)(qi,{label:this.props.label,url:this.props.docLink,icon:an,onIconClick:()=>{e.length=0,this.updateAndSync()},buttonLabel:"Add new step",onClick:()=>this.addNewStep()}),e.map(((e,t)=>{const r=this.props.codeRecorderPropertyName+`[${t}]`;switch(this.props.mode){case $i.Factor:return(0,s.jsx)(Ki,{globalState:this.props.globalState,lockObject:this.props.lockObject,onCheckForReOrder:()=>this.checkForReOrder(),onUpdateGradient:()=>this.updateAndSync(),host:this.props.host,codeRecorderPropertyName:r,lineIndex:t,gradient:e,onDelete:()=>this.deleteStep(e)},"step-"+t);case $i.Color4:return(0,s.jsx)(Xi,{globalState:this.props.globalState,host:this.props.host,codeRecorderPropertyName:r,lockObject:this.props.lockObject,isColor3:!1,onCheckForReOrder:()=>this.checkForReOrder(),onUpdateGradient:()=>this.updateAndSync(),lineIndex:t,gradient:e,onDelete:()=>this.deleteStep(e)},"step-"+t);case $i.Color3:return(0,s.jsx)(Xi,{globalState:this.props.globalState,host:this.props.host,codeRecorderPropertyName:r,lockObject:this.props.lockObject,isColor3:!0,onCheckForReOrder:()=>this.checkForReOrder(),onUpdateGradient:()=>this.updateAndSync(),lineIndex:t,gradient:e,onDelete:()=>this.deleteStep(e)},"step-"+t)}}))]}),(!e||0===e.length)&&(0,s.jsx)(_n,{label:"Use "+this.props.label,onClick:()=>{this.props.onCreateRequired(),this.forceUpdate()}})]})}}class tl extends r.Component{constructor(e){super(e),this._snippetUrl=o.Constants.SnippetUrl}renderEmitter(){const e=this.props.system;switch(e.particleEmitterType?.getClassName()){case"BoxParticleEmitter":return(0,s.jsx)(Fi,{lockObject:this.props.lockObject,globalState:this.props.globalState,emitter:e.particleEmitterType,onPropertyChangedObservable:this.props.onPropertyChangedObservable});case"ConeParticleEmitter":return(0,s.jsx)(Hi,{lockObject:this.props.lockObject,globalState:this.props.globalState,emitter:e.particleEmitterType,onPropertyChangedObservable:this.props.onPropertyChangedObservable});case"CylinderParticleEmitter":return(0,s.jsx)(Vi,{lockObject:this.props.lockObject,globalState:this.props.globalState,emitter:e.particleEmitterType,onPropertyChangedObservable:this.props.onPropertyChangedObservable});case"HemisphericParticleEmitter":return(0,s.jsx)(Wi,{lockObject:this.props.lockObject,globalState:this.props.globalState,emitter:e.particleEmitterType,onPropertyChangedObservable:this.props.onPropertyChangedObservable});case"MeshParticleEmitter":return(0,s.jsx)(Ji,{lockObject:this.props.lockObject,scene:e.getScene(),globalState:this.props.globalState,emitter:e.particleEmitterType,onPropertyChangedObservable:this.props.onPropertyChangedObservable});case"PointParticleEmitter":return(0,s.jsx)(Yi,{lockObject:this.props.lockObject,globalState:this.props.globalState,emitter:e.particleEmitterType,onPropertyChangedObservable:this.props.onPropertyChangedObservable});case"SphereParticleEmitter":return(0,s.jsx)(Zi,{lockObject:this.props.lockObject,globalState:this.props.globalState,emitter:e.particleEmitterType,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}return null}raiseOnPropertyChanged(e,t,r){if(!this.props.onPropertyChangedObservable)return;const n=this.props.system;this.props.onPropertyChangedObservable.notifyObservers({object:n,property:e,value:t,initialValue:r})}renderControls(){const e=this.props.system;if(e instanceof o.GPUParticleSystem){const t=e.isStarted()&&!e.isStopped();return(0,s.jsx)(_n,{label:t?"Stop":"Start",onClick:()=>{t?(e.stop(),e.reset()):e.start(),this.forceUpdate()}})}const t=e.isStarted();return(0,s.jsxs)(s.Fragment,{children:[!e.isStopping()&&(0,s.jsx)(_n,{label:t?"Stop":"Start",onClick:()=>{t?e.stop():e.start(),this.forceUpdate()}}),e.isStopping()&&(0,s.jsx)(Pn,{label:"System is stoppping...",ignoreValue:!0})]})}saveToFile(){const e=this.props.system,t=JSON.stringify(e.serialize(!0));o.Tools.Download(new Blob([t]),"particleSystem.json")}loadFromFile(e){const t=this.props.system,r=t.getScene();r&&o.Tools.ReadFile(e,(e=>{const n=new TextDecoder("utf-8"),s=JSON.parse(n.decode(e)),a=t instanceof o.GPUParticleSystem;t.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(null);const i=a?o.GPUParticleSystem.Parse(s,r,""):o.ParticleSystem.Parse(s,r,"");this.props.globalState.onSelectionChangedObservable.notifyObservers(i)}),void 0,!0)}loadFromSnippet(){const e=this.props.system,t=e.getScene(),r=e instanceof o.GPUParticleSystem,n=window.prompt("Please enter the snippet ID to use");n&&t&&(e.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(null),o.ParticleHelper.ParseFromSnippetAsync(n,t,r).then((e=>{this.props.globalState.onSelectionChangedObservable.notifyObservers(e)})).catch((e=>{alert("Unable to load your particle system: "+e)})))}saveToSnippet(){const e=this.props.system,t=JSON.stringify(e.serialize(!0)),r=new XMLHttpRequest;r.onreadystatechange=()=>{if(4==r.readyState)if(200==r.status){const t=JSON.parse(r.responseText),n=e.snippetId||"_BLANK";e.snippetId=t.id,t.version&&"0"!=t.version&&(e.snippetId+="#"+t.version),this.forceUpdate(),navigator.clipboard&&navigator.clipboard.writeText(e.snippetId);const o=window;o.Playground&&n&&o.Playground.onRequestCodeChangeObservable.notifyObservers({regex:new RegExp(`ParticleHelper.ParseFromSnippetAsync\\("${n}`,"g"),replace:`ParticleHelper.ParseFromSnippetAsync("${e.snippetId}`}),alert("Particle system saved with ID: "+e.snippetId+" (please note that the id was also saved to your clipboard)")}else alert("Unable to save your particle system")},r.open("POST",this._snippetUrl+(e.snippetId?"/"+e.snippetId:""),!0),r.setRequestHeader("Content-Type","application/json");const n={payload:JSON.stringify({particleSystem:t}),name:"",description:"",tags:""};r.send(JSON.stringify(n))}render(){const e=this.props.system,t=[{label:"Add",value:o.ParticleSystem.BLENDMODE_ADD},{label:"Multiply",value:o.ParticleSystem.BLENDMODE_MULTIPLY},{label:"Multiply Add",value:o.ParticleSystem.BLENDMODE_MULTIPLYADD},{label:"OneOne",value:o.ParticleSystem.BLENDMODE_ONEONE},{label:"Standard",value:o.ParticleSystem.BLENDMODE_STANDARD}],r=this.props.system.getScene().meshes.filter((e=>!!e.name)),n=[{label:"None",value:-1},{label:"Vector3",value:0}];return r.sort(((e,t)=>e.name.localeCompare(t.name))),n.push(...r.map(((e,t)=>({label:e.name,value:t+1})))),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ps,{globalState:this.props.globalState,target:e,lockObject:this.props.lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"ID",value:e.id}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),(0,s.jsx)(Pn,{label:"Capacity",value:e.getCapacity().toString()}),(0,s.jsx)(Pn,{label:"Active count",value:e.getActiveCount().toString()}),(0,s.jsx)(ia,{label:"Texture",texture:e.particleTexture,onSelectionChangedObservable:this.props.onSelectionChangedObservable}),(0,s.jsx)(qo,{label:"Blend mode",options:t,target:e,propertyName:"blendMode",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"World offset",target:e,propertyName:"worldOffset",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Gravity",target:e,propertyName:"gravity",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Is billboard",target:e,propertyName:"isBillboardBased",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Is local",target:e,propertyName:"isLocal",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Force depth write",target:e,propertyName:"forceDepthWrite",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Update speed",target:e,propertyName:"updateSpeed",minimum:0,maximum:.1,decimalCount:3,step:.001,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"COMMANDS",selection:this.props.globalState,children:[this.renderControls(),(0,s.jsx)(_n,{label:"Dispose",onClick:()=>{this.props.globalState.onSelectionChangedObservable.notifyObservers(null),e.dispose()}})]}),(0,s.jsxs)(In,{title:"FILE",selection:this.props.globalState,children:[(0,s.jsx)(zn,{label:"Load",onClick:e=>this.loadFromFile(e),accept:".json"}),(0,s.jsx)(_n,{label:"Save",onClick:()=>this.saveToFile()})]}),(0,s.jsxs)(In,{title:"SNIPPET",selection:this.props.globalState,children:[e.snippetId&&(0,s.jsx)(Pn,{label:"Snippet ID",value:e.snippetId}),(0,s.jsx)(_n,{label:"Load from snippet server",onClick:()=>this.loadFromSnippet()}),(0,s.jsx)(_n,{label:"Save to snippet server",onClick:()=>this.saveToSnippet()})]}),(0,s.jsxs)(In,{title:"EMITTER",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(qo,{label:"Emitter",options:n,target:e,propertyName:"emitter",noDirectUpdate:!0,onSelect:t=>{const n=t;switch(n){case-1:this.raiseOnPropertyChanged("emitter",null,e.emitter),e.emitter=null;break;case 0:this.raiseOnPropertyChanged("emitter",o.Vector3.Zero(),e.emitter),e.emitter=o.Vector3.Zero();break;default:this.raiseOnPropertyChanged("emitter",r[n-1],e.emitter),e.emitter=r[n-1]}this.forceUpdate()},extractValue:()=>{if(!e.emitter)return-1;if(void 0!==e.emitter.x)return 0;const t=r.indexOf(e.emitter);return t>-1?t+1:-1}}),e.emitter&&void 0===e.emitter.x&&(0,s.jsx)(Pn,{label:"Link to emitter",value:e.emitter.name,onLink:()=>this.props.globalState.onSelectionChangedObservable.notifyObservers(e.emitter)}),e.emitter&&void 0!==e.emitter.x&&(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Position",target:e,propertyName:"emitter",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Type",options:[{label:"Box",value:0},{label:"Cone",value:1},{label:"Cylinder",value:2},{label:"Hemispheric",value:3},{label:"Mesh",value:4},{label:"Point",value:5},{label:"Sphere",value:6}],target:e,propertyName:"particleEmitterType",noDirectUpdate:!0,onSelect:t=>{const r=t,n=e.particleEmitterType;switch(r){case 0:e.particleEmitterType=new o.BoxParticleEmitter;break;case 1:e.particleEmitterType=new o.ConeParticleEmitter;break;case 2:e.particleEmitterType=new o.CylinderParticleEmitter;break;case 3:e.particleEmitterType=new o.HemisphericParticleEmitter;break;case 4:e.particleEmitterType=new o.MeshParticleEmitter;break;case 5:e.particleEmitterType=new o.PointParticleEmitter;break;case 6:e.particleEmitterType=new o.SphereParticleEmitter}this.raiseOnPropertyChanged("particleEmitterType",e.particleEmitterType,n),this.forceUpdate()},extractValue:()=>{switch(e.particleEmitterType?.getClassName()){case"BoxParticleEmitter":return 0;case"ConeParticleEmitter":return 1;case"CylinderParticleEmitter":return 2;case"HemisphericParticleEmitter":return 3;case"MeshParticleEmitter":return 4;case"PointParticleEmitter":return 5;case"SphereParticleEmitter":return 6}return 0}}),this.renderEmitter()]}),(0,s.jsxs)(In,{title:"EMISSION",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Rate",target:e,propertyName:"emitRate",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e instanceof o.ParticleSystem&&(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getEmitRateGradients(),label:"Velocity gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-speed-over-lifetime",onCreateRequired:()=>{e.addEmitRateGradient(0,50,50)},mode:$i.Factor,host:e,codeRecorderPropertyName:"getEmitRateGradients()",lockObject:this.props.lockObject}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Min emit power",target:e,propertyName:"minEmitPower",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Max emit power",target:e,propertyName:"maxEmitPower",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getVelocityGradients(),label:"Velocity gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-speed-over-lifetime",onCreateRequired:()=>{e.addVelocityGradient(0,.1,.1)},mode:$i.Factor,host:e,codeRecorderPropertyName:"getVelocityGradients()",lockObject:this.props.lockObject}),(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getLimitVelocityGradients(),label:"Limit velocity gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#limit-speed-over-lifetime",onCreateRequired:()=>{e.addLimitVelocityGradient(0,.1,.1)},mode:$i.Factor,host:e,codeRecorderPropertyName:"getLimitVelocityGradients()",lockObject:this.props.lockObject}),(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getDragGradients(),label:"Drag gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-drag-over-lifetime",onCreateRequired:()=>{e.addDragGradient(0,.1,.1)},host:e,codeRecorderPropertyName:"getDragGradients()",mode:$i.Factor,lockObject:this.props.lockObject})]}),(0,s.jsxs)(In,{title:"SIZE",closed:!0,selection:this.props.globalState,children:[(!e.getSizeGradients()||0===e.getSizeGradients()?.length)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Min size",target:e,propertyName:"minSize",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Max size",target:e,propertyName:"maxSize",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Min scale X",target:e,propertyName:"minScaleX",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Max scale X",target:e,propertyName:"maxScaleX",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Min scale Y",target:e,propertyName:"minScaleY",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Max scale Y",target:e,propertyName:"maxScaleY",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e instanceof o.ParticleSystem&&(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getStartSizeGradients(),label:"Start size gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-size-over-lifetime",onCreateRequired:()=>{e.addStartSizeGradient(0,1,1)},host:e,codeRecorderPropertyName:"getStartSizeGradients()",mode:$i.Factor,lockObject:this.props.lockObject}),(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getSizeGradients(),label:"Size gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-size-over-lifetime",onCreateRequired:()=>{e.addSizeGradient(0,1,1)},host:e,codeRecorderPropertyName:"getSizeGradients()",mode:$i.Factor,lockObject:this.props.lockObject})]}),(0,s.jsxs)(In,{title:"LIFETIME",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Min lifetime",target:e,propertyName:"minLifeTime",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Max lifetime",target:e,propertyName:"maxLifeTime",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Target stop duration",target:e,propertyName:"targetStopDuration",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e instanceof o.ParticleSystem&&(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getLifeTimeGradients(),label:"Lifetime gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-lifetime-over-duration",onCreateRequired:()=>{e.addLifeTimeGradient(0,1,1)},host:e,codeRecorderPropertyName:"getLifeTimeGradients()",mode:$i.Factor,lockObject:this.props.lockObject})]}),(0,s.jsxs)(In,{title:"COLORS",closed:!0,selection:this.props.globalState,children:[(!e.getColorGradients()||0===e.getColorGradients()?.length)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(qa,{lockObject:this.props.lockObject,label:"Color 1",target:e,propertyName:"color1",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qa,{lockObject:this.props.lockObject,label:"Color 2",target:e,propertyName:"color2",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qa,{lockObject:this.props.lockObject,label:"Color dead",target:e,propertyName:"colorDead",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getColorGradients(),label:"Color gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-color-over-lifetime",onCreateRequired:()=>{e.addColorGradient(0,new o.Color4(0,0,0,1),new o.Color4(0,0,0,1)),e.addColorGradient(1,new o.Color4(1,1,1,1),new o.Color4(1,1,1,1))},host:e,codeRecorderPropertyName:"getColorGradients()",mode:$i.Color4,lockObject:this.props.lockObject}),e instanceof o.ParticleSystem&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(so,{label:"Enable ramp grandients",target:e,propertyName:"useRampGradients"}),e.useRampGradients&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getRampGradients(),label:"Ramp gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/ramps_and_blends#ramp-gradients",onCreateRequired:()=>{e.addRampGradient(0,o.Color3.White()),e.addRampGradient(1,o.Color3.Black())},mode:$i.Color3,host:e,codeRecorderPropertyName:"getRampGradients()",lockObject:this.props.lockObject}),(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getColorRemapGradients(),label:"Color remap gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/ramps_and_blends#ramp-gradients",onCreateRequired:()=>{e.addColorRemapGradient(0,1,1)},host:e,codeRecorderPropertyName:"getColorRemapGradients()",mode:$i.Factor,lockObject:this.props.lockObject}),(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getAlphaRemapGradients(),label:"Alpha remap gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/ramps_and_blends#ramp-gradients",onCreateRequired:()=>{e.addAlphaRemapGradient(0,1,1)},host:e,codeRecorderPropertyName:"getAlphaRemapGradients()",mode:$i.Factor,lockObject:this.props.lockObject})]})]})]}),(0,s.jsxs)(In,{title:"ROTATION",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Min angular speed",target:e,propertyName:"minAngularSpeed",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Max angular speed",target:e,propertyName:"maxAngularSpeed",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Min initial rotation",target:e,propertyName:"minInitialRotation",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Max initial rotation",target:e,propertyName:"maxInitialRotation",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(el,{globalState:this.props.globalState,gradients:e.getAngularSpeedGradients(),label:"Angular speed gradients",docLink:"https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/tuning_gradients#change-rotation-speed-over-lifetime",onCreateRequired:()=>{e.addAngularSpeedGradient(0,.1,.1)},host:e,codeRecorderPropertyName:"getAngularSpeedGradients()",mode:$i.Factor,lockObject:this.props.lockObject})]}),(0,s.jsxs)(In,{title:"SPRITESHEET",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Animation sheet enabled",target:e,propertyName:"isAnimationSheetEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"First sprite index",isInteger:!0,target:e,propertyName:"startSpriteCellID",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Last sprite index",isInteger:!0,target:e,propertyName:"endSpriteCellID",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Animation Loop",target:e,propertyName:"spriteCellLoop",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Random start cell index",target:e,propertyName:"spriteRandomStartCell",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Cell width",isInteger:!0,target:e,propertyName:"spriteCellWidth",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Cell height",isInteger:!0,target:e,propertyName:"spriteCellHeight",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Cell change speed",target:e,propertyName:"spriteCellChangeSpeed",minimum:0,maximum:10,step:.1,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class rl extends r.Component{constructor(e){super(e),this._snippetUrl=o.Constants.SnippetUrl}addNewSprite(){const e=this.props.spriteManager,t=new o.Sprite("new sprite",e);this.props.onSelectionChangedObservable?.notifyObservers(t)}disposeManager(){this.props.spriteManager.dispose(),this.props.onSelectionChangedObservable?.notifyObservers(null)}saveToFile(){const e=this.props.spriteManager,t=JSON.stringify(e.serialize(!0));o.Tools.Download(new Blob([t]),"spriteManager.json")}loadFromFile(e){const t=this.props.spriteManager,r=t.scene;o.Tools.ReadFile(e,(e=>{const n=new TextDecoder("utf-8"),s=JSON.parse(n.decode(e));t.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(null);const a=o.SpriteManager.Parse(s,r,"");this.props.globalState.onSelectionChangedObservable.notifyObservers(a)}),void 0,!0)}loadFromSnippet(){const e=this.props.spriteManager,t=e.scene,r=window.prompt("Please enter the snippet ID to use");r&&(e.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(null),o.SpriteManager.ParseFromSnippetAsync(r,t).then((e=>{this.props.globalState.onSelectionChangedObservable.notifyObservers(e)})).catch((e=>{alert("Unable to load your sprite manager: "+e)})))}saveToSnippet(){const e=this.props.spriteManager,t=JSON.stringify(e.serialize(!0)),r=new XMLHttpRequest;r.onreadystatechange=()=>{if(4==r.readyState)if(200==r.status){const t=JSON.parse(r.responseText),n=e.snippetId||"_BLANK";e.snippetId=t.id,t.version&&"0"!=t.version&&(e.snippetId+="#"+t.version),this.forceUpdate(),navigator.clipboard&&navigator.clipboard.writeText(e.snippetId);const o=window;o.Playground&&n&&o.Playground.onRequestCodeChangeObservable.notifyObservers({regex:new RegExp(`SpriteManager.ParseFromSnippetAsync\\("${n}`,"g"),replace:`SpriteManager.ParseFromSnippetAsync("${e.snippetId}`}),alert("Sprite manager saved with ID: "+e.snippetId+" (please note that the id was also saved to your clipboard)")}else alert("Unable to save your sprite manager")},r.open("POST",this._snippetUrl+(e.snippetId?"/"+e.snippetId:""),!0),r.setRequestHeader("Content-Type","application/json");const n={payload:JSON.stringify({spriteManager:t}),name:"",description:"",tags:""};r.send(JSON.stringify(n))}render(){const e=this.props.spriteManager,t=[{label:"Combine",value:o.Constants.ALPHA_COMBINE},{label:"One one",value:o.Constants.ALPHA_ONEONE},{label:"Add",value:o.Constants.ALPHA_ADD},{label:"Subtract",value:o.Constants.ALPHA_SUBTRACT},{label:"Multiply",value:o.Constants.ALPHA_MULTIPLY},{label:"Maximized",value:o.Constants.ALPHA_MAXIMIZED},{label:"Pre-multiplied",value:o.Constants.ALPHA_PREMULTIPLIED}];return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Unique ID",value:e.uniqueId.toString()}),(0,s.jsx)(Pn,{label:"Capacity",value:e.capacity.toString()}),(0,s.jsx)(ia,{label:"Texture",texture:e.texture,onSelectionChangedObservable:this.props.onSelectionChangedObservable}),e.sprites.lengththis.addNewSprite()}),(0,s.jsx)(_n,{label:"Dispose",onClick:()=>this.disposeManager()})]}),(0,s.jsxs)(In,{title:"FILE",selection:this.props.globalState,children:[(0,s.jsx)(zn,{label:"Load",onClick:e=>this.loadFromFile(e),accept:".json"}),(0,s.jsx)(_n,{label:"Save",onClick:()=>this.saveToFile()})]}),(0,s.jsxs)(In,{title:"SNIPPET",selection:this.props.globalState,children:[e.snippetId&&(0,s.jsx)(Pn,{label:"Snippet ID",value:e.snippetId}),(0,s.jsx)(_n,{label:"Load from snippet server",onClick:()=>this.loadFromSnippet()}),(0,s.jsx)(_n,{label:"Save to snippet server",onClick:()=>this.saveToSnippet()})]}),(0,s.jsxs)(In,{title:"PROPERTIES",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Pickable",target:e,propertyName:"isPickable",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Fog enabled",target:e,propertyName:"fogEnabled",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"No depth write",target:e,propertyName:"disableDepthWrite",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Rendering group ID",decimalCount:0,target:e,propertyName:"renderingGroupId",minimum:o.RenderingManager.MIN_RENDERINGGROUPS,maximum:o.RenderingManager.MAX_RENDERINGGROUPS-1,step:1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qo,{label:"Alpha mode",options:t,target:e,propertyName:"blendMode",onPropertyChangedObservable:this.props.onPropertyChangedObservable,onSelect:e=>this.setState({blendMode:e})})]}),(0,s.jsxs)(In,{title:"CELLS",selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Cell width",isInteger:!0,target:e,propertyName:"cellWidth",min:0,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Cell height",isInteger:!0,target:e,propertyName:"cellHeight",min:0,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class nl extends r.Component{constructor(e){super(e),this._imageData=null,this._cachedCellIndex=-1,this._canvasRef=r.createRef()}onManagerLink(){if(!this.props.onSelectionChangedObservable)return;const e=this.props.sprite;this.props.onSelectionChangedObservable.notifyObservers(e.manager)}switchPlayStopState(){const e=this.props.sprite;e.animationStarted?e.stopAnimation():e.playAnimation(e.fromIndex,e.toIndex,e.loopAnimation,e.delay,(()=>{})),this.forceUpdate()}disposeSprite(){this.props.sprite.dispose(),this.props.onSelectionChangedObservable?.notifyObservers(null)}componentDidMount(){this.updatePreview()}componentDidUpdate(){this.updatePreview()}shouldComponentUpdate(e){return e.sprite!==this.props.sprite&&(this._imageData=null),!0}updatePreview(){const e=this.props.sprite,t=e.manager,r=t.texture,n=r.getSize();if(!this._imageData)return void pa.GetTextureDataAsync(r,n.width,n.height,0,{R:!0,G:!0,B:!0,A:!0},this.props.globalState).then((e=>{this._imageData=e,this.forceUpdate()}));if(this._cachedCellIndex===e.cellIndex)return;this._cachedCellIndex=e.cellIndex;const o=this._canvasRef.current;o.width=t.cellWidth,o.height=t.cellHeight;const s=o.getContext("2d");if(s){const r=s.createImageData(t.cellWidth,t.cellHeight),o=r.data,a=n.width/t.cellWidth|0,i=e.cellIndex/a|0,l=4*(e.cellIndex-i*a+i*n.width)*t.cellWidth;for(let e=0;ethis.onManagerLink()}),(0,s.jsx)(so,{label:"Visible",target:e,propertyName:"isVisible",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(_n,{label:"Dispose",onClick:()=>this.disposeSprite()})]}),(0,s.jsxs)(In,{title:"PROPERTIES",selection:this.props.globalState,children:[(0,s.jsx)(ss,{lockObject:this.props.lockObject,label:"Position",target:e,propertyName:"position",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Pickable",target:e,propertyName:"isPickable",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use alpha for picking",target:e,propertyName:"useAlphaForPicking",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(qa,{lockObject:this.props.lockObject,label:"Color",target:e,propertyName:"color",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,useEuler:this.props.globalState.onlyUseEulers,label:"Angle",target:e,propertyName:"angle",minimum:0,maximum:2*Math.PI,step:.01,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"CELL",selection:this.props.globalState,children:[(0,s.jsx)("canvas",{ref:this._canvasRef,className:"preview",style:{margin:"auto",marginTop:"4px",marginBottom:"4px",display:"grid",height:"108px"}}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Cell index",decimalCount:0,target:e,propertyName:"cellIndex",minimum:0,maximum:n,step:1,onPropertyChangedObservable:this.props.onPropertyChangedObservable,onChange:()=>this.forceUpdate()}),(0,s.jsx)(so,{label:"Invert U axis",target:e,propertyName:"invertU",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Invert V axis",target:e,propertyName:"invertV",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"SCALE",selection:this.props.globalState,children:[(0,s.jsx)(Jo,{label:"Width",lockObject:this.props.lockObject,target:e,propertyName:"width",min:0,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{label:"Height",lockObject:this.props.lockObject,target:e,propertyName:"height",min:0,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"ANIMATION",selection:this.props.globalState,children:[(0,s.jsx)(Jo,{label:"Start cell",isInteger:!0,lockObject:this.props.lockObject,target:e,propertyName:"fromIndex",min:0,max:n,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{label:"End cell",isInteger:!0,lockObject:this.props.lockObject,target:e,propertyName:"toIndex",min:0,max:n,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Loop",target:e,propertyName:"loopAnimation",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{label:"Delay",lockObject:this.props.lockObject,target:e,propertyName:"delay",digits:0,min:0,isInteger:!0,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(_n,{label:e.animationStarted?"Stop":"Start",onClick:()=>this.switchPlayStopState()})]})]})}}class ol extends r.Component{constructor(e){super(e),this.findAnimationGroup=()=>{this._animationGroup=this.props.scene.animationGroups.find((e=>void 0!==e.targetedAnimations.find((e=>e===this.props.targetedAnimation))))},this.playOrPause=()=>{this._animationGroup&&(this._animationGroup.isPlaying?this._animationGroup.stop():this._animationGroup.start(),this.forceUpdate())},this.deleteAnimation=()=>{if(this._animationGroup){const e=this._animationGroup.targetedAnimations.indexOf(this.props.targetedAnimation);e>-1&&(this._animationGroup.targetedAnimations.splice(e,1),this.props.onSelectionChangedObservable?.notifyObservers(null),this._animationGroup.isPlaying&&(this._animationGroup.stop(),this._animationGroup.start()))}},this.updateContextFromProps=()=>{this._animationCurveEditorContext||(this._animationCurveEditorContext=new ra),this._animationCurveEditorContext.title=this.props.targetedAnimation.target.name||"",this._animationCurveEditorContext.animations=[this.props.targetedAnimation.animation],this._animationCurveEditorContext.target=this.props.targetedAnimation.target,this._animationCurveEditorContext.scene=this.props.scene,this._animationGroup&&(this._animationCurveEditorContext.rootAnimationGroup=this._animationGroup)}}componentDidMount(){this.findAnimationGroup(),this.updateContextFromProps()}componentDidUpdate(e,t,r){e.targetedAnimation!==this.props.targetedAnimation&&(this.findAnimationGroup(),this.updateContextFromProps())}render(){const e=this.props.targetedAnimation;return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e.animation,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),e.target.name&&(0,s.jsx)(Pn,{label:"Target",value:e.target.name,onLink:()=>this.props.globalState.onSelectionChangedObservable.notifyObservers(e)}),this._animationCurveEditorContext&&(0,s.jsx)(ta,{globalState:this.props.globalState,context:this._animationCurveEditorContext}),(0,s.jsx)(_n,{label:"Dispose",onClick:this.deleteAnimation})]})})}}class sl extends r.Component{constructor(e){super(e)}render(){const e=this.props.camera;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ja,{globalState:this.props.globalState,lockObject:this.props.lockObject,camera:e,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsxs)(In,{title:"TRANSFORMS",selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Radius",target:e,propertyName:"radius",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Rotation offset",target:e,propertyName:"rotationOffset",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Height offset",target:e,propertyName:"heightOffset",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Camera acceleration",target:e,propertyName:"cameraAcceleration",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]}),(0,s.jsxs)(In,{title:"LIMITS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Lower radius limit",target:e,propertyName:"lowerRadiusLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Upper radius limit",target:e,propertyName:"upperRadiusLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Lower rotation offset limit",target:e,propertyName:"lowerRotationOffsetLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Upper rotation offset limit",target:e,propertyName:"upperRotationOffsetLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Lower height offset limit",target:e,propertyName:"lowerHeightOffsetLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Upper height offset limit",target:e,propertyName:"upperHeightOffsetLimit",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Max camera speed",target:e,propertyName:"maxCameraSpeed",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class al extends r.Component{constructor(e){super(e)}render(){const e=this.props.sound;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Pn,{label:"Status",value:e.isPaused?"Paused":e.isPlaying?"Playing":"Stopped"})]}),(0,s.jsxs)(In,{title:"COMMANDS",selection:this.props.globalState,children:[e.isPlaying&&(0,s.jsx)(_n,{label:"Pause",onClick:()=>{e.pause(),this.forceUpdate()}}),!e.isPlaying&&(0,s.jsx)(_n,{label:"Play",onClick:()=>{e.play(),this.forceUpdate()}}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Samples",target:e,directValue:e.getVolume(),onChange:t=>{e.setVolume(t),this.forceUpdate()},minimum:0,maximum:5,step:.1,decimalCount:1,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Loop",target:e,propertyName:"loop",onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})]})}}class il extends r.Component{constructor(e){super(e)}render(){const e=this.props.layer;return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(In,{title:"GENERAL",selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"Class",value:e.getClassName()}),(0,s.jsx)(ls,{lockObject:this.props.lockObject,label:"Name",target:e,propertyName:"name",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Intensity",target:e,propertyName:"intensity",minimum:0,maximum:2,step:.01,decimalCount:2,onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(Ko,{lockObject:this.props.lockObject,label:"Blur Kernel Size",target:e,propertyName:"blurKernelSize",minimum:0,maximum:64,step:1,decimalCount:0,onPropertyChangedObservable:this.props.onPropertyChangedObservable})]})})}}class ll extends r.Component{constructor(e){super(e)}render(){return(0,s.jsx)(ps,{globalState:this.props.globalState,lockObject:this.props.lockObject,target:this.props.item,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}}var pl,cl=p(499),dl={};dl.styleTagTransform=Xn(),dl.setAttributes=Zn(),dl.insert=Wn().bind(null,"head"),dl.domAPI=Hn(),dl.insertStyleElement=Jn(),Gn()(cl.Z,dl),cl.Z&&cl.Z.locals&&cl.Z.locals,function(e){e.UNDEFINED="undefined",e.NULL="null",e.STRING="string",e.OBJECT="Object",e.JSON="JSON"}(pl||(pl={}));class hl extends r.Component{constructor(e){super(e),this.state={selectedEntityMetadata:"",dirty:!1,prettyJson:!1,preventObjCorruption:!0,metadataPropType:pl.UNDEFINED,statusMessage:"ready to pick",isValidJson:!1},this._textAreaHost=r.createRef(),this.refreshSelected=this.refreshSelected.bind(this),this.populateGltfExtras=this.populateGltfExtras.bind(this)}componentDidMount(){this.props.globalState&&this.refreshSelected()}componentDidUpdate(e){this.props.entity&&(e.entity&&e.entity.id===this.props.entity.id||this.refreshSelected())}refreshSelected(){if(this.props.entity){const e=this.parsableJson(this.props.entity.metadata),t=this.getEntityType(this.props.entity);this.setState({statusMessage:"",selectedEntityMetadata:this.parseMetaObject(e,this.props.entity.metadata),metadataPropType:t,isValidJson:e}),this.setTextAreaDisabled(this.state.preventObjCorruption&&t===pl.OBJECT)}else this.setState({statusMessage:"could not find entity, please pick again",selectedEntityMetadata:"",metadataPropType:pl.UNDEFINED,isValidJson:!1}),this.setTextAreaDisabled(!0)}setTextAreaDisabled(e){try{if(this._textAreaHost.current){const t=this._textAreaHost.current?.firstChild?.firstChild;t.disabled=e}}catch(e){console.error(e)}}getClassName(){switch(this.state.metadataPropType){case pl.STRING:return"meta-string";case pl.JSON:return"meta-json";case pl.OBJECT:return this.state.preventObjCorruption?"meta-object-protect":"meta-object";default:return""}}getEntityType(e){if(Object.prototype.hasOwnProperty.call(e,"metadata")){const t=e.metadata;return this.isString(t)?pl.STRING:null===t?pl.NULL:this.objectCanSafelyStringify(t)?pl.JSON:pl.OBJECT}return pl.UNDEFINED}isString(e){return"string"==typeof e||e instanceof String}parsableJson(e){if(!e)return!1;try{return!!JSON.parse(JSON.stringify(e))}catch(e){return!1}}parsableString(e){try{return this.setState({statusMessage:null}),JSON.parse(e)}catch(e){return this.setState({statusMessage:"invalid JSON: "+e.message}),null}}parseMetaObject(e,t){return e?JSON.stringify(t,void 0,this.state.prettyJson?2:void 0):this.isString(t)?t:String(t)}objectCanSafelyStringify(e){return"function"!=typeof e&&(!(null!==e&&!0!==e&&!1!==e&&"number"!=typeof e&&!this.isString(e))||("object"==typeof e?0===Object.values(e).length||Object.values(e).every((e=>this.objectCanSafelyStringify(e))):!!Array.isArray(e)&&e.every((e=>this.objectCanSafelyStringify(e)))))}copyToClipboard(){try{const e=this._textAreaHost.current?.firstChild?.firstChild;e.select(),e.setSelectionRange(0,99999),navigator.clipboard.writeText(e.value)}catch(e){window.alert("Could not copy to clipboard, see log."),console.error(e)}}populateGltfExtras(){if(this.state.isValidJson)try{const e=this.parsableString(this.state.selectedEntityMetadata);e&&(Object.prototype.hasOwnProperty.call(e,"gltf")?Object.prototype.hasOwnProperty.call(e.gltf,"extras")?this.setState({statusMessage:"metadata.gltf.extras property already exists"}):(e.gltf.extras={},this.setState({dirty:!0,prettyJson:!1,selectedEntityMetadata:this.parseMetaObject(this.state.isValidJson,e),statusMessage:"metadata.gltf.extras property inserted, don't forget to Update!"})):(e.gltf={extras:{}},this.setState({dirty:!0,prettyJson:!1,selectedEntityMetadata:this.parseMetaObject(this.state.isValidJson,e),statusMessage:"metadata.gltf property inserted, don't forget to Update!"})))}catch(e){this.setState({statusMessage:e.message})}}render(){const e=this.state.preventObjCorruption&&this.state.metadataPropType===pl.OBJECT;return(0,s.jsxs)(In,{title:"METADATA",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(Pn,{label:"Property type",value:this.state.metadataPropType}),(0,s.jsx)(so,{label:"Prevent Object corruption",disabled:!1,isSelected:()=>this.state.preventObjCorruption,onSelect:e=>{this.setState({preventObjCorruption:e}),this.setTextAreaDisabled(e&&this.state.metadataPropType===pl.OBJECT)}}),(0,s.jsx)(so,{label:"Pretty JSON",disabled:!1,isSelected:()=>this.state.prettyJson,onSelect:e=>{if(this.setState({prettyJson:e}),this.props.entity&&this.state.metadataPropType!==pl.NULL&&this.state.metadataPropType!==pl.UNDEFINED){const t=this.parsableString(this.state.selectedEntityMetadata);t&&!this.isString(t)&&this.setState({dirty:!0,selectedEntityMetadata:JSON.stringify(t,void 0,e?2:void 0)})}}}),(0,s.jsx)("div",{ref:this._textAreaHost,id:"metadata-container",className:this.getClassName(),children:(0,s.jsx)(ls,{multilines:!0,value:this.state.selectedEntityMetadata,onChange:e=>{if(e===this.state.selectedEntityMetadata)return;if(this.setState({dirty:!0,prettyJson:!1,selectedEntityMetadata:e}),""===e||"undefined"===e)return void this.setState({isValidJson:!1,metadataPropType:pl.UNDEFINED});if("null"===e)return void this.setState({isValidJson:!1,metadataPropType:pl.NULL});const t=!!this.parsableString(e);this.setState({isValidJson:t,metadataPropType:t?pl.JSON:pl.STRING})}})}),(0,s.jsx)("div",{className:"copy-root",children:(0,s.jsx)("div",{className:"copy-container",onClick:()=>this.copyToClipboard(),title:"Copy to clipboard",children:(0,s.jsx)("img",{src:es,alt:"Copy"})})}),(0,s.jsx)(_n,{label:"Populate glTF extras",onClick:this.populateGltfExtras,isDisabled:!this.state.isValidJson||e}),(0,s.jsx)(_n,{label:"Update metadata"+(this.props.entity?" as "+this.state.metadataPropType:""),onClick:()=>{if(this.props.entity){if(this.state.metadataPropType===pl.NULL)return this.props.entity.metadata=null,void this.setState({statusMessage:"metadata set to null",dirty:!1});if(this.state.metadataPropType===pl.UNDEFINED)return delete this.props.entity.metadata,void this.setState({statusMessage:"metadata set to undefined",dirty:!1});const e=this.parsableString(this.state.selectedEntityMetadata);this.props.entity.metadata=e||this.state.selectedEntityMetadata,this.setState({statusMessage:"metadata updated",dirty:!1})}},isDisabled:!this.state.dirty||e}),(0,s.jsx)("div",{className:"type-status",children:this.state.statusMessage})]})}}class ul extends En{constructor(e){super(e),this._lockObject=new ga}timerRefresh(){this._lockObject.lock||this.forceUpdate()}componentDidMount(){this._timerIntervalId=window.setInterval((()=>this.timerRefresh()),500)}componentWillUnmount(){window.clearInterval(this._timerIntervalId)}renderContent(){const e=this.props.selectedEntity;if(!e)return(0,s.jsx)("div",{className:"infoMessage",children:"Please select an entity in the scene explorer."});if(e.getClassName){const t=e.getClassName();if("Scene"===t){const t=e;return(0,s.jsx)(Ha,{scene:t,globalState:this.props.globalState,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("Sound"===t){const t=e;return(0,s.jsx)(al,{sound:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("Sprite"===t){const t=e;return(0,s.jsx)(nl,{sprite:t,globalState:this.props.globalState,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("SpriteManager"===t){const t=e;return(0,s.jsx)(rl,{spriteManager:t,globalState:this.props.globalState,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("Mesh")){const t=e;if(t.getTotalVertices()>0)return(0,s.jsx)("div",{children:(0,s.jsx)(ri,{globalState:this.props.globalState,mesh:t,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})})}if(-1!==t.indexOf("ParticleSystem")){const t=e;return(0,s.jsx)(tl,{globalState:this.props.globalState,system:t,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("FreeCamera")||-1!==t.indexOf("UniversalCamera")||-1!==t.indexOf("WebXRCamera")||-1!==t.indexOf("DeviceOrientationCamera")){const t=e;return(0,s.jsx)(Ka,{globalState:this.props.globalState,camera:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("ArcRotateCamera")){const t=e;return(0,s.jsx)(Xa,{globalState:this.props.globalState,camera:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("FollowCamera")){const t=e;return(0,s.jsx)(sl,{globalState:this.props.globalState,camera:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("HemisphericLight"===t){const t=e;return(0,s.jsx)(Ya,{globalState:this.props.globalState,light:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("PointLight"===t){const t=e;return(0,s.jsx)(Qa,{globalState:this.props.globalState,light:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("DirectionalLight"===t){const t=e;return(0,s.jsx)(Di,{globalState:this.props.globalState,light:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("SpotLight"===t){const t=e;return(0,s.jsx)(Ti,{globalState:this.props.globalState,light:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("TransformNode")||-1!==t.indexOf("Mesh")){const t=e;return(0,s.jsx)(ni,{transformNode:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("MultiMaterial"===t){const t=e;return(0,s.jsx)(Gi,{globalState:this.props.globalState,material:t,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("StandardMaterial"===t){const t=e;return(0,s.jsx)(la,{globalState:this.props.globalState,material:t,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("NodeMaterial"===t){const t=e;return(0,s.jsx)(Ui,{globalState:this.props.globalState,material:t,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("PBRMaterial"===t){const t=e;return(0,s.jsx)(Ua,{globalState:this.props.globalState,material:t,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("PBRMetallicRoughnessMaterial"===t){const t=e;return(0,s.jsx)(vi,{globalState:this.props.globalState,material:t,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("PBRSpecularGlossinessMaterial"===t){const t=e;return(0,s.jsx)(yi,{globalState:this.props.globalState,material:t,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("BackgroundMaterial"===t){const t=e;return(0,s.jsx)(oi,{globalState:this.props.globalState,material:t,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("AnimationGroup"===t){const t=e;return(0,s.jsx)(ci,{globalState:this.props.globalState,animationGroup:t,scene:this.props.scene,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("TargetedAnimation"===t){const t=e;return(0,s.jsx)(ol,{globalState:this.props.globalState,targetedAnimation:t,scene:this.props.scene,lockObject:this._lockObject,onSelectionChangedObservable:this.props.onSelectionChangedObservable,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("Material")){const t=e;return(0,s.jsx)(aa,{material:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("DefaultRenderingPipeline")){const t=e;return(0,s.jsx)(Ni,{renderPipeline:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("LensRenderingPipeline")){const t=e;return(0,s.jsx)(_i,{renderPipeline:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("SSAORenderingPipeline")){const t=e;return(0,s.jsx)(ki,{renderPipeline:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("SSAO2RenderingPipeline")){const t=e;return(0,s.jsx)(Li,{renderPipeline:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("SSRRenderingPipeline")){const t=e;return(0,s.jsx)(Ei,{renderPipeline:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("RenderingPipeline")){const t=e;return(0,s.jsx)(Mi,{renderPipeline:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("PostProcess")){const t=e;return(0,s.jsx)(Si,{postProcess:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("Layer")){const t=e;return(0,s.jsx)(il,{layer:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("Texture")){const t=e;return(0,s.jsx)(Ba,{texture:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("Skeleton")){const t=e;return(0,s.jsx)(Pi,{skeleton:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(-1!==t.indexOf("Bone")){const t=e;return(0,s.jsx)(Ii,{bone:t,globalState:this.props.globalState,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("TextBlock"===t){const t=e;return(0,s.jsx)(ii,{textBlock:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("InputText"===t){const t=e;return(0,s.jsx)(li,{inputText:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("ColorPicker"===t){const t=e;return(0,s.jsx)(pi,{colorPicker:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("Image"===t){const t=e;return(0,s.jsx)(di,{image:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("Slider"===t){const t=e;return(0,s.jsx)(hi,{slider:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("ImageBasedSlider"===t){const t=e;return(0,s.jsx)(ui,{imageBasedSlider:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("Rectangle"===t){const t=e;return(0,s.jsx)(bi,{rectangle:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("StackPanel"===t){const t=e;return(0,s.jsx)(ji,{stackPanel:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("Grid"===t){const t=e;return(0,s.jsx)(xi,{grid:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("ScrollViewer"===t){const t=e;return(0,s.jsx)(fi,{scrollViewer:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("Ellipse"===t){const t=e;return(0,s.jsx)(gi,{ellipse:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("Checkbox"===t){const t=e;return(0,s.jsx)(mi,{checkbox:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("RadioButton"===t){const t=e;return(0,s.jsx)(Ai,{radioButtons:[t],lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if("Line"===t){const t=e;return(0,s.jsx)(Ci,{line:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}if(e._host){const t=e;return(0,s.jsx)(ai,{control:t,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable})}return(0,s.jsx)(ll,{item:e,lockObject:this._lockObject,onPropertyChangedObservable:this.props.onPropertyChangedObservable,globalState:this.props.globalState})}return null}render(){const e=this.props.selectedEntity||{},t=Object.prototype.hasOwnProperty.call(e,"metadata");return(0,s.jsxs)("div",{className:"pane",children:[this.renderContent(),t&&(0,s.jsx)(hl,{globalState:this.props.globalState,entity:e})]})}}class bl extends r.Component{constructor(e){super(e),this._backStack=new Array,this.state={isBackVisible:!1}}componentDidMount(){this.props.onSelectionChangedObservable&&(this._onSelectionChangeObserver=this.props.onSelectionChangedObservable.add((e=>{0!==this._backStack.length&&e===this._backStack[this._backStack.length-1]||(this._backStack.push(e),this.setState({isBackVisible:this._backStack.length>1}))})))}componentWillUnmount(){this._onSelectionChangeObserver&&this.props.onSelectionChangedObservable.remove(this._onSelectionChangeObserver)}goBack(){this._backStack.pop();const e=this._backStack[this._backStack.length-1];this.props.onSelectionChangedObservable&&this.props.onSelectionChangedObservable.notifyObservers(e),this.setState({isBackVisible:this._backStack.length>1})}renderLogo(){return this.props.noCommands?null:this.props.handleBack?this.state.isBackVisible?(0,s.jsx)("div",{id:"back",onClick:()=>this.goBack(),children:(0,s.jsx)(Ir,{icon:ln})}):null:(0,s.jsx)("img",{id:"logo",style:{top:"0%"},src:"https://www.babylonjs.com/Assets/logo-babylonjs-social-twitter.png"})}render(){return(0,s.jsxs)("div",{id:"header",children:[this.renderLogo(),(0,s.jsx)("div",{id:"title",children:this.props.title}),(0,s.jsxs)("div",{id:"commands",children:[!this.props.noCommands&&!this.props.noExpand&&(0,s.jsx)("div",{className:"expand",onClick:()=>this.props.onPopup(),children:(0,s.jsx)(Ir,{icon:Qr})}),!this.props.noCommands&&!this.props.noClose&&(0,s.jsx)("div",{className:"close",onClick:()=>this.props.onClose(),children:(0,s.jsx)(Ir,{icon:yn})})]})]})}}class gl extends r.Component{constructor(e){super(e)}render(){return this.props.icon?(0,s.jsxs)("div",{className:"iconMessageLine",children:[(0,s.jsx)("div",{className:"icon",style:{color:this.props.color?this.props.color:""},children:(0,s.jsx)(Ir,{icon:this.props.icon})}),(0,s.jsx)("div",{className:"value",title:this.props.text,children:this.props.text})]}):(0,s.jsx)("div",{className:"messageLine",children:(0,s.jsx)("div",{className:"value",title:this.props.text,style:{color:this.props.color?this.props.color:""},children:this.props.text})})}}var ml=p(6190);class Al extends r.Component{constructor(){super(...arguments),this._onValidationResultsUpdatedObserver=null}openValidationDetails(){const e=this.props.globalState.validationResults,t=window.open("","_blank");t&&(t.document.title="glTF Validation Results",t.document.body.innerText=JSON.stringify(e,null,2),t.document.body.style.whiteSpace="pre",t.document.body.style.fontFamily="monospace",t.document.body.style.fontSize="14px",t.focus())}prepareText(e,t){return t?`${t} ${e}s`:`${e}`}componentDidMount(){this.props.globalState&&(this._onValidationResultsUpdatedObserver=this.props.globalState.onValidationResultsUpdatedObservable.add((()=>{this.forceUpdate()})))}componentWillUnmount(){this.props.globalState&&this._onValidationResultsUpdatedObserver&&this.props.globalState.onValidationResultsUpdatedObservable.remove(this._onValidationResultsUpdatedObserver)}renderValidation(){const e=this.props.globalState.validationResults;if(!e)return null;const t=e.issues;return(0,s.jsxs)(In,{title:"GLTF VALIDATION",closed:!t.numErrors&&!t.numWarnings,selection:this.props.globalState,children:[0!==t.numErrors&&(0,s.jsx)(gl,{text:"Your file has some validation issues",icon:Mn,color:"Red"}),0===t.numErrors&&(0,s.jsx)(gl,{text:"Your file is a valid glTF file",icon:wn,color:"Green"}),(0,s.jsx)(Pn,{label:"Errors",value:t.numErrors.toString()}),(0,s.jsx)(Pn,{label:"Warnings",value:t.numWarnings.toString()}),(0,s.jsx)(Pn,{label:"Infos",value:t.numInfos.toString()}),(0,s.jsx)(Pn,{label:"Hints",value:t.numHints.toString()}),(0,s.jsx)(Pn,{label:"More details",value:"Click here",onLink:()=>this.openValidationDetails()})]})}render(){const e=this.props.globalState.glTFLoaderExtensionDefaults,t=this.props.globalState.glTFLoaderDefaults,r=void 0!==ml.GLTFLoaderAnimationStartMode?[{label:"None",value:ml.GLTFLoaderAnimationStartMode.NONE},{label:"First",value:ml.GLTFLoaderAnimationStartMode.FIRST},{label:"ALL",value:ml.GLTFLoaderAnimationStartMode.ALL}]:[{label:"None",value:0},{label:"First",value:1},{label:"ALL",value:2}],n=void 0!==ml.GLTFLoaderCoordinateSystemMode?[{label:"Auto",value:ml.GLTFLoaderCoordinateSystemMode.AUTO},{label:"Right handed",value:ml.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED}]:[{label:"Auto",value:0},{label:"Right handed",value:1}];return(0,s.jsxs)("div",{children:[(0,s.jsxs)(In,{title:"GLTF LOADER",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Always compute bounding box",target:t,propertyName:"alwaysComputeBoundingBox"}),(0,s.jsx)(so,{label:"Always compute skeleton root node",target:t,propertyName:"alwaysComputeSkeletonRootNode"}),(0,s.jsx)(qo,{label:"Animation start mode",options:r,target:t,propertyName:"animationStartMode"}),(0,s.jsx)(so,{label:"Capture performance counters",target:t,propertyName:"capturePerformanceCounters"}),(0,s.jsx)(so,{label:"Compile materials",target:t,propertyName:"compileMaterials"}),(0,s.jsx)(so,{label:"Compile shadow generators",target:t,propertyName:"compileShadowGenerators"}),(0,s.jsx)(qo,{label:"Coordinate system",options:n,target:t,propertyName:"coordinateSystemMode"}),(0,s.jsx)(so,{label:"Create instances",target:t,propertyName:"createInstances"}),(0,s.jsx)(so,{label:"Enable logging",target:t,propertyName:"loggingEnabled"}),(0,s.jsx)(so,{label:"Load all materials",target:t,propertyName:"loadAllMaterials"}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Target FPS",target:t,propertyName:"targetFps",isInteger:!0}),(0,s.jsx)(so,{label:"Transparency as coverage",target:t,propertyName:"transparencyAsCoverage"}),(0,s.jsx)(so,{label:"Use clip plane",target:t,propertyName:"useClipPlane"}),(0,s.jsx)(so,{label:"Use sRGB buffers",target:t,propertyName:"useSRGBBuffers"}),(0,s.jsx)(so,{label:"Validate",target:t,propertyName:"validate"}),(0,s.jsx)(gl,{text:"You need to reload your file to see these changes"})]}),(0,s.jsxs)(In,{title:"GLTF EXTENSIONS",closed:!0,selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"EXT_lights_image_based",isSelected:()=>e.EXT_lights_image_based.enabled,onSelect:t=>e.EXT_lights_image_based.enabled=t}),(0,s.jsx)(so,{label:"EXT_mesh_gpu_instancing",isSelected:()=>e.EXT_mesh_gpu_instancing.enabled,onSelect:t=>e.EXT_mesh_gpu_instancing.enabled=t}),(0,s.jsx)(so,{label:"EXT_texture_webp",isSelected:()=>e.EXT_texture_webp.enabled,onSelect:t=>e.EXT_texture_webp.enabled=t}),(0,s.jsx)(so,{label:"KHR_draco_mesh_compression",isSelected:()=>e.KHR_draco_mesh_compression.enabled,onSelect:t=>e.KHR_draco_mesh_compression.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_pbrSpecularGloss...",isSelected:()=>e.KHR_materials_pbrSpecularGlossiness.enabled,onSelect:t=>e.KHR_materials_pbrSpecularGlossiness.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_clearcoat",isSelected:()=>e.KHR_materials_clearcoat.enabled,onSelect:t=>e.KHR_materials_clearcoat.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_iridescence",isSelected:()=>e.KHR_materials_iridescence.enabled,onSelect:t=>e.KHR_materials_iridescence.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_anisotropy",isSelected:()=>e.KHR_materials_anisotropy.enabled,onSelect:t=>e.KHR_materials_anisotropy.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_emissive_strength",isSelected:()=>e.KHR_materials_emissive_strength.enabled,onSelect:t=>e.KHR_materials_emissive_strength.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_ior",isSelected:()=>e.KHR_materials_ior.enabled,onSelect:t=>e.KHR_materials_ior.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_sheen",isSelected:()=>e.KHR_materials_sheen.enabled,onSelect:t=>e.KHR_materials_sheen.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_specular",isSelected:()=>e.KHR_materials_specular.enabled,onSelect:t=>e.KHR_materials_specular.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_unlit",isSelected:()=>e.KHR_materials_unlit.enabled,onSelect:t=>e.KHR_materials_unlit.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_variants",isSelected:()=>e.KHR_materials_variants.enabled,onSelect:t=>e.KHR_materials_variants.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_transmission",isSelected:()=>e.KHR_materials_transmission.enabled,onSelect:t=>e.KHR_materials_transmission.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_translucency",isSelected:()=>e.KHR_materials_translucency.enabled,onSelect:t=>e.KHR_materials_translucency.enabled=t}),(0,s.jsx)(so,{label:"KHR_materials_volume",isSelected:()=>e.KHR_materials_volume.enabled,onSelect:t=>e.KHR_materials_volume.enabled=t}),(0,s.jsx)(so,{label:"KHR_mesh_quantization",isSelected:()=>e.KHR_mesh_quantization.enabled,onSelect:t=>e.KHR_mesh_quantization.enabled=t}),(0,s.jsx)(so,{label:"KHR_lights_punctual",isSelected:()=>e.KHR_lights_punctual.enabled,onSelect:t=>e.KHR_lights_punctual.enabled=t}),(0,s.jsx)(so,{label:"KHR_texture_basisu",isSelected:()=>e.KHR_texture_basisu.enabled,onSelect:t=>e.KHR_texture_basisu.enabled=t}),(0,s.jsx)(so,{label:"KHR_texture_transform",isSelected:()=>e.KHR_texture_transform.enabled,onSelect:t=>e.KHR_texture_transform.enabled=t}),(0,s.jsx)(so,{label:"KHR_xmp_json_ld",isSelected:()=>e.KHR_xmp_json_ld.enabled,onSelect:t=>e.KHR_xmp_json_ld.enabled=t}),(0,s.jsx)(so,{label:"MSFT_lod",isSelected:()=>e.MSFT_lod.enabled,onSelect:t=>e.MSFT_lod.enabled=t}),(0,s.jsx)(Jo,{lockObject:this.props.lockObject,label:"Maximum LODs",target:e.MSFT_lod,propertyName:"maxLODsToLoad",additionalClass:"gltf-extension-property",isInteger:!0}),(0,s.jsx)(so,{label:"MSFT_minecraftMesh",isSelected:()=>e.MSFT_minecraftMesh.enabled,onSelect:t=>e.MSFT_minecraftMesh.enabled=t}),(0,s.jsx)(so,{label:"MSFT_sRGBFactors",isSelected:()=>e.MSFT_sRGBFactors.enabled,onSelect:t=>e.MSFT_sRGBFactors.enabled=t}),(0,s.jsx)(so,{label:"MSFT_audio_emitter",isSelected:()=>e.MSFT_audio_emitter.enabled,onSelect:t=>e.MSFT_audio_emitter.enabled=t}),(0,s.jsx)(gl,{text:"You need to reload your file to see these changes"})]}),this.props.globalState.validationResults&&this.renderValidation()]})}}var Cl=p(9545);class fl extends r.Component{constructor(e){super(e),this._id=fl._IDGenerator++,this._uploadInputRef=r.createRef()}onChange(e){const t=e.target.files;t&&t.length&&this.props.onClick(e),e.target.value=""}render(){return(0,s.jsxs)("div",{className:"buttonLine",children:[this.props.icon&&(0,s.jsx)("img",{src:this.props.icon,title:this.props.iconLabel,alt:this.props.iconLabel,className:"icon"}),(0,s.jsx)("label",{htmlFor:"file-upload"+this._id,className:"file-upload",children:this.props.label}),(0,s.jsx)("input",{ref:this._uploadInputRef,id:"file-upload"+this._id,type:"file",accept:this.props.accept,onChange:e=>this.onChange(e),multiple:!0})]})}}fl._IDGenerator=0;var xl=p(6696),vl=p.n(xl);const yl=[{label:"PNG",value:0,imageType:"image/png"},{label:"WebP",value:1,imageType:"image/webp"}];class jl extends En{constructor(e){super(e),this._lockObject=new ga,this._screenShotSize={precision:1},this._gifOptions={width:512,frequency:200},this._useWidthHeight=!1,this._isExportingGltf=!1,this._gltfExportOptions={exportDisabledNodes:!1,exportSkyboxes:!1,exportCameras:!1,exportLights:!1},this._crunchingGIF=!1,this._reflectorHostname="localhost",this._reflectorPort=1234,this._envOptions={imageTypeIndex:0,imageQuality:.8},this.state={tag:"Record video"};const t=this.props.globalState.sceneImportDefaults;void 0===t.overwriteAnimations&&(t.overwriteAnimations=!0),void 0===t.animationGroupLoadingMode&&(t.animationGroupLoadingMode=o.SceneLoaderAnimationGroupLoadingMode.Clean)}componentDidMount(){Cl.GLTF2Export||o.Tools.Warn("GLTF2Export is not available. Make sure to load the serializers library")}componentWillUnmount(){if(this._videoRecorder&&(this._videoRecorder.stopRecording(),this._videoRecorder.dispose(),this._videoRecorder=null),this._gifRecorder)return this._gifRecorder.render(),void(this._gifRecorder=null)}captureScreenshot(){const e=this.props.scene;e.activeCamera&&o.Tools.CreateScreenshot(e.getEngine(),e.activeCamera,this._screenShotSize)}captureEquirectangular(){const e=this.props.scene;e.activeCamera&&(0,o.captureEquirectangularFromScene)(e,{size:1024,filename:"equirectangular_capture.png"})}captureRender(){const e=this.props.scene,t={height:this._screenShotSize.height,width:this._screenShotSize.width,precision:this._screenShotSize.precision};this._useWidthHeight||(this._screenShotSize.width=void 0,this._screenShotSize.height=void 0),e.activeCamera&&o.Tools.CreateScreenshotUsingRenderTarget(e.getEngine(),e.activeCamera,this._screenShotSize,void 0,void 0,4),this._screenShotSize=t}recordVideo(){if(this._videoRecorder&&this._videoRecorder.isRecording)return void this._videoRecorder.stopRecording();const e=this.props.scene;this._videoRecorder||(this._videoRecorder=new o.VideoRecorder(e.getEngine())),this._videoRecorder.startRecording().then((()=>{this.setState({tag:"Record video"})})),this.setState({tag:"Stop recording"})}recordGIFInternal(){const e=URL.createObjectURL(this._gifWorkerBlob);this._gifRecorder=new(vl())({workers:2,quality:10,workerScript:e});const t=this.props.scene.getEngine();this._previousRenderingScale=t.getHardwareScalingLevel(),t.setHardwareScalingLevel(t.getRenderWidth()/this._gifOptions.width??1);const r=setInterval((()=>{this._gifRecorder?this._gifRecorder.addFrame(t.getRenderingCanvas(),{delay:0,copy:!0}):clearInterval(r)}),this._gifOptions.frequency);this._gifRecorder.on("finished",(r=>{this._crunchingGIF=!1,o.Tools.Download(r,"record.gif"),this.forceUpdate(),URL.revokeObjectURL(e),t.setHardwareScalingLevel(this._previousRenderingScale)})),this.forceUpdate()}recordGIF(){if(this._gifRecorder)return this._crunchingGIF=!0,this.forceUpdate(),this._gifRecorder.render(),void(this._gifRecorder=null);this._gifWorkerBlob?this.recordGIFInternal():o.Tools.LoadFileAsync("https://cdn.jsdelivr.net/gh//terikon/gif.js.optimized@0.1.6/dist/gif.worker.js").then((e=>{this._gifWorkerBlob=new Blob([e],{type:"application/javascript"}),this.recordGIFInternal()}))}importAnimations(e){const t=this.props.scene,r=this.props.globalState.sceneImportDefaults.overwriteAnimations,n=this.props.globalState.sceneImportDefaults.animationGroupLoadingMode;new o.FilesInput(t.getEngine(),t,(()=>{}),(()=>{}),(()=>{}),(()=>{}),(()=>{}),(function(e){if(e){const s=function(e){e.animationGroups.length>0&&e.animationGroups[0].play(!0)};o.SceneLoader.ImportAnimationsAsync("file:",e,t,r,n,null,s)}}),(()=>{})).loadFiles(e)}exportGLTF(){const e=this.props.scene;this._isExportingGltf=!0,this.forceUpdate();const t=e=>{if(!this._gltfExportOptions.exportDisabledNodes&&!e.isEnabled())return!1;if(!this._gltfExportOptions.exportSkyboxes&&e instanceof o.Mesh&&e.material){const t=e.material.reflectionTexture;if(t&&t.coordinatesMode===o.Texture.SKYBOX_MODE)return!1}return!(!this._gltfExportOptions.exportCameras&&e instanceof o.Camera||!this._gltfExportOptions.exportLights&&e instanceof o.Light)};Cl.GLTF2Export.GLBAsync(e,"scene",{shouldExportNode:e=>t(e)}).then((e=>{this._isExportingGltf=!1,this.forceUpdate(),e.downloadFiles()}),(()=>{this._isExportingGltf=!1,this.forceUpdate()}))}exportBabylon(){const e=this.props.scene,t=JSON.stringify(o.SceneSerializer.Serialize(e)),r=new Blob([t],{type:"octet/stream"});o.Tools.Download(r,"scene.babylon")}createEnvTexture(){const e=this.props.scene;o.EnvironmentTextureTools.CreateEnvTextureAsync(e.environmentTexture,{imageType:yl[this._envOptions.imageTypeIndex].imageType,imageQuality:this._envOptions.imageQuality}).then((e=>{const t=new Blob([e],{type:"octet/stream"});o.Tools.Download(t,"environment.env")})).catch((e=>{console.error(e),alert(e)}))}exportReplay(){this.props.globalState.recorder.export(),this.forceUpdate()}startRecording(){this.props.globalState.recorder.trackScene(this.props.scene),this.forceUpdate()}applyDelta(e){o.Tools.ReadFile(e,(e=>{this.props.globalState.recorder.applyDelta(e,this.props.scene),this.forceUpdate()}))}connectReflector(){this._reflector&&this._reflector.close(),this._reflector=new o.Reflector(this.props.scene,this._reflectorHostname,this._reflectorPort)}render(){const e=this.props.scene;if(!e)return null;const t=this.props.globalState.sceneImportDefaults,r=[{label:"Clean",value:o.SceneLoaderAnimationGroupLoadingMode.Clean},{label:"Stop",value:o.SceneLoaderAnimationGroupLoadingMode.Stop},{label:"Sync",value:o.SceneLoaderAnimationGroupLoadingMode.Sync},{label:"NoSync",value:o.SceneLoaderAnimationGroupLoadingMode.NoSync}];return(0,s.jsxs)("div",{className:"pane",children:[(0,s.jsxs)(In,{title:"CAPTURE",selection:this.props.globalState,children:[(0,s.jsx)(_n,{label:"Screenshot",onClick:()=>this.captureScreenshot()}),(0,s.jsx)(_n,{label:"Generate equirectangular capture",onClick:()=>this.captureEquirectangular()}),(0,s.jsx)(_n,{label:this.state.tag,onClick:()=>this.recordVideo()})]}),(0,s.jsxs)(In,{title:"CAPTURE WITH RTT",selection:this.props.globalState,children:[(0,s.jsx)(_n,{label:"Capture",onClick:()=>this.captureRender()}),(0,s.jsxs)("div",{className:"vector3Line",children:[(0,s.jsx)(Jo,{lockObject:this._lockObject,label:"Precision",target:this._screenShotSize,propertyName:"precision",onPropertyChangedObservable:this.props.onPropertyChangedObservable}),(0,s.jsx)(so,{label:"Use Width/Height",onSelect:e=>{this._useWidthHeight=e,this.forceUpdate()},isSelected:()=>this._useWidthHeight}),this._useWidthHeight&&(0,s.jsxs)("div",{className:"secondLine",children:[(0,s.jsx)($o,{lockObject:this._lockObject,label:"Width",precision:0,step:1,value:this._screenShotSize.width?this._screenShotSize.width:512,onChange:e=>this._screenShotSize.width=e}),(0,s.jsx)($o,{lockObject:this._lockObject,label:"Height",precision:0,step:1,value:this._screenShotSize.height?this._screenShotSize.height:512,onChange:e=>this._screenShotSize.height=e})]})]})]}),(0,s.jsxs)(In,{title:"GIF",selection:this.props.globalState,children:[this._crunchingGIF&&(0,s.jsx)(gl,{text:"Creating the GIF file..."}),!this._crunchingGIF&&(0,s.jsx)(_n,{label:this._gifRecorder?"Stop":"Record",onClick:()=>this.recordGIF()}),!this._crunchingGIF&&!this._gifRecorder&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Jo,{lockObject:this._lockObject,label:"Resolution",isInteger:!0,target:this._gifOptions,propertyName:"width"}),(0,s.jsx)(Jo,{lockObject:this._lockObject,label:"Frequency (ms)",isInteger:!0,target:this._gifOptions,propertyName:"frequency"})]})]}),(0,s.jsxs)(In,{title:"REPLAY",selection:this.props.globalState,children:[!this.props.globalState.recorder.isRecording&&(0,s.jsx)(_n,{label:"Start recording",onClick:()=>this.startRecording()}),this.props.globalState.recorder.isRecording&&(0,s.jsx)($a,{value:"Record in progress"}),this.props.globalState.recorder.isRecording&&(0,s.jsx)(_n,{label:"Generate delta file",onClick:()=>this.exportReplay()}),(0,s.jsx)(zn,{label:"Apply delta file",onClick:e=>this.applyDelta(e),accept:".json"})]}),(0,s.jsxs)(In,{title:"SCENE IMPORT",selection:this.props.globalState,children:[(0,s.jsx)(fl,{label:"Import animations",accept:"gltf",onClick:e=>this.importAnimations(e)}),(0,s.jsx)(so,{label:"Overwrite animations",target:t,propertyName:"overwriteAnimations",onSelect:e=>{t.overwriteAnimations=e,this.forceUpdate()}}),!1===t.overwriteAnimations&&(0,s.jsx)(qo,{label:"Animation merge mode",options:r,target:t,propertyName:"animationGroupLoadingMode"})]}),(0,s.jsxs)(In,{title:"SCENE EXPORT",selection:this.props.globalState,children:[(0,s.jsx)(_n,{label:"Export to Babylon",onClick:()=>this.exportBabylon()}),!e.getEngine().premultipliedAlpha&&e.environmentTexture&&e.environmentTexture._prefiltered&&e.activeCamera&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_n,{label:"Generate .env texture",onClick:()=>this.createEnvTexture()}),(0,s.jsx)(qo,{label:"Image type",options:yl,target:this._envOptions,propertyName:"imageTypeIndex",onSelect:()=>{this.forceUpdate()}}),this._envOptions.imageTypeIndex>0&&(0,s.jsx)(Jo,{lockObject:this._lockObject,label:"Quality",isInteger:!1,min:0,max:1,target:this._envOptions,propertyName:"imageQuality"})]})]}),(0,s.jsxs)(In,{title:"GLTF EXPORT",selection:this.props.globalState,children:[this._isExportingGltf&&(0,s.jsx)(Pn,{label:"Please wait..exporting",ignoreValue:!0}),!this._isExportingGltf&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(so,{label:"Export Disabled Nodes",isSelected:()=>this._gltfExportOptions.exportDisabledNodes,onSelect:e=>this._gltfExportOptions.exportDisabledNodes=e}),(0,s.jsx)(so,{label:"Export Skybox",isSelected:()=>this._gltfExportOptions.exportSkyboxes,onSelect:e=>this._gltfExportOptions.exportSkyboxes=e}),(0,s.jsx)(so,{label:"Export Cameras",isSelected:()=>this._gltfExportOptions.exportCameras,onSelect:e=>this._gltfExportOptions.exportCameras=e}),(0,s.jsx)(so,{label:"Export Lights",isSelected:()=>this._gltfExportOptions.exportLights,onSelect:e=>this._gltfExportOptions.exportLights=e}),(0,s.jsx)(_n,{label:"Export to GLB",onClick:()=>this.exportGLTF()})]})]}),ml.GLTFFileLoader&&(0,s.jsx)(Al,{lockObject:this._lockObject,scene:e,globalState:this.props.globalState}),(0,s.jsxs)(In,{title:"REFLECTOR",selection:this.props.globalState,children:[(0,s.jsx)(ls,{lockObject:this._lockObject,label:"Hostname",target:this,propertyName:"_reflectorHostname"}),(0,s.jsx)(Jo,{lockObject:this._lockObject,label:"Port",target:this,propertyName:"_reflectorPort",isInteger:!0}),(0,s.jsx)(_n,{label:"Connect",onClick:()=>this.connectReflector()})]})]})}}class Ol extends En{constructor(e){super(e)}render(){const e=this.props.globalState;return(0,s.jsx)("div",{className:"pane",children:(0,s.jsxs)(In,{title:"UI",selection:this.props.globalState,children:[(0,s.jsx)(so,{label:"Only display Euler values",target:e,propertyName:"onlyUseEulers"}),(0,s.jsx)(so,{label:"Ignore backfaces when picking",target:e,propertyName:"ignoreBackfacesForPicking"})]})})}}var Sl=p(4548),wl={};wl.styleTagTransform=Xn(),wl.setAttributes=Zn(),wl.insert=Wn().bind(null,"head"),wl.domAPI=Hn(),wl.insertStyleElement=Jn(),Gn()(Sl.Z,wl),Sl.Z&&Sl.Z.locals&&Sl.Z.locals;class Ml extends r.Component{constructor(e){super(e),this._once=!0;let t=void 0===e.initialTab?o.DebugLayerTab.Properties:e.initialTab;if(this.props.globalState){const e=this.props.globalState.validationResults;e&&(e.issues.numErrors||e.issues.numWarnings)&&(t=o.DebugLayerTab.Tools)}this.state={selectedEntity:null,selectedIndex:t}}componentDidMount(){this.props.globalState&&(this._onSelectionChangeObserver=this.props.globalState.onSelectionChangedObservable.add((e=>{this.setState({selectedEntity:e,selectedIndex:o.DebugLayerTab.Properties})})),this._onTabChangedObserver=this.props.globalState.onTabChangedObservable.add((e=>{this.setState({selectedIndex:e})})))}componentWillUnmount(){this.props.globalState&&(this._onSelectionChangeObserver&&this.props.globalState.onSelectionChangedObservable.remove(this._onSelectionChangeObserver),this._onTabChangedObserver&&this.props.globalState.onTabChangedObservable.remove(this._onTabChangedObserver))}changeSelectedTab(e){this.props.globalState&&this.props.globalState.onTabChangedObservable.notifyObservers(e)}renderContent(){return this.props.globalState&&this.props.scene?(0,s.jsxs)(Tr,{selectedIndex:this.state.selectedIndex,onSelectedIndexChange:e=>this.changeSelectedTab(e),children:[(0,s.jsx)(ul,{title:"Properties",icon:_r,scene:this.props.scene,selectedEntity:this.state.selectedEntity,globalState:this.props.globalState,onSelectionChangedObservable:this.props.globalState.onSelectionChangedObservable,onPropertyChangedObservable:this.props.globalState.onPropertyChangedObservable}),(0,s.jsx)(Po,{title:"Debug",icon:Cn,scene:this.props.scene,globalState:this.props.globalState}),(0,s.jsx)(No,{title:"Statistics",icon:Zr,scene:this.props.scene,globalState:this.props.globalState}),(0,s.jsx)(jl,{title:"Tools",icon:rn,scene:this.props.scene,globalState:this.props.globalState}),(0,s.jsx)(Ol,{title:"Settings",icon:un,scene:this.props.scene,globalState:this.props.globalState})]}):null}onClose(){this.props.onClose&&this.props.onClose()}onPopup(){this.props.onPopup&&this.props.onPopup()}render(){return this.props.popupMode?(0,s.jsxs)("div",{id:"actionTabs",children:[!this.props.noHeader&&(0,s.jsx)(bl,{title:"INSPECTOR",handleBack:!0,noClose:this.props.noClose,noExpand:this.props.noExpand,noCommands:this.props.noCommands,onClose:()=>this.onClose(),onPopup:()=>this.onPopup(),onSelectionChangedObservable:this.props.globalState?this.props.globalState.onSelectionChangedObservable:void 0}),this.renderContent()]}):(this._once&&(this._once=!1,setTimeout((()=>{const e=document.getElementById("actionTabs");e&&(e.style.width="200px")}),150)),(0,s.jsxs)(Zo,{id:"actionTabs",minWidth:300,maxWidth:600,size:{height:"100%"},minHeight:"100%",enable:{top:!1,right:!1,bottom:!1,left:!0,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},children:[!this.props.noHeader&&(0,s.jsx)(bl,{title:"INSPECTOR",handleBack:!0,noClose:this.props.noClose,noExpand:this.props.noExpand,noCommands:this.props.noCommands,onClose:()=>this.onClose(),onPopup:()=>this.onPopup(),onSelectionChangedObservable:this.props.globalState?this.props.globalState.onSelectionChangedObservable:void 0}),this.renderContent()]}))}}var Nl={prefix:"far",iconName:"lightbulb",icon:[384,512,[128161],"f0eb","M297.2 248.9C311.6 228.3 320 203.2 320 176c0-70.7-57.3-128-128-128S64 105.3 64 176c0 27.2 8.4 52.3 22.8 72.9c3.7 5.3 8.1 11.3 12.8 17.7l0 0c12.9 17.7 28.3 38.9 39.8 59.8c10.4 19 15.7 38.8 18.3 57.5H109c-2.2-12-5.9-23.7-11.8-34.5c-9.9-18-22.2-34.9-34.5-51.8l0 0 0 0c-5.2-7.1-10.4-14.2-15.4-21.4C27.6 247.9 16 213.3 16 176C16 78.8 94.8 0 192 0s176 78.8 176 176c0 37.3-11.6 71.9-31.4 100.3c-5 7.2-10.2 14.3-15.4 21.4l0 0 0 0c-12.3 16.8-24.6 33.7-34.5 51.8c-5.9 10.8-9.6 22.5-11.8 34.5H226.4c2.6-18.7 7.9-38.6 18.3-57.5c11.5-20.9 26.9-42.1 39.8-59.8l0 0 0 0 0 0c4.7-6.4 9-12.4 12.7-17.7zM192 128c-26.5 0-48 21.5-48 48c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-44.2 35.8-80 80-80c8.8 0 16 7.2 16 16s-7.2 16-16 16zm0 384c-44.2 0-80-35.8-80-80V416H272v16c0 44.2-35.8 80-80 80z"]},kl={prefix:"far",iconName:"eye-slash",icon:[640,512,[],"f070","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zm151 118.3C226 97.7 269.5 80 320 80c65.2 0 118.8 29.6 159.9 67.7C518.4 183.5 545 226 558.6 256c-12.6 28-36.6 66.8-70.9 100.9l-53.8-42.2c9.1-17.6 14.2-37.5 14.2-58.7c0-70.7-57.3-128-128-128c-32.2 0-61.7 11.9-84.2 31.5l-46.1-36.1zM394.9 284.2l-81.5-63.9c4.2-8.5 6.6-18.2 6.6-28.3c0-5.5-.7-10.9-2-16c.7 0 1.3 0 2 0c44.2 0 80 35.8 80 80c0 9.9-1.8 19.4-5.1 28.2zm9.4 130.3C378.8 425.4 350.7 432 320 432c-65.2 0-118.8-29.6-159.9-67.7C121.6 328.5 95 286 81.4 256c8.3-18.4 21.5-41.5 39.4-64.8L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5l-41.9-33zM192 256c0 70.7 57.3 128 128 128c13.3 0 26.1-2 38.2-5.8L302 334c-23.5-5.4-43.1-21.2-53.7-42.3l-56.1-44.2c-.2 2.8-.3 5.6-.3 8.5z"]},Ll={prefix:"far",iconName:"square",icon:[448,512,[9632,9723,9724,61590],"f0c8","M384 80c8.8 0 16 7.2 16 16V416c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V96c0-8.8 7.2-16 16-16H384zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"]},El={prefix:"far",iconName:"eye",icon:[576,512,[128065],"f06e","M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z"]};class Pl extends r.Component{constructor(e){super(e)}onClick(){this.props.onClick&&this.props.onClick()}render(){return(0,s.jsxs)("div",{className:"title",title:this.props.label,onClick:()=>this.onClick(),children:[(0,s.jsx)("div",{className:"titleIcon",children:(0,s.jsx)(Ir,{icon:this.props.icon,color:this.props.color})}),(0,s.jsx)("div",{className:"titleText",children:this.props.label||"no name"})]})}}class Il extends r.Component{constructor(e){super(e),this.state={popupVisible:!1},this._extensionRef=r.createRef()}showPopup(){this.setState({popupVisible:!0})}componentDidMount(){this._popup&&this._popup.focus()}componentDidUpdate(){this._popup&&this._popup.focus()}render(){if(!this.props.extensibilityGroups)return null;const e=[];for(const t of this.props.extensibilityGroups)t.predicate(this.props.target)&&e.push(...t.entries);return 0===e.length?null:(0,s.jsxs)("div",{ref:this._extensionRef,className:"extensions",children:[(0,s.jsx)("div",{title:"Additional options",className:"icon",onClick:()=>this.showPopup(),children:(0,s.jsx)(Ir,{icon:An})}),(0,s.jsx)("div",{ref:e=>{this._popup=e},tabIndex:-1,className:this.state.popupVisible?"popup show":"popup",onBlur:()=>this.setState({popupVisible:!1}),children:e.map((e=>(0,s.jsx)("div",{className:"popupMenu",onClick:()=>{e.action(this.props.target),e.keepOpenAfterClick||this.setState({popupVisible:!1})},children:e.label},e.label)))})]})}}class Dl extends r.Component{constructor(e){super(e);const t=this.props.mesh;this.state={isBoundingBoxEnabled:t.showBoundingBox,isVisible:this.props.mesh.isVisible}}showBoundingBox(){const e=this.props.mesh;e.showBoundingBox=!this.state.isBoundingBoxEnabled,this.props.globalState.onPropertyChangedObservable.notifyObservers({object:e,property:"showBoundingBox",value:e.showBoundingBox,initialValue:!e.showBoundingBox}),this.setState({isBoundingBoxEnabled:!this.state.isBoundingBoxEnabled})}switchVisibility(){const e=!this.state.isVisible;this.setState({isVisible:e}),this.props.mesh.isVisible=e,this.props.globalState.onPropertyChangedObservable.notifyObservers({object:this.props.mesh,property:"isVisible",value:e,initialValue:!e})}_getNameForLabel(){return"string"==typeof this.props.mesh.name?this.props.mesh.name:"no name"}render(){const e=this.props.mesh,t=this.state.isVisible?(0,s.jsx)(Ir,{icon:El}):(0,s.jsx)(Ir,{icon:kl,className:"isNotActive"});return(0,s.jsxs)("div",{className:"meshTools",children:[(0,s.jsx)(Pl,{label:this._getNameForLabel(),onClick:()=>this.props.onClick(),icon:tn,color:"dodgerblue"}),(0,s.jsx)("div",{className:this.state.isBoundingBoxEnabled?"bounding-box selected icon":"bounding-box icon",onClick:()=>this.showBoundingBox(),title:"Show/Hide bounding box",children:(0,s.jsx)(Ir,{icon:Ll})}),(0,s.jsx)("div",{className:"visibility icon",onClick:()=>this.switchVisibility(),title:"Show/Hide mesh",children:t}),(0,s.jsx)(Il,{target:e,extensibilityGroups:this.props.extensibilityGroups})]})}}class Tl extends r.Component{constructor(e){super(e);const t=this.props.camera,r=t.getScene();this.state={isActive:r.activeCamera===t,isGizmoEnabled:t.reservedDataStore&&t.reservedDataStore.cameraGizmo}}setActive(){const e=this.props.camera,t=e.getScene(),r=t.activeCamera;t.activeCamera=e,e.attachControl(!0),this.props.globalState.onPropertyChangedObservable.notifyObservers({object:t,property:"activeCamera",value:e,initialValue:r}),this.setState({isActive:!0})}componentDidMount(){const e=this.props.camera.getScene();this._onBeforeRenderObserver=e.onBeforeRenderObservable.add((()=>{const t=this.props.camera;this.state.isActive&&e.activeCameras&&e.activeCameras.length<=1&&e.activeCamera!==t&&t.detachControl();const r=e.activeCamera===t;r!==this.state.isActive&&this.setState({isActive:r})}))}componentWillUnmount(){this._onBeforeRenderObserver&&this.props.camera.getScene().onBeforeRenderObservable.remove(this._onBeforeRenderObserver)}toggleGizmo(){const e=this.props.camera;e.reservedDataStore&&e.reservedDataStore.cameraGizmo?(e.getScene().reservedDataStore&&e.getScene().reservedDataStore.gizmoManager&&e.getScene().reservedDataStore.gizmoManager.attachToMesh(null),this.props.globalState.enableCameraGizmo(e,!1),this.setState({isGizmoEnabled:!1})):(this.props.globalState.enableCameraGizmo(e,!0,this.props.gizmoCamera),this.setState({isGizmoEnabled:!0}))}render(){const e=this.state.isActive?(0,s.jsx)(Ir,{icon:Ln}):(0,s.jsx)(Ir,{icon:Ln,className:"isNotActive"}),t=this.props.camera.getScene(),r=this.state.isGizmoEnabled||this.props.camera&&this.props.camera.reservedDataStore&&this.props.camera.reservedDataStore.cameraGizmo?(0,s.jsx)(Ir,{icon:on}):(0,s.jsx)(Ir,{icon:on,className:"isNotActive"});return(0,s.jsxs)("div",{className:"cameraTools",children:[(0,s.jsx)(Pl,{label:this.props.camera.name,onClick:()=>this.props.onClick(),icon:pn,color:"green"}),(!t.activeCameras||0===t.activeCameras.length)&&(0,s.jsx)("div",{className:"activeCamera icon",onClick:()=>this.setActive(),title:"Set as main camera and attach to controls",children:e}),(0,s.jsx)("div",{className:"enableGizmo icon",onClick:()=>this.toggleGizmo(),title:"Turn on/off the camera's gizmo",children:r}),(0,s.jsx)(Il,{target:this.props.camera,extensibilityGroups:this.props.extensibilityGroups})]})}}class _l extends r.Component{constructor(e){super(e);const t=this.props.light;this.state={isEnabled:t.isEnabled(),isGizmoEnabled:t.reservedDataStore&&t.reservedDataStore.lightGizmo}}switchIsEnabled(){const e=this.props.light;e.setEnabled(!e.isEnabled()),this.props.globalState.onPropertyChangedObservable.notifyObservers({object:e,property:"isEnabled",value:e.isEnabled(),initialValue:!e.isEnabled()}),this.setState({isEnabled:e.isEnabled()})}toggleGizmo(){const e=this.props.light;e.reservedDataStore&&e.reservedDataStore.lightGizmo?(e.getScene().reservedDataStore&&e.getScene().reservedDataStore.gizmoManager&&e.getScene().reservedDataStore.gizmoManager.attachToMesh(null),this.props.globalState.enableLightGizmo(e,!1),this.setState({isGizmoEnabled:!1})):(this.props.globalState.enableLightGizmo(e,!0,this.props.gizmoCamera),this.setState({isGizmoEnabled:!0}))}render(){const e=this.state.isEnabled?(0,s.jsx)(Ir,{icon:Nl}):(0,s.jsx)(Ir,{icon:Nl,className:"isNotActive"}),t=this.state.isGizmoEnabled||this.props.light&&this.props.light.reservedDataStore&&this.props.light.reservedDataStore.lightGizmo?(0,s.jsx)(Ir,{icon:on}):(0,s.jsx)(Ir,{icon:on,className:"isNotActive"});return(0,s.jsxs)("div",{className:"lightTools",children:[(0,s.jsx)(Pl,{label:this.props.light.name,onClick:()=>this.props.onClick(),icon:Br,color:"yellow"}),(0,s.jsx)("div",{className:"visibility icon",onClick:()=>this.switchIsEnabled(),title:"Turn on/off the light",children:e}),(0,s.jsx)("div",{className:"enableGizmo icon",onClick:()=>this.toggleGizmo(),title:"Turn on/off the light's gizmo",children:t}),(0,s.jsx)(Il,{target:this.props.light,extensibilityGroups:this.props.extensibilityGroups})]})}}class zl extends r.Component{constructor(e){super(e)}render(){const e="NodeMaterial"===this.props.material.getClassName()?(0,s.jsx)("div",{className:"icon",onClick:()=>{this.props.material.edit({nodeEditorConfig:{backgroundColor:this.props.material.getScene().clearColor}})},title:"Node Material Editor",color:"white",children:(0,s.jsx)(Ir,{icon:sn})}):null;return(0,s.jsxs)("div",{className:"materialTools",children:[(0,s.jsx)(Pl,{label:this.props.material.name,onClick:()=>this.props.onClick(),icon:Nn,color:"orange"}),(0,s.jsx)(Il,{target:this.props.material,extensibilityGroups:this.props.extensibilityGroups}),e]})}}class Rl extends r.Component{constructor(e){super(e)}render(){return(0,s.jsxs)("div",{className:"textureTools",children:[(0,s.jsx)(Pl,{label:this.props.texture.name,onClick:()=>this.props.onClick(),icon:Jr,color:"mediumpurple"}),(0,s.jsx)(Il,{target:this.props.texture,extensibilityGroups:this.props.extensibilityGroups})]})}}class Bl extends r.Component{constructor(e){super(e)}render(){const e=this.props.transformNode;return(0,s.jsxs)("div",{className:"transformNodeTools",children:[(0,s.jsx)(Pl,{label:e.name,onClick:()=>this.props.onClick(),icon:nn,color:"cornflowerblue"}),(0,s.jsx)(Il,{target:e,extensibilityGroups:this.props.extensibilityGroups})]})}}class Ul extends r.Component{constructor(e){super(e);const t=this.props.control;this.state={isActive:t.isHighlighted,isVisible:t.isVisible}}highlight(){const e=this.props.control;e.isHighlighted=!e.isHighlighted,this.setState({isActive:e.isHighlighted})}switchVisibility(){const e=!this.state.isVisible;this.setState({isVisible:e}),this.props.control.isVisible=e}render(){const e=this.props.control,t=(e.name||"No name")+` [${e.getClassName()}]`,r=this.state.isActive?(0,s.jsx)(Ir,{icon:Vr}):(0,s.jsx)(Ir,{icon:Vr,className:"isNotActive"}),n=this.state.isVisible?(0,s.jsx)(Ir,{icon:on}):(0,s.jsx)(Ir,{icon:Hr,className:"isNotActive"});return(0,s.jsxs)("div",{className:"controlTools",children:[(0,s.jsx)(Pl,{label:t,onClick:()=>this.props.onClick(),icon:en,color:"greenyellow"}),(0,s.jsx)("div",{className:"highlight icon",onClick:()=>this.highlight(),title:"Highlight this control",children:r}),(0,s.jsx)("div",{className:"visibility icon",onClick:()=>this.switchVisibility(),title:"Show/Hide control",children:n}),(0,s.jsx)(Il,{target:e,extensibilityGroups:this.props.extensibilityGroups})]})}}class Gl extends r.Component{constructor(e){super(e),this.state={isInPickingMode:!1}}componentWillUnmount(){const e=this.props.texture;this._onControlPickedObserver&&(e.onControlPickedObservable.remove(this._onControlPickedObserver),this._onControlPickedObserver=null)}onPickingMode(){const e=this.props.texture;this._onControlPickedObserver&&(e.onControlPickedObservable.remove(this._onControlPickedObserver),this._onControlPickedObserver=null),this.state.isInPickingMode||(this._onControlPickedObserver=e.onControlPickedObservable.add((e=>{this.props.onSelectionChangedObservable&&("ScrollViewerWindow"===e.getClassName()&&(e=e.getAscendantOfClass("ScrollViewer")),this.props.onSelectionChangedObservable.notifyObservers(e))}))),this.setState({isInPickingMode:!this.state.isInPickingMode})}render(){return(0,s.jsxs)("div",{className:"adtextureTools",children:[(0,s.jsx)(Pl,{label:this.props.texture.name,onClick:()=>this.props.onClick(),icon:Jr,color:"mediumpurple"}),(0,s.jsx)("div",{className:"icon edit",onClick:()=>_a(this.props.texture,!0),title:"Edit",children:(0,s.jsx)(Ir,{icon:sn})}),(0,s.jsx)("div",{className:this.state.isInPickingMode?"pickingMode selected icon":"pickingMode icon",onClick:()=>this.onPickingMode(),title:"Turn picking mode on/off",children:(0,s.jsx)(Ir,{icon:dn})}),(0,s.jsx)(Il,{target:this.props.texture,extensibilityGroups:this.props.extensibilityGroups})]})}}class Fl extends r.Component{constructor(e){super(e)}render(){const e=this.props.animationGroup;return(0,s.jsxs)("div",{className:"animationGroupTools",children:[(0,s.jsx)(Pl,{label:e.name,onClick:()=>this.props.onClick(),icon:Kr,color:"cornflowerblue"}),(0,s.jsx)(Il,{target:e,extensibilityGroups:this.props.extensibilityGroups})]})}}class Hl extends r.Component{constructor(e){super(e)}render(){return(0,s.jsxs)("div",{className:"postProcessTools",children:[(0,s.jsx)(Pl,{label:this.props.postProcess.name,onClick:()=>this.props.onClick(),icon:On,color:"red"}),(0,s.jsx)(Il,{target:this.props.postProcess,extensibilityGroups:this.props.extensibilityGroups})]})}}class Vl extends r.Component{constructor(e){super(e)}render(){return(0,s.jsxs)("div",{className:"postProcessTools",children:[(0,s.jsx)(Pl,{label:this.props.renderPipeline.name,onClick:()=>this.props.onClick(),icon:On,color:"orangered"}),(0,s.jsx)(Il,{target:this.props.renderPipeline,extensibilityGroups:this.props.extensibilityGroups})]})}}class Wl extends r.Component{constructor(e){super(e)}render(){const e=this.props.skeleton;return(0,s.jsxs)("div",{className:"skeletonTools",children:[(0,s.jsx)(Pl,{label:e.name||"no name",onClick:()=>this.props.onClick(),icon:gn,color:"gray"}),(0,s.jsx)(Il,{target:e,extensibilityGroups:this.props.extensibilityGroups})]})}}class Yl extends r.Component{constructor(e){super(e)}render(){const e=this.props.bone;return(0,s.jsxs)("div",{className:"skeletonTools",children:[(0,s.jsx)(Pl,{label:e.name||"no name",onClick:()=>this.props.onClick(),icon:kn,color:"lightgray"}),(0,s.jsx)(Il,{target:e,extensibilityGroups:this.props.extensibilityGroups})]})}}class Zl extends r.Component{constructor(e){super(e)}render(){return(0,s.jsxs)("div",{className:"particleSystemTools",children:[(0,s.jsx)(Pl,{label:this.props.system.name||"Particle system",onClick:()=>this.props.onClick(),icon:cn,color:"crimson"}),(0,s.jsx)(Il,{target:this.props.system,extensibilityGroups:this.props.extensibilityGroups})]})}}class Ql extends r.Component{constructor(e){super(e)}render(){return(0,s.jsxs)("div",{className:"spriteManagerTools",children:[(0,s.jsx)(Pl,{label:this.props.spriteManager.name||"No name",onClick:()=>this.props.onClick(),icon:zr,color:"blanchedalmond"}),(0,s.jsx)(Il,{target:this.props.spriteManager,extensibilityGroups:this.props.extensibilityGroups})]})}}class Jl extends r.Component{constructor(e){super(e)}render(){return(0,s.jsxs)("div",{className:"spriteTools",children:[(0,s.jsx)(Pl,{label:this.props.sprite.name||"No name",onClick:()=>this.props.onClick(),icon:Fr,color:"blanchedalmond"}),(0,s.jsx)(Il,{target:this.props.sprite,extensibilityGroups:this.props.extensibilityGroups})]})}}class Kl extends r.Component{constructor(e){super(e)}render(){const e=this.props.targetedAnimation;return(0,s.jsxs)("div",{className:"targetedAnimationTools",children:[(0,s.jsx)(Pl,{label:e.animation.name,onClick:()=>this.props.onClick(),icon:Rr,color:"cornflowerblue"}),(0,s.jsx)(Il,{target:e,extensibilityGroups:this.props.extensibilityGroups})]})}}class Xl extends r.Component{constructor(e){super(e)}render(){const e=this.props.sound;return(0,s.jsxs)("div",{className:"soundTools",children:[(0,s.jsx)(Pl,{label:e.name,onClick:()=>this.props.onClick(),icon:Sn,color:"teal"}),(0,s.jsx)(Il,{target:e,extensibilityGroups:this.props.extensibilityGroups})]})}}class ql extends r.Component{constructor(e){super(e)}render(){return(0,s.jsxs)("div",{className:"effectLayerTools",children:[(0,s.jsx)(Pl,{label:this.props.layer.name,onClick:()=>this.props.onClick(),icon:mn,color:"Plum"}),(0,s.jsx)(Il,{target:this.props.layer,extensibilityGroups:this.props.extensibilityGroups})]})}}class $l extends r.Component{constructor(e){super(e)}onClick(){this.props.onClick&&this.props.onClick()}render(){const e=this.props.entity;if(e&&e.getClassName){const t=e.getClassName();if(-1!==t.indexOf("Mesh")){const t=e;return(0,s.jsx)(Dl,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,mesh:t,onClick:()=>this.onClick()})}if(-1!==t.indexOf("SpriteManager"))return(0,s.jsx)(Ql,{extensibilityGroups:this.props.extensibilityGroups,spriteManager:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("Sprite"))return(0,s.jsx)(Jl,{extensibilityGroups:this.props.extensibilityGroups,sprite:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("Skeleton"))return(0,s.jsx)(Wl,{extensibilityGroups:this.props.extensibilityGroups,skeleton:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("Bone"))return(0,s.jsx)(Yl,{extensibilityGroups:this.props.extensibilityGroups,bone:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("TransformNode"))return(0,s.jsx)(Bl,{extensibilityGroups:this.props.extensibilityGroups,transformNode:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("Camera"))return(0,s.jsx)(Tl,{globalState:this.props.globalState,gizmoCamera:this.props.gizmoCamera,extensibilityGroups:this.props.extensibilityGroups,camera:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("Light",t.length-5))return(0,s.jsx)(_l,{globalState:this.props.globalState,gizmoCamera:this.props.gizmoCamera,extensibilityGroups:this.props.extensibilityGroups,light:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("Material"))return(0,s.jsx)(zl,{extensibilityGroups:this.props.extensibilityGroups,material:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("ParticleSystem"))return(0,s.jsx)(Zl,{extensibilityGroups:this.props.extensibilityGroups,system:e,onClick:()=>this.onClick()});if("AdvancedDynamicTexture"===t)return(0,s.jsx)(Gl,{onSelectionChangedObservable:this.props.globalState.onSelectionChangedObservable,extensibilityGroups:this.props.extensibilityGroups,texture:e,onClick:()=>this.onClick()});if("AnimationGroup"===t)return(0,s.jsx)(Fl,{extensibilityGroups:this.props.extensibilityGroups,animationGroup:e,onClick:()=>this.onClick()});if("TargetedAnimation"===t)return(0,s.jsx)(Kl,{extensibilityGroups:this.props.extensibilityGroups,targetedAnimation:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("Texture"))return(0,s.jsx)(Rl,{extensibilityGroups:this.props.extensibilityGroups,texture:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("RenderingPipeline"))return(0,s.jsx)(Vl,{extensibilityGroups:this.props.extensibilityGroups,renderPipeline:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("PostProcess"))return(0,s.jsx)(Hl,{extensibilityGroups:this.props.extensibilityGroups,postProcess:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("Layer"))return(0,s.jsx)(ql,{extensibilityGroups:this.props.extensibilityGroups,layer:e,onClick:()=>this.onClick()});if(-1!==t.indexOf("Sound"))return(0,s.jsx)(Xl,{extensibilityGroups:this.props.extensibilityGroups,sound:e,onClick:()=>this.onClick()});if(e._host)return(0,s.jsx)(Ul,{extensibilityGroups:this.props.extensibilityGroups,control:e,onClick:()=>this.onClick()})}return(0,s.jsxs)("div",{className:"meshTools",children:[(0,s.jsx)(Pl,{label:e.name,onClick:()=>this.onClick(),icon:xn,color:"cornflowerblue"}),(0,s.jsx)(Il,{target:e,extensibilityGroups:this.props.extensibilityGroups})]})}}class ep{static LookForItem(e,t){if(e===t)return!0;const r=e.getChildren?e.getChildren():e.children;if(r&&"MultiMaterial"!==e.getClassName())for(const e of r)if(ep.LookForItem(e,t))return!0;return!1}static _RecursiveRemoveHiddenMeshesAndHoistChildren(e){const t=[];for(const r of e)r.reservedDataStore&&r.reservedDataStore.hidden&&r.getChildMeshes?ep._RecursiveRemoveHiddenMeshesAndHoistChildren(r.getChildMeshes()).forEach((e=>{t.push(e)})):r.reservedDataStore&&r.reservedDataStore.hidden||t.push(r);return t}static GetNameString(e){return e?.name?.toString?e.name.toString():""}static SortAndFilter(e,t){if(!t)return[];const r=ep._RecursiveRemoveHiddenMeshesAndHoistChildren(t);return e&&e.reservedDataStore&&e.reservedDataStore.detachedChildren&&r.push(...e.reservedDataStore.detachedChildren),r.sort(((e,t)=>{const r=ep.GetNameString(e).toLowerCase(),n=ep.GetNameString(t).toLowerCase();return r===n?0:r>n?1:-1}))}}class tp extends r.Component{constructor(e){super(e),this._wasSelected=!1,this.state={isSelected:this.props.entity===this.props.selectedEntity,isExpanded:this.props.mustExpand||ep.LookForItem(this.props.entity,this.props.selectedEntity)}}switchExpandedState(){this.setState({isExpanded:!this.state.isExpanded})}shouldComponentUpdate(e,t){if(!t.isExpanded&&this.state.isExpanded)return!0;if(e.selectedEntity){if(e.entity===e.selectedEntity)return t.isSelected=!0,!0;if(t.isSelected=!1,ep.LookForItem(e.entity,e.selectedEntity))return t.isExpanded=!0,!0}return!0}scrollIntoView(){const e=n.findDOMNode(this);e&&e.scrollIntoView(!1)}componentDidMount(){this.state.isSelected&&this.scrollIntoView()}componentDidUpdate(){this.state.isSelected&&!this._wasSelected&&this.scrollIntoView(),this._wasSelected=!1}onSelect(){if(!this.props.globalState.onSelectionChangedObservable)return;this._wasSelected=!0;const e=this.props.entity;this.props.globalState.onSelectionChangedObservable.notifyObservers(e)}renderChildren(){const e=this.props.entity;return(e.getChildren||e.children)&&this.state.isExpanded?ep.SortAndFilter(e,e.getChildren?e.getChildren():e.children).map(((e,t)=>(0,s.jsx)(tp,{globalState:this.props.globalState,gizmoCamera:this.props.gizmoCamera,mustExpand:this.props.mustExpand,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.props.selectedEntity,offset:this.props.offset+2,entity:e,filter:this.props.filter},t))):null}render(){const e={paddingLeft:10*(this.props.offset+.5)+"px"},t=this.props.entity,r=this.state.isExpanded?(0,s.jsx)(Ir,{icon:hn}):(0,s.jsx)(Ir,{icon:vn}),n=("MultiMaterial"===t.getClassName()?[]:ep.SortAndFilter(t,t.getChildren?t.getChildren():t.children)).length>0;if(t.reservedDataStore||(t.reservedDataStore={}),t.reservedDataStore.setExpandedState=e=>{this.setState({isExpanded:e})},t.reservedDataStore.isExpanded=this.state.isExpanded,this.props.filter){const e=this.props.filter.toLowerCase();if(!t.name||-1===t.name.toLowerCase().indexOf(e)){if(!n)return null;if(t.getDescendants&&0===t.getDescendants(!1,(t=>t.name&&-1!==t.name.toLowerCase().indexOf(e))).length)return null}}return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:this.state.isSelected?"itemContainer selected":"itemContainer",style:e,children:[n&&(0,s.jsx)("div",{className:"arrow icon",onClick:()=>this.switchExpandedState(),children:r}),(0,s.jsx)($l,{globalState:this.props.globalState,gizmoCamera:this.props.gizmoCamera,extensibilityGroups:this.props.extensibilityGroups,label:t.name,entity:t,onClick:()=>this.onSelect()})]}),this.renderChildren()]})}}var rp=p(445);class np extends r.Component{constructor(e){super(e)}expandAll(){this.props.onExpandAll(!this.props.isExpanded)}render(){const e=this.props.isExpanded?(0,s.jsx)(Ir,{icon:hn}):(0,s.jsx)(Ir,{icon:vn}),t=this.props.isExpanded?(0,s.jsx)(Ir,{icon:Ur}):(0,s.jsx)(Ir,{icon:Yr});return(0,s.jsxs)("div",{className:"expandableHeader",children:[(0,s.jsxs)("div",{className:"text",children:[(0,s.jsx)("div",{className:"arrow icon",onClick:()=>this.props.onClick(),children:e}),(0,s.jsx)("div",{className:"text-value",children:this.props.label})]}),(0,s.jsx)("div",{className:"expandAll icon",onClick:()=>this.expandAll(),title:this.props.isExpanded?"Collapse all":"Expand all",children:t})]})}}class op extends r.Component{constructor(e){super(e)}render(){return(0,s.jsx)("div",{className:"expandableHeader",children:(0,s.jsxs)("div",{className:"text",children:[(0,s.jsx)("div",{className:"arrow icon",children:(0,s.jsx)(Ir,{icon:Wr})}),(0,s.jsx)("div",{className:"text-value",children:this.props.label})]})})}}class sp extends r.Component{constructor(e){super(e),this.state={isExpanded:!1,mustExpand:!1}}switchExpandedState(){this.setState({isExpanded:!this.state.isExpanded,mustExpand:!1})}shouldComponentUpdate(e,t){if(!t.isExpanded&&this.state.isExpanded)return!0;const r=e.items;if(r&&r.length&&e.selectedEntity)for(const n of r)if(ep.LookForItem(n,e.selectedEntity))return t.isExpanded=!0,!0;return!0}expandAll(e){this.setState({isExpanded:e,mustExpand:e})}renderContextMenu(){return this.props.contextMenuItems?(0,s.jsx)(rp.xV,{id:"contextmenu#"+sp._ContextMenuUniqueIdGenerator++,className:"context-menu",children:this.props.contextMenuItems.map((e=>(0,s.jsx)(rp.sN,{onClick:()=>e.action(),children:e.label},e.label)))}):(sp._ContextMenuUniqueIdGenerator++,null)}render(){let e=this.props.items;const t={paddingLeft:10*(this.props.offset+.5)+"px"};if(!e){if(!this.props.forceSubitems)return(0,s.jsx)("div",{className:"groupContainer",style:t,children:(0,s.jsx)("div",{children:this.props.label})});e=[]}if(!e.length)return(0,s.jsx)("div",{className:"groupContainer",style:t,children:(0,s.jsxs)(rp.W4,{id:"contextmenu#"+sp._ContextMenuUniqueIdGenerator,children:[this.renderContextMenu(),(0,s.jsx)(op,{label:this.props.label})]})});if(!this.state.isExpanded)return(0,s.jsx)("div",{className:"groupContainer",style:t,children:(0,s.jsxs)(rp.W4,{id:"contextmenu#"+sp._ContextMenuUniqueIdGenerator,children:[this.renderContextMenu(),(0,s.jsx)(np,{isExpanded:!1,label:this.props.label,onClick:()=>this.switchExpandedState(),onExpandAll:e=>this.expandAll(e)})]})});const r=ep.SortAndFilter(null,e);return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"groupContainer",style:t,children:(0,s.jsxs)(rp.W4,{id:"contextmenu#"+sp._ContextMenuUniqueIdGenerator,children:[this.renderContextMenu(),(0,s.jsx)(np,{isExpanded:this.state.isExpanded,label:this.props.label,onClick:()=>this.switchExpandedState(),onExpandAll:e=>this.expandAll(e)})]})}),r.map((e=>(0,s.jsx)(tp,{mustExpand:this.state.mustExpand,extensibilityGroups:this.props.extensibilityGroups,offset:this.props.offset+1,selectedEntity:this.props.selectedEntity,entity:e,globalState:this.props.globalState,gizmoCamera:this.props.gizmoCamera,filter:this.props.filter},void 0!==e.uniqueId&&null!==e.uniqueId?e.uniqueId:e.name)))]})}}sp._ContextMenuUniqueIdGenerator=0;class ap{}class ip extends r.Component{constructor(e){super(e),this._posDragEnd=null,this._scaleDragEnd=null,this._rotateDragEnd=null;const t=this.props.scene;let r=0;if(t.reservedDataStore&&t.reservedDataStore.gizmoManager){const e=t.reservedDataStore.gizmoManager;e.positionGizmoEnabled?r=1:e.rotationGizmoEnabled?r=2:e.scaleGizmoEnabled?r=3:e.boundingBoxGizmoEnabled&&(r=4),e.enableAutoPicking=!1}this.state={isSelected:!1,isInPickingMode:!1,gizmoMode:r,isInWorldCoodinatesMode:!1}}shouldComponentUpdate(e,t){if(e.selectedEntity){if(e.scene===e.selectedEntity)return t.isSelected=!0,!0;t.isSelected=!1}return this.updateGizmoAutoPicking(t.isInPickingMode),!0}updateGizmoAutoPicking(e){const t=this.props.scene;t.reservedDataStore&&t.reservedDataStore.gizmoManager&&(t.reservedDataStore.gizmoManager.enableAutoPicking=e)}componentDidMount(){if(!this.props.onSelectionChangedObservable)return;const e=this.props.scene;this._onSelectionChangeObserver=this.props.onSelectionChangedObservable.add((t=>{if(this._selectedEntity=t,t&&e.reservedDataStore&&e.reservedDataStore.gizmoManager){const r=e.reservedDataStore.gizmoManager,n=t.getClassName();"TransformNode"===n||-1!==n.indexOf("Mesh")?r.attachToMesh(t):-1!==n.indexOf("Light")?(this._selectedEntity.reservedDataStore&&this._selectedEntity.reservedDataStore.lightGizmo||(this.props.globalState.enableLightGizmo(this._selectedEntity,!0,this.props.gizmoCamera),this.forceUpdate()),r.attachToNode(this._selectedEntity.reservedDataStore.lightGizmo.attachedNode)):-1!==n.indexOf("Camera")?(this._selectedEntity.reservedDataStore&&this._selectedEntity.reservedDataStore.cameraGizmo||(this.props.globalState.enableCameraGizmo(this._selectedEntity,!0,this.props.gizmoCamera),this.forceUpdate()),r.attachToNode(this._selectedEntity.reservedDataStore.cameraGizmo.attachedNode)):-1!==n.indexOf("Bone")?r.attachToMesh(this._selectedEntity._linkedTransformNode?this._selectedEntity._linkedTransformNode:this._selectedEntity):r.attachToNode(null)}}))}componentWillUnmount(){const e=this.props.scene;this._onPointerObserver&&(e.onPointerObservable.remove(this._onPointerObserver),this._onPointerObserver=null),this._gizmoLayerOnPointerObserver&&(e.onPointerObservable.remove(this._gizmoLayerOnPointerObserver),this._gizmoLayerOnPointerObserver=null),this._onSelectionChangeObserver&&this.props.onSelectionChangedObservable&&this.props.onSelectionChangedObservable.remove(this._onSelectionChangeObserver)}onSelect(){if(!this.props.onSelectionChangedObservable)return;const e=this.props.scene;this.props.onSelectionChangedObservable.notifyObservers(e)}onCoordinatesMode(){this.props.scene.reservedDataStore.gizmoManager.coordinatesMode=this.state.isInWorldCoodinatesMode?o.GizmoCoordinatesMode.Local:o.GizmoCoordinatesMode.World,this.setState({isInWorldCoodinatesMode:!this.state.isInWorldCoodinatesMode})}onPickingMode(){const e=this.props.scene;this._onPointerObserver&&(e.onPointerObservable.remove(this._onPointerObserver),this._onPointerObserver=null),this.state.isInPickingMode||(this._onPointerObserver=e.onPointerObservable.add((()=>{const t=e.unTranslatedPointer,r=e.pick(t.x,t.y,(e=>e.isEnabled()&&e.isVisible&&e.getTotalVertices()>0),!1,void 0,((e,t,r,n)=>{if(!this.props.globalState.ignoreBackfacesForPicking)return!0;const s=o.TmpVectors.Vector3[0],a=o.TmpVectors.Vector3[1];let i=o.TmpVectors.Vector3[2];return t.subtractToRef(e,s),r.subtractToRef(t,a),i=o.Vector3.Cross(s,a),o.Vector3.Dot(i,n.direction)<0}));if(this.props.globalState.lightGizmos.length>0){const e=this.props.globalState.lightGizmos[0].gizmoLayer.utilityLayerScene.pick(t.x,t.y,(e=>{for(const t of this.props.globalState.lightGizmos)if(t.attachedNode==e)return!0;return!1}));if(e&&e.hit&&this.props.onSelectionChangedObservable)return void this.props.onSelectionChangedObservable.notifyObservers(e.pickedMesh)}if(this.props.globalState.cameraGizmos.length>0){const e=this.props.globalState.cameraGizmos[0].gizmoLayer.utilityLayerScene.pick(t.x,t.y,(e=>{for(const t of this.props.globalState.cameraGizmos)if(t.attachedNode==e)return!0;return!1}));if(e&&e.hit&&this.props.onSelectionChangedObservable)return void this.props.onSelectionChangedObservable.notifyObservers(e.pickedMesh)}r&&r.hit&&this.props.onSelectionChangedObservable&&this.props.onSelectionChangedObservable.notifyObservers(r.pickedMesh)}),o.PointerEventTypes.POINTERTAP)),this.setState({isInPickingMode:!this.state.isInPickingMode})}setGizmoMode(e){const t=this.props.scene;t.reservedDataStore||(t.reservedDataStore={}),this._gizmoLayerOnPointerObserver&&(t.onPointerObservable.remove(this._gizmoLayerOnPointerObserver),this._gizmoLayerOnPointerObserver=null),t.reservedDataStore.gizmoManager||(t.reservedDataStore.gizmoManager=new o.GizmoManager(t,void 0,new o.UtilityLayerRenderer(t),new o.UtilityLayerRenderer(t))),this.props.gizmoCamera&&t.reservedDataStore.gizmoManager.utilityLayer.setRenderCamera(this.props.gizmoCamera);const r=t.reservedDataStore.gizmoManager;if(this._gizmoLayerOnPointerObserver=o.UtilityLayerRenderer.DefaultUtilityLayer.utilityLayerScene.onPointerObservable.add((e=>{if(e.type==o.PointerEventTypes.POINTERDOWN&&e.pickInfo&&e.pickInfo.pickedMesh){let t=e.pickInfo.pickedMesh;for(;t&&null!=t.parent;)t=t.parent;for(const e of this.props.globalState.lightGizmos)e._rootMesh==t&&r.attachToNode(e.attachedNode)}})),r.boundingBoxGizmoEnabled=!1,r.positionGizmoEnabled=!1,r.rotationGizmoEnabled=!1,r.scaleGizmoEnabled=!1,this.state.gizmoMode===e)e=0,r.dispose(),t.reservedDataStore.gizmoManager=null;else{switch(e){case 1:r.positionGizmoEnabled=!0,this._posDragEnd||(this._posDragEnd=r.gizmos.positionGizmo.onDragEndObservable.add((()=>{if(r.gizmos.positionGizmo&&r.gizmos.positionGizmo.attachedNode){const e=r.gizmos.positionGizmo.attachedNode.reservedDataStore?r.gizmos.positionGizmo.attachedNode.reservedDataStore.lightGizmo:null,t=e&&e.light?e.light:r.gizmos.positionGizmo.attachedNode;if(t.position){const e=new ap;e.object=t,e.property="position",e.value=t.position,this.props.globalState.onPropertyChangedObservable.notifyObservers(e)}else{const e=r.gizmos.positionGizmo.attachedNode.reservedDataStore?r.gizmos.positionGizmo.attachedNode.reservedDataStore.cameraGizmo:null,t=e&&e.camera?e.camera:r.gizmos.positionGizmo.attachedNode;if(t.position){const e=new ap;e.object=t,e.property="position",e.value=t.position,this.props.globalState.onPropertyChangedObservable.notifyObservers(e)}}}})));break;case 2:r.rotationGizmoEnabled=!0,this._rotateDragEnd||(this._rotateDragEnd=r.gizmos.rotationGizmo.onDragEndObservable.add((()=>{if(r.gizmos.rotationGizmo&&r.gizmos.rotationGizmo.attachedNode){const e=r.gizmos.rotationGizmo.attachedNode.reservedDataStore?r.gizmos.rotationGizmo.attachedNode.reservedDataStore.lightGizmo:null,t=e&&e.light?e.light:r.gizmos.rotationGizmo.attachedNode,n=r.gizmos.rotationGizmo.attachedNode.reservedDataStore?r.gizmos.rotationGizmo.attachedNode.reservedDataStore.cameraGizmo:null,o=n&&n.camera?n.camera:r.gizmos.rotationGizmo.attachedNode;if(t.rotationQuaternion){const e=new ap;e.object=t,e.property="rotationQuaternion",e.value=t.rotationQuaternion,this.props.globalState.onPropertyChangedObservable.notifyObservers(e)}else if(t.rotation){const e=new ap;e.object=t,e.property="rotation",e.value=t.rotation,this.props.globalState.onPropertyChangedObservable.notifyObservers(e)}else if(t.direction){const e=new ap;e.object=t,e.property="direction",e.value=t.direction,this.props.globalState.onPropertyChangedObservable.notifyObservers(e)}else if(o.rotationQuaternion){const e=new ap;e.object=o,e.property="rotationQuaternion",e.value=o.rotationQuaternion,this.props.globalState.onPropertyChangedObservable.notifyObservers(e)}else if(o.rotation){const e=new ap;e.object=o,e.property="rotation",e.value=o.rotation,this.props.globalState.onPropertyChangedObservable.notifyObservers(e)}}})));break;case 3:r.scaleGizmoEnabled=!0,this._scaleDragEnd||(this._scaleDragEnd=r.gizmos.scaleGizmo.onDragEndObservable.add((()=>{if(r.gizmos.scaleGizmo&&r.gizmos.scaleGizmo.attachedMesh){const e=r.gizmos.scaleGizmo.attachedMesh.reservedDataStore?r.gizmos.scaleGizmo.attachedMesh.reservedDataStore.lightGizmo:null,t=e&&e.light?e.light:r.gizmos.scaleGizmo.attachedMesh;if(t.scaling){const e=new ap;e.object=t,e.property="scaling",e.value=t.scaling,this.props.globalState.onPropertyChangedObservable.notifyObservers(e)}}})));break;case 4:r.boundingBoxGizmoEnabled=!0,r.gizmos.boundingBoxGizmo&&(r.gizmos.boundingBoxGizmo.fixedDragMeshScreenSize=!0)}if(this._selectedEntity&&this._selectedEntity.getClassName){const e=this._selectedEntity.getClassName();"TransformNode"===e||-1!==e.indexOf("Mesh")?r.attachToMesh(this._selectedEntity):-1!==e.indexOf("Light")?(this._selectedEntity.reservedDataStore&&this._selectedEntity.reservedDataStore.lightGizmo||(this.props.globalState.enableLightGizmo(this._selectedEntity,!0,this.props.gizmoCamera),this.forceUpdate()),r.attachToNode(this._selectedEntity.reservedDataStore.lightGizmo.attachedNode)):-1!==e.indexOf("Camera")?(this._selectedEntity.reservedDataStore&&this._selectedEntity.reservedDataStore.cameraGizmo||(this.props.globalState.enableCameraGizmo(this._selectedEntity,!0,this.props.gizmoCamera),this.forceUpdate()),r.attachToNode(this._selectedEntity.reservedDataStore.cameraGizmo.attachedNode)):-1!==e.indexOf("Bone")&&r.attachToMesh(this._selectedEntity._linkedTransformNode?this._selectedEntity._linkedTransformNode:this._selectedEntity)}}this.setState({gizmoMode:e})}render(){return(0,s.jsx)("div",{className:this.state.isSelected?"itemContainer selected":"itemContainer",children:(0,s.jsxs)("div",{className:"sceneNode",children:[(0,s.jsxs)("div",{className:"sceneTitle",onClick:()=>this.onSelect(),children:[(0,s.jsx)(Ir,{icon:Jr})," Scene"]}),(0,s.jsx)("div",{className:1===this.state.gizmoMode?"translation selected icon":"translation icon",onClick:()=>this.setGizmoMode(1),title:"Enable/Disable position mode",children:(0,s.jsx)(Ir,{icon:$r})}),(0,s.jsx)("div",{className:2===this.state.gizmoMode?"rotation selected icon":"rotation icon",onClick:()=>this.setGizmoMode(2),title:"Enable/Disable rotation mode",children:(0,s.jsx)(Ir,{icon:bn})}),(0,s.jsx)("div",{className:3===this.state.gizmoMode?"scaling selected icon":"scaling icon",onClick:()=>this.setGizmoMode(3),title:"Enable/Disable scaling mode",children:(0,s.jsx)(Ir,{icon:Ur})}),(0,s.jsx)("div",{className:4===this.state.gizmoMode?"bounding selected icon":"bounding icon",onClick:()=>this.setGizmoMode(4),title:"Enable/Disable bounding box mode",children:(0,s.jsx)(Ir,{icon:qr})}),(0,s.jsx)("div",{className:"separator"}),(0,s.jsx)("div",{className:this.state.isInPickingMode?"pickingMode selected icon":"pickingMode icon",onClick:()=>this.onPickingMode(),title:"Turn picking mode on/off",children:(0,s.jsx)(Ir,{icon:dn})}),(0,s.jsx)("div",{className:this.state.isInWorldCoodinatesMode?"coordinates selected icon":"coordinates icon",onClick:()=>this.onCoordinatesMode(),title:"Switch between world and local coordinates",children:(0,s.jsx)(Ir,{icon:fn})}),(0,s.jsx)("div",{className:"refresh icon",onClick:()=>this.props.onRefresh(),title:"Refresh the explorer",children:(0,s.jsx)(Ir,{icon:jn})}),(0,s.jsx)(Il,{target:this.props.scene,extensibilityGroups:this.props.extensibilityGroups})]})})}}var lp=p(9814),pp={};pp.styleTagTransform=Xn(),pp.setAttributes=Zn(),pp.insert=Wn().bind(null,"head"),pp.domAPI=Hn(),pp.insertStyleElement=Jn(),Gn()(lp.Z,pp),lp.Z&&lp.Z.locals&&lp.Z.locals;class cp extends r.Component{constructor(e){super(e)}render(){return(0,s.jsx)("div",{className:"filter",children:(0,s.jsx)("input",{type:"text",placeholder:"Filter",onChange:e=>this.props.onFilter(e.target.value)})})}}class dp extends r.Component{constructor(e){super(e),this._mutationTimeout=null,this._once=!0,this._hooked=!1,this.state={filter:null,selectedEntity:null,scene:this.props.scene},this._sceneMutationFunc=this.processMutation.bind(this),this._sceneExplorerRef=r.createRef(),this._onNewSceneObserver=this.props.globalState.onNewSceneObservable.add((e=>{this.setState({scene:e})}))}processMutation(){this.props.globalState.blockMutationUpdates||(null!==this._mutationTimeout&&window.clearTimeout(this._mutationTimeout),this._mutationTimeout=window.setTimeout((()=>{this._mutationTimeout=null,this.forceUpdate()}),32))}componentDidMount(){this._onSelectionChangeObserver=this.props.globalState.onSelectionChangedObservable.add((e=>{this.state.selectedEntity!==e&&this.setState({selectedEntity:e})})),this._onSelectionRenamedObserver=this.props.globalState.onSelectionRenamedObservable.add((()=>{this.forceUpdate()}))}componentWillUnmount(){this._onSelectionChangeObserver&&this.props.globalState.onSelectionChangedObservable.remove(this._onSelectionChangeObserver),this._onSelectionRenamedObserver&&this.props.globalState.onSelectionRenamedObservable.remove(this._onSelectionRenamedObserver),this._onNewSceneAddedObserver&&o.EngineStore.LastCreatedEngine.onNewSceneAddedObservable.remove(this._onNewSceneAddedObserver),this._onNewSceneObserver&&this.props.globalState.onNewSceneObservable.remove(this._onNewSceneObserver);const e=this.state.scene;e.onNewSkeletonAddedObservable.removeCallback(this._sceneMutationFunc),e.onNewCameraAddedObservable.removeCallback(this._sceneMutationFunc),e.onNewLightAddedObservable.removeCallback(this._sceneMutationFunc),e.onNewMaterialAddedObservable.removeCallback(this._sceneMutationFunc),e.onNewMeshAddedObservable.removeCallback(this._sceneMutationFunc),e.onNewTextureAddedObservable.removeCallback(this._sceneMutationFunc),e.onNewTransformNodeAddedObservable.removeCallback(this._sceneMutationFunc),e.onSkeletonRemovedObservable.removeCallback(this._sceneMutationFunc),e.onMeshRemovedObservable.removeCallback(this._sceneMutationFunc),e.onCameraRemovedObservable.removeCallback(this._sceneMutationFunc),e.onLightRemovedObservable.removeCallback(this._sceneMutationFunc),e.onMaterialRemovedObservable.removeCallback(this._sceneMutationFunc),e.onTransformNodeRemovedObservable.removeCallback(this._sceneMutationFunc),e.onTextureRemovedObservable.removeCallback(this._sceneMutationFunc)}filterContent(e){this.setState({filter:e})}findSiblings(e,t,r,n,o){if(!t)return!1;const s=ep.SortAndFilter(e,t);if(!t||0===s.length)return!1;for(const e of s){if(e===r){if(o.found=!0,!n)return o.previousOne&&this.props.globalState.onSelectionChangedObservable.notifyObservers(o.previousOne),!0}else{if(o.found)return this.props.globalState.onSelectionChangedObservable.notifyObservers(e),!0;o.previousOne=e}if(e.getChildren&&e.reservedDataStore&&e.reservedDataStore.isExpanded&&this.findSiblings(e,e.getChildren(),r,n,o))return!0}return!1}processKeys(e){if(!this.state.selectedEntity)return;const t=this.state.scene;let r=!1,n=!1;if(38===e.keyCode)r=!0;else if(40===e.keyCode)n=!0,r=!0;else{if(13===e.keyCode||39===e.keyCode){const t=this.state.selectedEntity.reservedDataStore;return t&&t.setExpandedState&&t.setExpandedState(!0),void e.preventDefault()}if(37===e.keyCode){const t=this.state.selectedEntity.reservedDataStore;return t&&t.setExpandedState&&t.setExpandedState(!1),void e.preventDefault()}46===e.keyCode&&(this.state.selectedEntity.dispose(),this.props.globalState.onSelectionChangedObservable.notifyObservers(t))}if(!r)return;e.preventDefault();const o={};this.findSiblings(null,t.rootNodes,this.state.selectedEntity,n,o)||this.findSiblings(null,t.materials,this.state.selectedEntity,n,o)||this.findSiblings(null,t.textures,this.state.selectedEntity,n,o)}_getPipelineContextMenus(e,t){const r=[];e.activeCamera&&(t.some((e=>"DefaultRenderingPipeline"===e.getClassName()))||r.push({label:"Add new Default Rendering Pipeline",action:()=>{const t=new o.DefaultRenderingPipeline("Default rendering pipeline",!0,e,e.cameras);this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}}),t.some((e=>"SSAORenderingPipeline"===e.getClassName()))||r.push({label:"Add new SSAO Rendering Pipeline",action:()=>{const t=new o.SSAORenderingPipeline("SSAO rendering pipeline",e,1,e.cameras);this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}}),e.getEngine().getCaps().drawBuffersExtension&&!t.some((e=>"SSAORenderingPipeline"===e.getClassName()))&&r.push({label:"Add new SSAO2 Rendering Pipeline",action:()=>{const t=new o.SSAO2RenderingPipeline("SSAO2 rendering pipeline",e,1,e.cameras);this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}}),e.getEngine().getCaps().drawBuffersExtension&&e.getEngine().getCaps().texelFetch&&!t.some((e=>"SSRRenderingPipeline"===e.getClassName()))&&r.push({label:"Add new SSR Rendering Pipeline",action:()=>{const t=new o.SSRRenderingPipeline("SSR rendering pipeline",e,e.cameras);this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}}));const n=this.props.contextMenu?.pipeline||[];return this.props.contextMenuOverride?.includes("pipeline")?n:[...r,...n]}_getNodeContextMenus(e){const t=[];t.push({label:"Add new point light",action:()=>{const t=new o.PointLight("point light",o.Vector3.Zero(),e);this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}}),t.push({label:"Add new directional light",action:()=>{const t=new o.DirectionalLight("directional light",new o.Vector3(-1,-1,-.5),e);this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}}),t.push({label:"Add new free camera",action:()=>{const t=new o.FreeCamera("free camera",e.activeCamera?e.activeCamera.globalPosition:new o.Vector3(0,0,-5),e);e.activeCamera&&(t.minZ=e.activeCamera.minZ,t.maxZ=e.activeCamera.maxZ,e.activeCamera.getTarget&&t.setTarget(e.activeCamera.getTarget())),this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}}),t.push({label:"Add new mesh from Node Geometry",action:()=>{const t=new o.NodeGeometry("Node Geometry");t.setToDefault(),t.build();const r=t.createMesh("Node geometry mesh",e);this.props.globalState.onSelectionChangedObservable.notifyObservers(r)}});const r=this.props.contextMenu?.node||[];return this.props.contextMenuOverride?.includes("node")?r:[...t,...r]}_getMaterialsContextMenus(e){const t=t=>{let r=1;for(;e.getMaterialById(t);)t=t+" "+r++;return t},r=[];r.push({label:"Add new standard material",action:()=>{const r=new o.StandardMaterial(t("Standard material"),e);this.props.globalState.onSelectionChangedObservable.notifyObservers(r)}}),r.push({label:"Add new PBR material",action:()=>{const r=new o.PBRMaterial(t("PBR material"),e);this.props.globalState.onSelectionChangedObservable.notifyObservers(r)}}),r.push({label:"Add new node material",action:()=>{const r=new o.NodeMaterial(t("node material"),e);r.setToDefault(),r.build(!1,!1,!0),this.props.globalState.onSelectionChangedObservable.notifyObservers(r)}});const n=this.props.contextMenu?.materials||[];return this.props.contextMenuOverride?.includes("materials")?n:[...r,...n]}_getSpriteManagersContextMenus(e){const t=[];t.push({label:"Add new sprite manager",action:()=>{const t=new o.SpriteManager("Default sprite manager","//playground.babylonjs.com/textures/player.png",500,64,e);this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}});const r=this.props.contextMenu?.spriteManagers||[];return this.props.contextMenuOverride?.includes("spriteManagers")?r:[...t,...r]}_getParticleSystemsContextMenus(e){const t=[];t.push({label:"Add new CPU particle system",action:()=>{const t=o.ParticleHelper.CreateDefault(o.Vector3.Zero(),1e4,e);t.name="CPU particle system",t.start(),this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}}),o.GPUParticleSystem.IsSupported&&t.push({label:"Add new GPU particle system",action:()=>{const t=o.ParticleHelper.CreateDefault(o.Vector3.Zero(),1e4,e,!0);t.name="GPU particle system",t.start(),this.props.globalState.onSelectionChangedObservable.notifyObservers(t)}});const r=this.props.contextMenu?.particleSystems||[];return this.props.contextMenuOverride?.includes("particleSystems")?r:[...t,...r]}renderContent(){const e=this.state.scene;if(!e)return this._onNewSceneAddedObserver=o.EngineStore.LastCreatedEngine.onNewSceneAddedObservable.addOnce((e=>this.setState({scene:e}))),null;this._hooked||(this._hooked=!0,e.onNewSkeletonAddedObservable.add(this._sceneMutationFunc),e.onNewCameraAddedObservable.add(this._sceneMutationFunc),e.onNewLightAddedObservable.add(this._sceneMutationFunc),e.onNewMaterialAddedObservable.add(this._sceneMutationFunc),e.onNewMeshAddedObservable.add(this._sceneMutationFunc),e.onNewTextureAddedObservable.add(this._sceneMutationFunc),e.onNewTransformNodeAddedObservable.add(this._sceneMutationFunc),e.onSkeletonRemovedObservable.add(this._sceneMutationFunc),e.onMeshRemovedObservable.add(this._sceneMutationFunc),e.onCameraRemovedObservable.add(this._sceneMutationFunc),e.onLightRemovedObservable.add(this._sceneMutationFunc),e.onMaterialRemovedObservable.add(this._sceneMutationFunc),e.onTransformNodeRemovedObservable.add(this._sceneMutationFunc),e.onTextureRemovedObservable.add(this._sceneMutationFunc));const t=e.textures.filter((e=>"AdvancedDynamicTexture"===e.getClassName())),r=e.textures.filter((e=>"AdvancedDynamicTexture"!==e.getClassName())),n=e.postProcesses,a=e.postProcessRenderPipelineManager.supportedPipelines,i=this._getPipelineContextMenus(e,a),l=this._getNodeContextMenus(e),p=this._getMaterialsContextMenus(e),c=this._getSpriteManagersContextMenus(e),d=this._getParticleSystemsContextMenus(e),h=[];h.push(...e.materials),e.multiMaterials&&e.multiMaterials.length&&h.push(...e.multiMaterials);const u=e.rootNodes.slice(0);for(const t of e.meshes)t.parent&&"Bone"===t.parent.getClassName()&&u.push(t);return(0,s.jsxs)("div",{id:"tree",onContextMenu:e=>e.preventDefault(),children:[(0,s.jsx)(cp,{onFilter:e=>this.filterContent(e)}),(0,s.jsx)(ip,{globalState:this.props.globalState,gizmoCamera:this.props.gizmoCamera,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,scene:e,onRefresh:()=>this.forceUpdate(),onSelectionChangedObservable:this.props.globalState.onSelectionChangedObservable}),(0,s.jsx)(sp,{globalState:this.props.globalState,gizmoCamera:this.props.gizmoCamera,contextMenuItems:l,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:u,label:"Nodes",offset:1,filter:this.state.filter}),e.skeletons.length>0&&(0,s.jsx)(sp,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:e.skeletons,label:"Skeletons",offset:1,filter:this.state.filter}),(0,s.jsx)(sp,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:h,contextMenuItems:p,label:"Materials",offset:1,filter:this.state.filter}),(0,s.jsx)(sp,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:r,label:"Textures",offset:1,filter:this.state.filter}),n.length>0&&(0,s.jsx)(sp,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:n,label:"Post-processes",offset:1,filter:this.state.filter}),(0,s.jsx)(sp,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,contextMenuItems:i,selectedEntity:this.state.selectedEntity,items:a,label:"Rendering pipelines",offset:1,filter:this.state.filter}),e.effectLayers&&e.effectLayers.length>0&&(0,s.jsx)(sp,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:e.effectLayers,label:"Effect layers",offset:1,filter:this.state.filter}),(0,s.jsx)(sp,{globalState:this.props.globalState,contextMenuItems:d,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:e.particleSystems,label:"Particle systems",offset:1,filter:this.state.filter}),(0,s.jsx)(sp,{globalState:this.props.globalState,contextMenuItems:c,forceSubitems:!0,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:e.spriteManagers,label:"Sprite managers",offset:1,filter:this.state.filter}),t&&t.length>0&&(0,s.jsx)(sp,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:t,label:"GUI",offset:1,filter:this.state.filter}),e.animationGroups.length>0&&(0,s.jsx)(sp,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:e.animationGroups,label:"Animation groups",offset:1,filter:this.state.filter}),e.mainSoundTrack&&e.mainSoundTrack.soundCollection.length>0&&(0,s.jsx)(sp,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:e.mainSoundTrack.soundCollection,label:"Sounds",offset:1,filter:this.state.filter}),this.props.additionalNodes&&this.props.additionalNodes.map((e=>(0,s.jsx)(sp,{globalState:this.props.globalState,extensibilityGroups:this.props.extensibilityGroups,selectedEntity:this.state.selectedEntity,items:e.getContent(),label:e.name,offset:1,filter:this.state.filter},e.name)))]})}onClose(){this.props.onClose&&this.props.onClose()}onPopup(){this.props.onPopup&&this.props.onPopup()}render(){return this.props.popupMode?(0,s.jsxs)("div",{id:"sceneExplorer",tabIndex:0,onKeyDown:e=>this.processKeys(e),children:[!this.props.noHeader&&(0,s.jsx)(bl,{title:"SCENE EXPLORER",noClose:this.props.noClose,noExpand:this.props.noExpand,noCommands:this.props.noCommands,onClose:()=>this.onClose(),onPopup:()=>this.onPopup()}),this.renderContent()]}):(this._once&&(this._once=!1,setTimeout((()=>{const e=document.getElementById("sceneExplorer");e&&(e.style.width="300px")}),150)),(0,s.jsxs)(Zo,{tabIndex:-1,id:"sceneExplorer",ref:this._sceneExplorerRef,size:{height:"100%"},minWidth:300,maxWidth:600,minHeight:"100%",enable:{top:!1,right:!0,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},onKeyDown:e=>this.processKeys(e),children:[!this.props.noHeader&&(0,s.jsx)(bl,{title:"SCENE EXPLORER",noClose:this.props.noClose,noExpand:this.props.noExpand,noCommands:this.props.noCommands,onClose:()=>this.onClose(),onPopup:()=>this.onPopup()}),this.renderContent()]}))}}var hp=p(7018),up={};up.styleTagTransform=Xn(),up.setAttributes=Zn(),up.insert=Wn().bind(null,"head"),up.domAPI=Hn(),up.insertStyleElement=Jn(),Gn()(hp.Z,up),hp.Z&&hp.Z.locals&&hp.Z.locals;const bp=p(4487).Z;class gp extends r.Component{constructor(e){super(e),this._once=!0,this._splitRef=r.createRef(),this._topPartRef=r.createRef(),this._bottomPartRef=r.createRef()}componentDidMount(){this._splitRef.current&&bp([this._topPartRef.current,this._bottomPartRef.current],{direction:"vertical",minSize:[200,200],gutterSize:4})}renderContent(){return this.props.popupMode?(0,s.jsxs)("div",{id:"split",className:"splitPopup",children:[(0,s.jsx)("div",{id:"topPart",children:(0,s.jsx)(dp,{scene:this.props.scene,extensibilityGroups:this.props.extensibilityGroups,additionalNodes:this.props.additionalNodes,popupMode:!0,globalState:this.props.globalState,noHeader:!0})}),(0,s.jsx)("div",{id:"separator"}),(0,s.jsx)("div",{id:"bottomPart",style:{marginTop:"4px",overflow:"hidden"},children:(0,s.jsx)(Ml,{scene:this.props.scene,popupMode:!0,globalState:this.props.globalState,noHeader:!0,initialTab:this.props.initialTab})})]}):(0,s.jsxs)("div",{ref:this._splitRef,id:"split",className:"noPopup",children:[(0,s.jsx)("div",{id:"topPart",ref:this._topPartRef,children:(0,s.jsx)(dp,{scene:this.props.scene,extensibilityGroups:this.props.extensibilityGroups,additionalNodes:this.props.additionalNodes,globalState:this.props.globalState,popupMode:!0,noHeader:!0})}),(0,s.jsx)("div",{id:"bottomPart",ref:this._bottomPartRef,style:{marginTop:"4px",overflow:"hidden"},children:(0,s.jsx)(Ml,{scene:this.props.scene,globalState:this.props.globalState,popupMode:!0,noHeader:!0,initialTab:this.props.initialTab})})]})}render(){return this.props.popupMode?(0,s.jsxs)("div",{id:"embed",children:[(0,s.jsx)(bl,{title:"INSPECTOR",noClose:this.props.noClose,noExpand:this.props.noExpand,handleBack:!0,onClose:()=>this.props.onClose(),onPopup:()=>this.props.onPopup(),onSelectionChangedObservable:this.props.globalState.onSelectionChangedObservable}),this.renderContent()]}):(this._once&&(this._once=!1,setTimeout((()=>{const e=document.getElementById("embed");e&&(e.style.width="300px")}),150)),(0,s.jsxs)(Zo,{id:"embed",minWidth:300,maxWidth:600,size:{height:"100%"},minHeight:"100%",enable:{top:!1,right:!1,bottom:!1,left:!0,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},children:[(0,s.jsx)(bl,{title:"INSPECTOR",noClose:this.props.noClose,noExpand:this.props.noExpand,handleBack:!0,onClose:()=>this.props.onClose(),onPopup:()=>this.props.onPopup(),onSelectionChangedObservable:this.props.globalState.onSelectionChangedObservable}),this.renderContent()]}))}}class mp{constructor(){this._sceneRecorder=new o.SceneRecorder,this._isRecording=!1}get isRecording(){return this._isRecording}cancel(){this._isRecording=!1}trackScene(e){this._sceneRecorder.track(e),this._isRecording=!0}applyDelta(e,t){o.SceneRecorder.ApplyDelta(e,t),this._isRecording=!1}export(){const e=JSON.stringify(this._sceneRecorder.getDelta());o.Tools.Download(new Blob([e]),"diff.json"),this._isRecording=!1}}class Ap{static MarkLineContainerTitleForHighlighting(e){this._GlobalState.selectedLineContainerTitles=[],this._GlobalState.selectedLineContainerTitles.push(e)}static MarkMultipleLineContainerTitlesForHighlighting(e){this._GlobalState.selectedLineContainerTitles=[],this._GlobalState.selectedLineContainerTitles.push(...e)}static _CopyStyles(e,t){for(let r=0;r{n.unmountComponentAtNode(this._SceneExplorerHost),this._RemoveElementFromDOM(this._SceneExplorerHost),t.popup&&this._SceneExplorerWindow.close(),t.popup=!t.popup,t.showExplorer=!0,t.showInspector=!1,t.explorerWidth=t.popup?"100%":"300px",Ap.Show(e,t)},onClose:()=>{n.unmountComponentAtNode(this._SceneExplorerHost),Ap._OpenedPane--,this._RemoveElementFromDOM(this._SceneExplorerHost),this._Cleanup(),t.popup&&this._SceneExplorerWindow.close(),this._GlobalState.onSceneExplorerClosedObservable.notifyObservers()}});n.render(o,this._SceneExplorerHost)}}static _CreateActionTabs(e,t,o){if(t.original=!1,o){const e=o.ownerDocument.createElement("div");e.id="inspector-host",e.style.width=t.inspectorWidth||"auto",o.appendChild(e),this._ActionTabsHost=e,t.overlay||(this._ActionTabsHost.style.position="relative")}if(this._ActionTabsHost){this._OpenedPane++;const o=r.createElement(Ml,{globalState:this._GlobalState,scene:e,noClose:!t.enableClose,noExpand:!t.enablePopup,popupMode:t.popup,onPopup:()=>{n.unmountComponentAtNode(this._ActionTabsHost),this._RemoveElementFromDOM(this._ActionTabsHost),t.popup&&this._ActionTabsWindow.close(),t.popup=!t.popup,t.showExplorer=!1,t.showInspector=!0,t.inspectorWidth=t.popup?"100%":"300px",Ap.Show(e,t)},onClose:()=>{n.unmountComponentAtNode(this._ActionTabsHost),Ap._OpenedPane--,this._Cleanup(),this._RemoveElementFromDOM(this._ActionTabsHost),t.popup&&this._ActionTabsWindow.close(),this._GlobalState.onActionTabsClosedObservable.notifyObservers()},initialTab:t.initialTab});n.render(o,this._ActionTabsHost)}}static _CreateEmbedHost(e,t,o,s){if(o){const e=o.ownerDocument.createElement("div");e.id="embed-host",e.style.width=t.embedHostWidth||"auto",o.appendChild(e),this._EmbedHost=e,t.overlay||(this._EmbedHost.style.position="relative")}if(this._EmbedHost){this._OpenedPane++;const o=r.createElement(gp,{globalState:this._GlobalState,scene:e,extensibilityGroups:t.explorerExtensibility,additionalNodes:t.additionalNodes,noExpand:!t.enablePopup,noClose:!t.enableClose,popupMode:t.popup,onPopup:()=>{n.unmountComponentAtNode(this._EmbedHost),t.popup&&this._EmbedHostWindow.close(),this._RemoveElementFromDOM(this._EmbedHost),t.popup=!t.popup,t.embedMode=!0,t.showExplorer=!0,t.showInspector=!0,t.embedHostWidth=t.popup?"100%":"auto",Ap.Show(e,t)},onClose:()=>{n.unmountComponentAtNode(this._EmbedHost),this._OpenedPane=0,this._Cleanup(),this._RemoveElementFromDOM(this._EmbedHost),t.popup&&this._EmbedHostWindow.close(),this._GlobalState.onSceneExplorerClosedObservable.notifyObservers(),this._GlobalState.onActionTabsClosedObservable.notifyObservers()},initialTab:t.initialTab});n.render(o,this._EmbedHost)}}static _CreatePopup(e,t,r=300,n=800,o){const s={width:r,height:n,top:(window.innerHeight-r)/2+window.screenY,left:(window.innerWidth-n)/2+window.screenX},a=Object.keys(s).map((e=>e+"="+s[e])).join(","),i=window.open("",e,a);if(!i)return null;const l=i.document,p=l.createElement("link");p.rel="stylesheet",p.href="https://use.typekit.net/cta4xsb.css",l.head.appendChild(p),l.title=e,l.body.style.width="100%",l.body.style.height="100%",l.body.style.margin="0",l.body.style.padding="0";const c=l.createElement("div");return c.style.width="100%",c.style.height="100%",c.style.margin="0",c.style.padding="0",i.document.body.appendChild(c),this._CopyStyles(window.document,l),o&&setTimeout((()=>{this._CopyStyles(window.document,l)}),0),this[t]=i,c}static get IsVisible(){return this._OpenedPane>0}static EarlyAttachToLoader(){this._GlobalState.onPluginActivatedObserver||(this._GlobalState.onPluginActivatedObserver=o.SceneLoader.OnPluginActivatedObservable.add((e=>{this._GlobalState.resetGLTFValidationResults();const t=e;"gltf"===t.name&&this._GlobalState.prepareGLTFPlugin(t)})))}static Show(e,t){const r={original:!0,popup:!1,overlay:!1,showExplorer:!0,showInspector:!0,embedMode:!1,enableClose:!0,handleResize:!0,enablePopup:!0,...t};this._GlobalState.onPropertyChangedObservable||this._GlobalState.init(this.OnPropertyChangedObservable),this._GlobalState.onSelectionChangedObservable||(this._GlobalState.onSelectionChangedObservable=this.OnSelectionChangeObservable),this.IsVisible&&r.original&&this.Hide(),e||(e=o.EngineStore.LastCreatedScene),this._Scene=e;const n=e?e.getEngine().getInputElement():o.EngineStore.LastCreatedEngine.getInputElement();if(r.embedMode&&r.showExplorer&&r.showInspector)if(r.popup)this._CreateEmbedHost(e,r,this._CreatePopup("INSPECTOR","_EmbedHostWindow"),Ap.OnSelectionChangeObservable),this._EmbedHostWindow.addEventListener("beforeunload",(()=>this._GlobalState.onSceneExplorerClosedObservable.notifyObservers())),this._EmbedHostWindow.addEventListener("beforeunload",(()=>this._GlobalState.onActionTabsClosedObservable.notifyObservers()));else{if(!n)return;let t=r.globalRoot?r.globalRoot:n.parentElement;r.overlay||this._NewCanvasContainer?!r.overlay&&this._NewCanvasContainer&&this._NewCanvasContainer.parentElement&&(t=this._NewCanvasContainer.parentElement):this._CreateCanvasContainer(t),this._NewCanvasContainer&&r.handleResize&&e&&(this._OnBeforeRenderObserver=e.onBeforeRenderObservable.add((()=>{e.getEngine().resize()}))),this._CreateEmbedHost(e,r,t,Ap.OnSelectionChangeObservable)}else if(r.popup)r.showExplorer&&(this._SceneExplorerHost&&(this._SceneExplorerHost.style.width="0"),this._CreateSceneExplorer(e,r,this._CreatePopup("SCENE EXPLORER","_SceneExplorerWindow")),this._SceneExplorerWindow.addEventListener("beforeunload",(()=>this._GlobalState.onSceneExplorerClosedObservable.notifyObservers()))),r.showInspector&&(this._ActionTabsHost&&(this._ActionTabsHost.style.width="0"),this._CreateActionTabs(e,r,this._CreatePopup("INSPECTOR","_ActionTabsWindow")),this._ActionTabsWindow.addEventListener("beforeunload",(()=>this._GlobalState.onActionTabsClosedObservable.notifyObservers())));else{let t=r.globalRoot?r.globalRoot:n.parentElement;r.overlay||this._NewCanvasContainer?!r.overlay&&this._NewCanvasContainer&&this._NewCanvasContainer.parentElement&&(t=this._NewCanvasContainer.parentElement):this._CreateCanvasContainer(t),this._NewCanvasContainer&&r.handleResize&&e&&(this._OnBeforeRenderObserver=e.onBeforeRenderObservable.add((()=>{e.getEngine().resize()}))),r.showExplorer&&this._CreateSceneExplorer(e,r,t),r.showInspector&&this._CreateActionTabs(e,r,t)}}static _SetNewScene(e){this._Scene=e,this._GlobalState.onNewSceneObservable.notifyObservers(e)}static _CreateCanvasContainer(e){for(this._NewCanvasContainer=e.ownerDocument.createElement("div"),this._NewCanvasContainer.style.display=e.style.display,e.style.display="flex";e.childElementCount>0;){const t=e.childNodes[0];e.removeChild(t),this._NewCanvasContainer.appendChild(t)}e.appendChild(this._NewCanvasContainer),this._NewCanvasContainer.style.width="100%",this._NewCanvasContainer.style.height="100%"}static _DestroyCanvasContainer(){if(!this._NewCanvasContainer)return;const e=this._NewCanvasContainer.parentElement;for(;this._NewCanvasContainer.childElementCount>0;){const t=this._NewCanvasContainer.childNodes[0];this._NewCanvasContainer.removeChild(t),e.appendChild(t)}e.removeChild(this._NewCanvasContainer),e.style.display=this._NewCanvasContainer.style.display,this._NewCanvasContainer=null}static _Cleanup(){0===Ap._OpenedPane&&(this._GlobalState.lightGizmos.forEach((e=>{e.light&&this._GlobalState.enableLightGizmo(e.light,!1)})),this._GlobalState.cameraGizmos.forEach((e=>{e.camera&&this._GlobalState.enableCameraGizmo(e.camera,!1)})),this._Scene&&this._Scene.reservedDataStore&&this._Scene.reservedDataStore.gizmoManager&&(this._Scene.reservedDataStore.gizmoManager.dispose(),this._Scene.reservedDataStore.gizmoManager=null),this._NewCanvasContainer&&this._DestroyCanvasContainer(),this._OnBeforeRenderObserver&&this._Scene&&(this._Scene.onBeforeRenderObservable.remove(this._OnBeforeRenderObserver),this._OnBeforeRenderObserver=null,this._Scene.getEngine().resize()),this._GlobalState.onInspectorClosedObservable.notifyObservers(this._Scene))}static _RemoveElementFromDOM(e){e&&e.parentElement&&e.parentElement.removeChild(e)}static Hide(){this._ActionTabsHost&&(n.unmountComponentAtNode(this._ActionTabsHost),this._RemoveElementFromDOM(this._ActionTabsHost),this._ActionTabsHost=null,this._GlobalState.onActionTabsClosedObservable.notifyObservers()),this._SceneExplorerHost&&(n.unmountComponentAtNode(this._SceneExplorerHost),this._SceneExplorerHost.parentElement&&this._SceneExplorerHost.parentElement.removeChild(this._SceneExplorerHost),this._SceneExplorerHost=null,this._GlobalState.onSceneExplorerClosedObservable.notifyObservers()),this._EmbedHost&&(n.unmountComponentAtNode(this._EmbedHost),this._EmbedHost.parentElement&&this._EmbedHost.parentElement.removeChild(this._EmbedHost),this._EmbedHost=null,this._GlobalState.onActionTabsClosedObservable.notifyObservers(),this._GlobalState.onSceneExplorerClosedObservable.notifyObservers()),Ap._OpenedPane=0,this._Cleanup(),this._GlobalState.onPluginActivatedObserver||(o.SceneLoader.OnPluginActivatedObservable.remove(this._GlobalState.onPluginActivatedObserver),this._GlobalState.onPluginActivatedObserver=null)}static _CreatePersistentPopup(e,t){this._PersistentPopupHost&&this._ClosePersistentPopup(),this._PersistentPopupHost=t.ownerDocument.createElement("div");const o=r.createElement(cs,e.props,e.children);n.render(o,this._PersistentPopupHost),e.closeWhenSceneExplorerCloses&&(this._OnSceneExplorerClosedObserver=this._GlobalState.onSceneExplorerClosedObservable.add((()=>this._ClosePersistentPopup()))),e.closeWhenActionTabsCloses&&(this._OnActionTabsClosedObserver=this._GlobalState.onActionTabsClosedObservable.add((()=>this._ClosePersistentPopup())))}static _ClosePersistentPopup(){this._PersistentPopupHost&&(n.unmountComponentAtNode(this._PersistentPopupHost),this._PersistentPopupHost.remove(),this._PersistentPopupHost=null),this._OnSceneExplorerClosedObserver&&(this._GlobalState.onSceneExplorerClosedObservable.remove(this._OnSceneExplorerClosedObserver),this._OnSceneExplorerClosedObserver=null),this._OnActionTabsClosedObserver&&(this._GlobalState.onActionTabsClosedObservable.remove(this._OnActionTabsClosedObserver),this._OnActionTabsClosedObserver=null)}}Ap._OpenedPane=0,Ap.OnSelectionChangeObservable=new o.Observable,Ap.OnPropertyChangedObservable=new o.Observable,Ap._GlobalState=new class{constructor(){this.onInspectorClosedObservable=new o.Observable,this.onTabChangedObservable=new o.Observable,this.onSelectionRenamedObservable=new o.Observable,this.onNewSceneObservable=new o.Observable,this.sceneImportDefaults={},this.validationResults=null,this.onValidationResultsUpdatedObservable=new o.Observable,this.glTFLoaderExtensionDefaults={MSFT_lod:{enabled:!0,maxLODsToLoad:10},MSFT_minecraftMesh:{enabled:!0},MSFT_sRGBFactors:{enabled:!0},MSFT_audio_emitter:{enabled:!0},KHR_xmp_json_ld:{enabled:!0},KHR_draco_mesh_compression:{enabled:!0},KHR_mesh_quantization:{enabled:!0},KHR_materials_pbrSpecularGlossiness:{enabled:!0},KHR_materials_clearcoat:{enabled:!0},KHR_materials_iridescence:{enabled:!0},KHR_materials_anisotropy:{enabled:!0},KHR_materials_emissive_strength:{enabled:!0},KHR_materials_ior:{enabled:!0},KHR_materials_sheen:{enabled:!0},KHR_materials_specular:{enabled:!0},KHR_materials_unlit:{enabled:!0},KHR_materials_variants:{enabled:!0},KHR_materials_transmission:{enabled:!0},KHR_materials_translucency:{enabled:!0},KHR_materials_volume:{enabled:!0},KHR_lights_punctual:{enabled:!0},KHR_texture_basisu:{enabled:!0},KHR_texture_transform:{enabled:!0},EXT_lights_image_based:{enabled:!0},EXT_mesh_gpu_instancing:{enabled:!0},EXT_texture_webp:{enabled:!0}},this.glTFLoaderDefaults={alwaysComputeBoundingBox:!1,alwaysComputeSkeletonRootNode:!1,animationStartMode:void 0!==ml.GLTFLoaderAnimationStartMode?ml.GLTFLoaderAnimationStartMode.FIRST:1,capturePerformanceCounters:!1,compileMaterials:!1,compileShadowGenerators:!1,coordinateSystemMode:void 0!==ml.GLTFLoaderCoordinateSystemMode?ml.GLTFLoaderCoordinateSystemMode.AUTO:0,createInstances:!0,loadAllMaterials:!1,loggingEnabled:!1,targetFps:60,transparencyAsCoverage:!1,useClipPlane:!1,useSRGBBuffers:!0},this.glTFLoaderExtensions={},this.blockMutationUpdates=!1,this.selectedLineContainerTitles=[],this.selectedLineContainerTitlesNoFocus=[],this.recorder=new mp,this._onlyUseEulers=null,this._ignoreBackfacesForPicking=null,this.lightGizmos=[],this.cameraGizmos=[],this.onSceneExplorerClosedObservable=new o.Observable,this.onActionTabsClosedObservable=new o.Observable}get onlyUseEulers(){return null===this._onlyUseEulers&&(this._onlyUseEulers=o.DataStorage.ReadBoolean("settings_onlyUseEulers",!0)),this._onlyUseEulers}set onlyUseEulers(e){this._onlyUseEulers=e,o.DataStorage.WriteBoolean("settings_onlyUseEulers",e)}get ignoreBackfacesForPicking(){return null===this._ignoreBackfacesForPicking&&(this._ignoreBackfacesForPicking=o.DataStorage.ReadBoolean("settings_ignoreBackfacesForPicking",!1)),this._ignoreBackfacesForPicking}set ignoreBackfacesForPicking(e){this._ignoreBackfacesForPicking=e,o.DataStorage.WriteBoolean("settings_ignoreBackfacesForPicking",e)}init(e){this.onPropertyChangedObservable=e,this.onNewSceneObservable.add((()=>{this.recorder.cancel()}))}prepareGLTFPlugin(e){this.glTFLoaderExtensions={};const t=this.glTFLoaderDefaults;if(void 0!==t)for(const r in t)e[r]=t[r];e.onExtensionLoadedObservable.add((e=>{const t=this.glTFLoaderExtensionDefaults[e.name];if(void 0!==t)for(const r in t)e[r]=t[r];this.glTFLoaderExtensions[e.name]=e})),e.onValidatedObservable.add((e=>{this.validationResults=e,this.onValidationResultsUpdatedObservable.notifyObservers(e),(e.issues.numErrors||e.issues.numWarnings)&&(this.selectedLineContainerTitlesNoFocus.push("GLTF VALIDATION"),this.onTabChangedObservable.notifyObservers(3))}))}resetGLTFValidationResults(){this.validationResults&&(this.validationResults=null,this.onValidationResultsUpdatedObservable.notifyObservers(null))}enableLightGizmo(e,t=!0,r=null){t?(e.reservedDataStore||(e.reservedDataStore={}),e.reservedDataStore.lightGizmo||(e.reservedDataStore.lightGizmo=new o.LightGizmo,this.lightGizmos.push(e.reservedDataStore.lightGizmo),e.reservedDataStore.lightGizmo.light=e,e.reservedDataStore.lightGizmo.material.reservedDataStore={hidden:!0},r&&e.reservedDataStore.lightGizmo.gizmoLayer.setRenderCamera(r))):e.reservedDataStore&&e.reservedDataStore.lightGizmo&&(this.lightGizmos.splice(this.lightGizmos.indexOf(e.reservedDataStore.lightGizmo),1),e.reservedDataStore.lightGizmo.dispose(),e.reservedDataStore.lightGizmo=null)}enableCameraGizmo(e,t=!0,r=null){t?(e.reservedDataStore||(e.reservedDataStore={}),e.reservedDataStore.cameraGizmo||(e.reservedDataStore.cameraGizmo=new o.CameraGizmo,this.cameraGizmos.push(e.reservedDataStore.cameraGizmo),e.reservedDataStore.cameraGizmo.camera=e,e.reservedDataStore.cameraGizmo.material.reservedDataStore={hidden:!0},r&&e.reservedDataStore.cameraGizmo.gizmoLayer.setRenderCamera(r))):e.reservedDataStore&&e.reservedDataStore.cameraGizmo&&(this.cameraGizmos.splice(this.cameraGizmos.indexOf(e.reservedDataStore.cameraGizmo),1),e.reservedDataStore.cameraGizmo.dispose(),e.reservedDataStore.cameraGizmo=null)}},Ap.EarlyAttachToLoader();const Cp=void 0!==p.g?p.g:"undefined"!=typeof window?window:void 0;void 0!==Cp&&(Cp.BABYLON=Cp.BABYLON||{},Cp.BABYLON.Inspector=Ap,Cp.INSPECTOR=e);const fp=t})(),c.default})()));
+//# sourceMappingURL=babylon.inspector.bundle.js.map
\ No newline at end of file
diff --git a/libs/babylonjs/6.23.0/babylon.js b/libs/babylonjs/6.23.0/babylon.js
new file mode 100644
index 00000000..dc792c85
--- /dev/null
+++ b/libs/babylonjs/6.23.0/babylon.js
@@ -0,0 +1,2 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("babylonjs",[],t):"object"==typeof exports?exports.babylonjs=t():e.BABYLON=t()}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(()=>(()=>{"use strict";var e={d:(t,i)=>{for(var r in i)e.o(i,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:i[r]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.d(t,{default:()=>uM});var i={};e.r(i),e.d(i,{AxesViewer:()=>_u,BoneAxesViewer:()=>mu,DebugLayer:()=>gu,DebugLayerTab:()=>du,DirectionalLightFrustumViewer:()=>Wh,PhysicsViewer:()=>kh,RayHelper:()=>Gh,SkeletonViewer:()=>zh});var r={};e.r(r),e.d(r,{AbstractActionManager:()=>s,AbstractAssetTask:()=>gA,AbstractMesh:()=>Un,AbstractScene:()=>o,AcquireNativeObjectAsync:()=>Yd,Action:()=>k,ActionEvent:()=>G,ActionManager:()=>de,AddBlock:()=>oy,AddressMode:()=>lp,AdvancedTimer:()=>Fm,AlignBlock:()=>cE,AlphaState:()=>Wt,AmmoJSPlugin:()=>xg,AnaglyphArcRotateCamera:()=>Ol,AnaglyphFreeCamera:()=>Dl,AnaglyphGamepadCamera:()=>Nl,AnaglyphPostProcess:()=>Il,AnaglyphUniversalCamera:()=>Fl,Analyser:()=>so,AndOrNotEvaluator:()=>_e,Angle:()=>Nr,Animatable:()=>Pr,AnimatedInputBlockTypes:()=>va,Animation:()=>Ye,AnimationAssetTask:()=>TA,AnimationEvent:()=>Zr,AnimationGroup:()=>$r,AnimationGroupMask:()=>tn,AnimationGroupMaskMode:()=>Or,AnimationKeyInterpolation:()=>Be,AnimationPropertiesOverride:()=>Mr,AnimationRange:()=>ke,AnisotropyBlock:()=>jy,ApplyPostProcess:()=>cd,Arc2:()=>Fr,ArcFollowCamera:()=>fl,ArcRotateCamera:()=>sl,ArcRotateCameraGamepadInput:()=>ws,ArcRotateCameraInputsManager:()=>ks,ArcRotateCameraKeyboardMoveInput:()=>Bs,ArcRotateCameraMouseWheelInput:()=>Us,ArcRotateCameraPointersInput:()=>Vs,ArcRotateCameraVRDeviceOrientationInput:()=>Gs,ArcTan2Block:()=>Py,AssetContainer:()=>ao,AssetTaskState:()=>fA,AssetsManager:()=>IA,AssetsProgressEvent:()=>vA,AsyncLoop:()=>Ci,AttachToBoxBehavior:()=>Oo,AudioEngine:()=>lo,AudioSceneComponent:()=>ho,AutoLayoutMode:()=>yp,AutoReleaseWorkerPool:()=>am,AutoRotationBehavior:()=>Co,AxesViewer:()=>_u,Axis:()=>Rr,AxisDragGizmo:()=>fu,AxisScaleGizmo:()=>r_,BRDFTextureTools:()=>P_,BabylonFileLoaderConfiguration:()=>Cg,BackEase:()=>kr,BackgroundMaterial:()=>E_,BakedVertexAnimationManager:()=>fo,BallAndSocketConstraint:()=>TS,BaseCameraMouseWheelInput:()=>Is,BaseCameraPointersInput:()=>Ms,BaseError:()=>ut,BaseParticleSystem:()=>Ya,BaseSixDofDragBehavior:()=>Go,BaseTexture:()=>mo,BasisTools:()=>gv,BasisToolsOptions:()=>cv,BasisTranscodeConfiguration:()=>lv,BezierCurve:()=>Dr,BezierCurveEase:()=>qr,BiPlanarBlock:()=>lb,BinaryFileAssetTask:()=>SA,BlackAndWhitePostProcess:()=>YS,BlendFactor:()=>xp,BlendOperation:()=>Ap,BloomEffect:()=>ZS,BloomMergePostProcess:()=>qS,BlurPostProcess:()=>v_,Bone:()=>Cr,BoneAxesViewer:()=>mu,BoneIKController:()=>As,BoneLookController:()=>Rs,BonesBlock:()=>Mv,BooleanGeometryBlock:()=>CE,BooleanGeometryOperations:()=>AE,BounceEase:()=>Gr,BouncingBehavior:()=>Po,BoundingBlock:()=>RE,BoundingBox:()=>pn,BoundingBoxGizmo:()=>n_,BoundingBoxRenderer:()=>Bx,BoundingInfo:()=>yn,BoundingSphere:()=>fn,BoxBlock:()=>ST,BoxBuilder:()=>Tu,BoxParticleEmitter:()=>Ba,Buffer:()=>Hi,BufferBindingType:()=>pp,BufferMapState:()=>ep,BufferUsage:()=>tp,CSG:()=>Yb,Camera:()=>hn,CameraGizmo:()=>g_,CameraInputTypes:()=>Os,CameraInputsManager:()=>Ds,CannonJSPlugin:()=>Eg,CanvasAlphaMode:()=>Lp,CapsuleBlock:()=>NT,CapsuleBuilder:()=>Cu,CascadedShadowGenerator:()=>cg,ChromaticAberrationPostProcess:()=>JS,CircleEase:()=>Vr,CircleOfConfusionPostProcess:()=>$S,ClampBlock:()=>sy,ClearCoatBlock:()=>Ky,ClipPlanesBlock:()=>ty,ClipboardEventTypes:()=>Yf,ClipboardInfo:()=>Kf,CloudBlock:()=>nb,CloudPoint:()=>ZE,Collider:()=>tu,Color3:()=>B,Color3Gradient:()=>wE,Color4:()=>U,ColorCorrectionPostProcess:()=>ex,ColorCurves:()=>Di,ColorGradient:()=>LE,ColorGradingTexture:()=>Gg,ColorMergerBlock:()=>dy,ColorSplitterBlock:()=>Ka,ColorWrite:()=>Sp,CombineAction:()=>se,CompareFunction:()=>hp,CompatibilityOptions:()=>Cn,CompilationMessageType:()=>gp,CompleteGreasedLineColorTable:()=>mT,CompleteGreasedLineWidthTable:()=>_T,ComputeBindingType:()=>ru,ComputeEffect:()=>nu,ComputeNormalsBlock:()=>JT,ComputePassTimestampLocation:()=>Mp,ComputeShader:()=>ou,ComputeShaderParticleSystem:()=>NE,Condition:()=>Q,ConditionBlock:()=>jT,ConditionBlockTests:()=>WT,ConditionalBlock:()=>rb,ConditionalBlockConditions:()=>tb,ConeParticleEmitter:()=>Ua,Constants:()=>a,ContainerAssetTask:()=>yA,ConversionMode:()=>iA,ConvolutionPostProcess:()=>tx,Coordinate:()=>Ar,CopyTextureToTexture:()=>oA,CopyTools:()=>bo,CreateBox:()=>bu,CreateBoxVertexData:()=>vu,CreateCapsule:()=>Ru,CreateCapsuleVertexData:()=>Au,CreateCylinder:()=>Lc,CreateCylinderVertexData:()=>Fc,CreateDashedLines:()=>Zu,CreateDashedLinesVertexData:()=>Ku,CreateDecal:()=>Ah,CreateDisc:()=>Du,CreateDiscVertexData:()=>Ou,CreateEnvTextureAsync:()=>Sd,CreateGeodesic:()=>Oh,CreateGoldberg:()=>Fh,CreateGoldbergVertexData:()=>Nh,CreateGreasedLine:()=>fT,CreateGreasedLineMaterial:()=>pT,CreateGround:()=>Hc,CreateGroundFromHeightMap:()=>jc,CreateGroundFromHeightMapVertexData:()=>Wc,CreateGroundVertexData:()=>Gc,CreateHemisphere:()=>p_,CreateIcoSphere:()=>ds,CreateIcoSphereVertexData:()=>hs,CreateImageDataArrayBufferViews:()=>Ad,CreateLathe:()=>hh,CreateLineSystem:()=>Qu,CreateLineSystemVertexData:()=>Yu,CreateLines:()=>qu,CreatePlane:()=>wo,CreatePlaneVertexData:()=>Lo,CreatePolygon:()=>nh,CreatePolygonVertexData:()=>rh,CreatePolyhedron:()=>mh,CreatePolyhedronVertexData:()=>_h,CreateResizedCopy:()=>ld,CreateRibbon:()=>Iu,CreateRibbonVertexData:()=>Pu,CreateScreenshot:()=>JA,CreateScreenshotAsync:()=>$A,CreateScreenshotUsingRenderTarget:()=>tR,CreateScreenshotUsingRenderTargetAsync:()=>iR,CreateScreenshotWithResizeAsync:()=>eR,CreateSegmentedBoxVertexData:()=>yu,CreateSphere:()=>Su,CreateSphereVertexData:()=>Eu,CreateText:()=>Uh,CreateTextShapePaths:()=>Bh,CreateTiledBox:()=>Uu,CreateTiledBoxVertexData:()=>Bu,CreateTiledGround:()=>Xc,CreateTiledGroundVertexData:()=>zc,CreateTiledPlane:()=>Lu,CreateTiledPlaneVertexData:()=>Fu,CreateTorus:()=>Uc,CreateTorusKnot:()=>Gu,CreateTorusKnotVertexData:()=>ku,CreateTorusVertexData:()=>Bc,CreateTube:()=>ph,CrossBlock:()=>ly,CubeMapToSphericalPolynomialTools:()=>gd,CubeTexture:()=>b_,CubeTextureAssetTask:()=>RA,CubicEase:()=>zr,CullMode:()=>Ep,CurrentScreenBlock:()=>Aa,Curve3:()=>Br,CurveBlock:()=>fb,CurveBlockTypes:()=>db,CustomBlock:()=>cy,CustomOptimization:()=>kA,CustomParticleEmitter:()=>Xa,CustomProceduralTexture:()=>Sv,CylinderBlock:()=>DT,CylinderBuilder:()=>wc,CylinderDirectedParticleEmitter:()=>ka,CylinderParticleEmitter:()=>Va,DDSTools:()=>J_,DataBuffer:()=>Qt,DataReader:()=>sR,DataStorage:()=>lR,Database:()=>ME,DaydreamController:()=>Qf,DebugBlock:()=>mE,DebugLayer:()=>gu,DebugLayerTab:()=>du,DecalBuilder:()=>Rh,DecalMapConfiguration:()=>Eb,DecalMapDefines:()=>Tb,Decode:()=>_t,DecodeBase64ToBinary:()=>vt,DecodeBase64ToString:()=>gt,DecodeBase64UrlToBinary:()=>vi,DecodeBase64UrlToString:()=>bi,DeepCopier:()=>he,DefaultCollisionCoordinator:()=>iu,DefaultKTX2DecoderOptions:()=>cm,DefaultLoadingScreen:()=>dg,DefaultRenderingPipeline:()=>Tx,Deferred:()=>MA,DepthCullingState:()=>Gt,DepthOfFieldBlurPostProcess:()=>ix,DepthOfFieldEffect:()=>ox,DepthOfFieldEffectBlurLevel:()=>rx,DepthOfFieldMergePostProcess:()=>nx,DepthPeelingRenderer:()=>kx,DepthPeelingSceneComponent:()=>Gx,DepthReducer:()=>rg,DepthRenderer:()=>tg,DepthRendererSceneComponent:()=>Ux,DepthSortedParticle:()=>KE,DerivativeBlock:()=>Vv,DesaturateBlock:()=>Hy,DetailMapConfiguration:()=>mc,DeviceInputEventType:()=>zi,DeviceLostReason:()=>wp,DeviceOrientationCamera:()=>ll,DeviceSource:()=>dr,DeviceSourceManager:()=>fr,DeviceType:()=>Li,DirectionalLight:()=>d_,DirectionalLightFrustumViewer:()=>Wh,DiscBlock:()=>FT,DiscBuilder:()=>Nu,DiscardBlock:()=>Bv,DisplayPassPostProcess:()=>ax,DistanceBlock:()=>Sy,DistanceConstraint:()=>ES,DistanceJoint:()=>Qo,DivideBlock:()=>_y,DoNothingAction:()=>ae,DomManagement:()=>at,DotBlock:()=>uy,DracoCompression:()=>kb,DrawWrapper:()=>$t,DualSenseInput:()=>Vi,DualShockButton:()=>yl,DualShockDpad:()=>bl,DualShockInput:()=>Ui,DualShockPad:()=>El,DumpTools:()=>is,DynamicFloat32Array:()=>gR,DynamicTexture:()=>bc,EasingFunction:()=>Ur,EdgesRenderer:()=>Wx,Effect:()=>kt,EffectFallbacks:()=>Ia,EffectLayer:()=>Hm,EffectLayerSceneComponent:()=>Xm,EffectRenderer:()=>qa,EffectWrapper:()=>Za,ElasticEase:()=>Wr,ElbowBlock:()=>ab,EncodeArrayBufferToBase64:()=>mt,EndsWith:()=>pt,Engine:()=>Dn,EngineFactory:()=>jf,EngineFormat:()=>rm,EngineInstrumentation:()=>zm,EngineStore:()=>S,EngineView:()=>Qh,EnvironmentHelper:()=>S_,EnvironmentTextureTools:()=>Od,Epsilon:()=>_,EquiRectangularCubeTexture:()=>zg,EquiRectangularCubeTextureAssetTask:()=>PA,ErrorCodes:()=>ht,ErrorFilter:()=>Bp,EventConstants:()=>sr,EventState:()=>l,ExecuteCodeAction:()=>le,ExponentialEase:()=>Hr,ExternalTexture:()=>mf,ExtractHighlightsPostProcess:()=>QS,ExtrudePolygon:()=>oh,ExtrudeShape:()=>sh,ExtrudeShapeCustom:()=>lh,FactorGradient:()=>BE,FadeInOutBehavior:()=>Do,FeatureName:()=>$d,FileTools:()=>yi,FileToolsOptions:()=>li,FilesInput:()=>DA,FilesInputStore:()=>lt,FilterMode:()=>cp,FilterPostProcess:()=>sx,FlowGraph:()=>yC,FlowGraphACosNumberBlock:()=>ZP,FlowGraphASinNumberBlock:()=>qP,FlowGraphATan2NumberBlock:()=>tI,FlowGraphATanNumberBlock:()=>JP,FlowGraphAbsNumberBlock:()=>BP,FlowGraphAddMatrixAndNumberBlock:()=>HI,FlowGraphAddMatrixBlock:()=>WI,FlowGraphAddNumberBlock:()=>PP,FlowGraphAddVector2Block:()=>hI,FlowGraphAddVector3Block:()=>TI,FlowGraphAddVector4Block:()=>FI,FlowGraphBitwiseAndBlock:()=>mP,FlowGraphBitwiseLeftShiftBlock:()=>bP,FlowGraphBitwiseNotBlock:()=>yP,FlowGraphBitwiseOrBlock:()=>gP,FlowGraphBitwiseRightShiftBlock:()=>TP,FlowGraphBitwiseXorBlock:()=>vP,FlowGraphBlock:()=>EC,FlowGraphBranchBlock:()=>YC,FlowGraphCeilNumberBlock:()=>kP,FlowGraphClampMatrixBlock:()=>ZI,FlowGraphComposeMatrixBlock:()=>$I,FlowGraphConditionalDataBlock:()=>uP,FlowGraphConstantBlock:()=>pP,FlowGraphContext:()=>mC,FlowGraphCoordinateTransformBlock:()=>dP,FlowGraphCoordinator:()=>GC,FlowGraphCosNumberBlock:()=>KP,FlowGraphCountLeadingZerosBlock:()=>EP,FlowGraphCountTrailingZerosBlock:()=>SP,FlowGraphCounterBlock:()=>tP,FlowGraphCreateVector2Block:()=>vI,FlowGraphCreateVector3Block:()=>MI,FlowGraphCreateVector4Block:()=>GI,FlowGraphCrossVector3Block:()=>II,FlowGraphDebounceBlock:()=>rP,FlowGraphDecomposeMatrixBlock:()=>JI,FlowGraphDivideMatrixAndNumberBlock:()=>QI,FlowGraphDivideMatrixBlock:()=>KI,FlowGraphDivideNumberBlock:()=>OP,FlowGraphDivideVector2Block:()=>fI,FlowGraphDivideVector3Block:()=>xI,FlowGraphDivideVector4Block:()=>BI,FlowGraphDoNBlock:()=>KC,FlowGraphDotVector3Block:()=>PI,FlowGraphENumberBlock:()=>$P,FlowGraphEqualsNumberBlock:()=>oI,FlowGraphEventBlock:()=>RC,FlowGraphEventCoordinator:()=>CC,FlowGraphExecutionBlock:()=>xC,FlowGraphExpNumberBlock:()=>WP,FlowGraphFlipFlopBlock:()=>nP,FlowGraphFloorNumberBlock:()=>VP,FlowGraphForLoopBlock:()=>QC,FlowGraphGetTransformationMatrixBlock:()=>tM,FlowGraphGetVariableBlock:()=>hP,FlowGraphGreaterThanNumberBlock:()=>aI,FlowGraphGreaterThanOrEqualsNumberBlock:()=>sI,FlowGraphIsInfinityNumberBlock:()=>LP,FlowGraphIsNaNNumberBlock:()=>FP,FlowGraphLengthVector2Block:()=>mI,FlowGraphLengthVector3Block:()=>RI,FlowGraphLengthVector4Block:()=>VI,FlowGraphLessThanNumberBlock:()=>lI,FlowGraphLessThanOrEqualsNumberBlock:()=>cI,FlowGraphLnNumberBlock:()=>jP,FlowGraphLog10NumberBlock:()=>HP,FlowGraphLogBlock:()=>WC,FlowGraphLogNumberBlock:()=>XP,FlowGraphLogicAndBlock:()=>xP,FlowGraphLogicNotBlock:()=>RP,FlowGraphLogicOrBlock:()=>AP,FlowGraphMaxNumberBlock:()=>nI,FlowGraphMeshPickEventBlock:()=>iM,FlowGraphMinNumberBlock:()=>rI,FlowGraphMixNumberBlock:()=>uI,FlowGraphModNumberBlock:()=>DP,FlowGraphMultiGateBlock:()=>JC,FlowGraphMultiplyMatrixBlock:()=>YI,FlowGraphMultiplyNumberBlock:()=>MP,FlowGraphMultiplyVector2Block:()=>pI,FlowGraphMultiplyVector3Block:()=>SI,FlowGraphMultiplyVector4Block:()=>wI,FlowGraphNegateNumberBlock:()=>UP,FlowGraphNormalizeVector2Block:()=>gI,FlowGraphNormalizeVector3Block:()=>CI,FlowGraphNormalizeVector4Block:()=>kI,FlowGraphPauseAnimationBlock:()=>sP,FlowGraphPiNumberBlock:()=>eI,FlowGraphPlayAnimationBlock:()=>oP,FlowGraphPlayAudioBlock:()=>lP,FlowGraphPowNumberBlock:()=>NP,FlowGraphQuaternionToRotationMatrixBlock:()=>eM,FlowGraphRandomNumberBlock:()=>iI,FlowGraphReceiveCustomEventBlock:()=>nM,FlowGraphRotate2dVector2Block:()=>bI,FlowGraphRotate3dVector3Block:()=>DI,FlowGraphRoundNumberBlock:()=>GP,FlowGraphScaleMatrixBlock:()=>qI,FlowGraphScaleVector2Block:()=>_I,FlowGraphScaleVector3Block:()=>AI,FlowGraphScaleVector4Block:()=>UI,FlowGraphSceneReadyEventBlock:()=>rM,FlowGraphSceneTickEventBlock:()=>oM,FlowGraphSendCustomEventBlock:()=>jC,FlowGraphSetPropertyBlock:()=>XC,FlowGraphSetVariableBlock:()=>HC,FlowGraphSignalConnection:()=>SC,FlowGraphSinNumberBlock:()=>YP,FlowGraphSplitVector2Block:()=>yI,FlowGraphSplitVector3Block:()=>OI,FlowGraphSplitVector4Block:()=>zI,FlowGraphSqrtNumberBlock:()=>wP,FlowGraphState:()=>_C,FlowGraphStopAnimationBlock:()=>aP,FlowGraphStopAudioBlock:()=>cP,FlowGraphSubtractMatrixAndNumberBlock:()=>jI,FlowGraphSubtractMatrixBlock:()=>XI,FlowGraphSubtractNumberBlock:()=>IP,FlowGraphSubtractVector2Block:()=>dI,FlowGraphSubtractVector3Block:()=>EI,FlowGraphSubtractVector4Block:()=>LI,FlowGraphSwitchBlock:()=>$C,FlowGraphTanNumberBlock:()=>QP,FlowGraphThrottleBlock:()=>qC,FlowGraphTimerBlock:()=>ZC,FlowGraphTransformVector3Block:()=>NI,FlowGraphTruncNumberBlock:()=>zP,FlowGraphWaitAllBlock:()=>eP,FlowGraphWhileLoopBlock:()=>iP,FluidRenderer:()=>cA,FluidRendererSceneComponent:()=>lA,FluidRenderingDebug:()=>Zx,FluidRenderingObject:()=>$x,FluidRenderingObjectCustomParticles:()=>nA,FluidRenderingObjectParticleSystem:()=>eA,FluidRenderingTargetRenderer:()=>rA,FlyCamera:()=>ul,FlyCameraInputsManager:()=>cl,FlyCameraKeyboardInput:()=>zs,FlyCameraMouseInput:()=>Ws,FogBlock:()=>Kv,FollowBehavior:()=>Ho,FollowCamera:()=>pl,FollowCameraInputsManager:()=>hl,FollowCameraKeyboardMoveInput:()=>Hs,FollowCameraMouseWheelInput:()=>Xs,FollowCameraPointersInput:()=>js,FragCoordBlock:()=>kv,FragDepthBlock:()=>Xv,FragmentOutputBlock:()=>ga,FramingBehavior:()=>Io,FreeCamera:()=>ol,FreeCameraDeviceOrientationInput:()=>$s,FreeCameraGamepadInput:()=>tl,FreeCameraInputsManager:()=>Js,FreeCameraKeyboardMoveInput:()=>Ys,FreeCameraMouseInput:()=>Qs,FreeCameraMouseWheelInput:()=>qs,FreeCameraTouchInput:()=>Zs,FreeCameraVirtualJoystickInput:()=>rl,FresnelBlock:()=>by,FresnelParameters:()=>wg,FromHalfFloat:()=>hd,FrontFace:()=>Tp,FrontFacingBlock:()=>Uv,Frustum:()=>yr,FxaaPostProcess:()=>lx,GPUParticleSystem:()=>zE,GUID:()=>xi,Gamepad:()=>Fs,GamepadCamera:()=>Rl,GamepadManager:()=>Sl,GamepadSystemSceneComponent:()=>xl,GearVRController:()=>qf,GenerateBase64StringFromPixelData:()=>go,GenerateBase64StringFromTexture:()=>vo,GenerateBase64StringFromTextureAsync:()=>yo,GenericController:()=>Zf,GenericPad:()=>Ls,GeodesicData:()=>Mh,Geometry:()=>Pn,GeometryBufferRenderer:()=>dx,GeometryBufferRendererSceneComponent:()=>fx,GeometryCollectionBlock:()=>qT,GeometryElbowBlock:()=>ZT,GeometryInfoBlock:()=>vE,GeometryInputBlock:()=>ET,GeometryOptimizeBlock:()=>AT,GeometryOutputBlock:()=>bT,GeometryTextureBlock:()=>SE,GeometryTextureFetchBlock:()=>xE,GeometryTransformBlock:()=>nE,GeometryTrigonometryBlock:()=>rE,GeometryTrigonometryBlockOperations:()=>tE,GetClass:()=>T,GetDOMTextContent:()=>nt,GetEnvInfo:()=>Td,GetEnvironmentBRDFTexture:()=>C_,GetInternalFormatFromBasisFormat:()=>uv,GetTGAHeader:()=>iv,GetTextureDataAsync:()=>pd,Gizmo:()=>pu,GizmoAnchorPoint:()=>lu,GizmoCoordinatesMode:()=>cu,GizmoManager:()=>u_,GlowLayer:()=>jm,GoldbergMesh:()=>Dh,GradientBlock:()=>wy,GradientBlockColorStep:()=>Ly,GradientHelper:()=>UE,GrainPostProcess:()=>cx,GreasedLineMesh:()=>dT,GreasedLineMeshColorDistribution:()=>sT,GreasedLineMeshColorDistributionType:()=>gb,GreasedLineMeshColorMode:()=>mb,GreasedLineMeshMaterialType:()=>_b,GreasedLineMeshWidthDistribution:()=>lT,GreasedLinePluginMaterial:()=>Ob,GreasedLineTools:()=>oT,GridBlock:()=>MT,GroundBuilder:()=>Yc,GroundMesh:()=>kc,HDRCubeTexture:()=>mg,HDRCubeTextureAssetTask:()=>CA,HDRFiltering:()=>_g,HDRTools:()=>fg,HandConstraintBehavior:()=>xs,HandConstraintOrientation:()=>vs,HandConstraintVisibility:()=>ys,HandConstraintZone:()=>gs,HandPart:()=>fs,HardwareScalingOptimization:()=>wA,HavokPlugin:()=>FS,HeightToNormalBlock:()=>Hv,HemisphereBuilder:()=>f_,HemisphericLight:()=>ec,HemisphericParticleEmitter:()=>Ga,HighlightLayer:()=>Km,HighlightsPostProcess:()=>ux,Hinge2Joint:()=>Jo,HingeConstraint:()=>SS,HingeJoint:()=>Zo,HtmlElementTexture:()=>Wg,IFlowGraphCoordinatorConfiguration:()=>kC,IWebXRControllerPhysicsOptions:()=>DR,IcoSphereBlock:()=>PT,IcoSphereBuilder:()=>ms,ImageAssetTask:()=>xA,ImageProcessingBlock:()=>Fv,ImageProcessingConfiguration:()=>Fi,ImageProcessingConfigurationDefines:()=>Ni,ImageProcessingPostProcess:()=>Sc,ImageSourceBlock:()=>qv,IncrementValueAction:()=>re,IndexFormat:()=>Cp,InputBlock:()=>xa,InspectableType:()=>nR,InstancedLinesMesh:()=>ju,InstancedMesh:()=>io,InstancesBlock:()=>Ov,InstantiateBlock:()=>fE,InstantiateOnFacesBlock:()=>dE,InstantiateOnVerticesBlock:()=>hE,InstantiateOnVolumeBlock:()=>pE,InstantiatedEntries:()=>oo,IntFloatConverterBlock:()=>_E,InternalTexture:()=>Xt,InternalTextureSource:()=>Mt,InterpolateValueAction:()=>Ke,IntersectionInfo:()=>dn,IsBase64DataUrl:()=>mi,IsDocumentAvailable:()=>rt,IsFileURL:()=>_i,IsNavigatorAvailable:()=>it,IsWindowObjectExist:()=>tt,JoystickAxis:()=>el,KeepAssets:()=>no,KeyboardEventTypes:()=>rr,KeyboardInfo:()=>nr,KeyboardInfoPre:()=>or,KhronosTextureContainer:()=>nm,KhronosTextureContainer2:()=>um,LatheBuilder:()=>dh,Layer:()=>qm,LayerSceneComponent:()=>Qm,LengthBlock:()=>xy,LensFlare:()=>Zm,LensFlareSystem:()=>Jm,LensFlareSystemSceneComponent:()=>$m,LensFlaresOptimization:()=>VA,LensRenderingPipeline:()=>Ex,LerpBlock:()=>fy,Light:()=>ro,LightBlock:()=>Qv,LightGizmo:()=>m_,LightInformationBlock:()=>Nv,LineEdgesRenderer:()=>Hx,LinesBuilder:()=>Ju,LinesMesh:()=>Xu,LoadFile:()=>pi,LoadFileError:()=>oi,LoadImage:()=>hi,LoadOp:()=>Dp,LoadTextureFromTranscodeResult:()=>mv,LockConstraint:()=>AS,Logger:()=>$,MapMode:()=>ip,MapRangeBlock:()=>HT,MappingBlock:()=>yE,MappingTypes:()=>gE,Material:()=>Yn,MaterialAnisotropicDefines:()=>L_,MaterialClearCoatDefines:()=>O_,MaterialDefines:()=>Oi,MaterialDetailMapDefines:()=>_c,MaterialFlags:()=>oc,MaterialGreasedLineDefines:()=>Mb,MaterialHelper:()=>Xn,MaterialIridescenceDefines:()=>N_,MaterialPluginBase:()=>fc,MaterialPluginEvent:()=>Hn,MaterialPluginManager:()=>sc,MaterialSheenDefines:()=>B_,MaterialSubSurfaceDefines:()=>V_,MathBlock:()=>zT,MathBlockOperations:()=>kT,Matrix:()=>I,MatrixBuilderBlock:()=>ib,MatrixComposeBlock:()=>bE,MatrixDeterminantBlock:()=>cb,MatrixTransposeBlock:()=>hb,MaxBlock:()=>Ty,MergeGeometryBlock:()=>QT,MergeMeshesOptimization:()=>WA,Mesh:()=>to,MeshAssetTask:()=>bA,MeshAttributeExistsBlock:()=>pb,MeshAttributeExistsBlockTypes:()=>ub,MeshBlock:()=>CT,MeshBuilder:()=>Vh,MeshDebugMode:()=>Db,MeshDebugPluginMaterial:()=>Lb,MeshExploder:()=>OA,MeshLODLevel:()=>Qn,MeshParticleEmitter:()=>ja,MeshUVSpaceRenderer:()=>Kb,MeshoptCompression:()=>Gb,MinBlock:()=>Ey,MinMaxReducer:()=>ig,MipmapFilterMode:()=>up,MirrorTexture:()=>y_,ModBlock:()=>eb,ModelShape:()=>YE,MorphTarget:()=>gg,MorphTargetManager:()=>yg,MorphTargetsBlock:()=>Dv,MotionBlurPostProcess:()=>_x,MotorEnabledJoint:()=>qo,MultiMaterial:()=>Kn,MultiObserver:()=>NA,MultiPointerScaleBehavior:()=>ko,MultiRenderTarget:()=>bv,MultiplyBlock:()=>wa,NLerpBlock:()=>By,NativeDataStream:()=>td,NativeEngine:()=>Zd,NativePointerInput:()=>Bi,NativeXRFrame:()=>fC,NativeXRLayerRenderTargetTextureProvider:()=>Oc,NativeXRLayerWrapper:()=>Mc,NativeXRRenderTarget:()=>Dc,NegateBlock:()=>Ay,Node:()=>ze,NodeGeometry:()=>xT,NodeGeometryBlock:()=>yT,NodeGeometryBlockConnectionPointTypes:()=>cT,NodeGeometryBuildState:()=>TT,NodeGeometryConnectionPoint:()=>vT,NodeGeometryConnectionPointCompatibilityStates:()=>uT,NodeGeometryConnectionPointDirection:()=>hT,NodeGeometryContextualSources:()=>gT,NodeMaterial:()=>us,NodeMaterialBlock:()=>ua,NodeMaterialBlockConnectionPointMode:()=>_a,NodeMaterialBlockConnectionPointTypes:()=>ta,NodeMaterialBlockTargets:()=>ia,NodeMaterialConnectionPoint:()=>ca,NodeMaterialConnectionPointCompatibilityStates:()=>oa,NodeMaterialConnectionPointCustomObject:()=>Iv,NodeMaterialConnectionPointDirection:()=>aa,NodeMaterialDefines:()=>cs,NodeMaterialModes:()=>La,NodeMaterialOptimizer:()=>vb,NodeMaterialSystemValues:()=>ma,NodeMaterialTeleportInBlock:()=>ry,NodeMaterialTeleportOutBlock:()=>ny,NoiseBlock:()=>KT,NoiseProceduralTexture:()=>xv,NormalBlendBlock:()=>ky,NormalizeBlock:()=>hy,NormalizeVectorBlock:()=>eE,NullBlock:()=>LT,NullEngine:()=>Xh,NullEngineOptions:()=>Hh,Observable:()=>u,Observer:()=>c,OcclusionMaterial:()=>Bg,Octree:()=>su,OctreeBlock:()=>au,OctreeSceneComponent:()=>uu,OculusTouchController:()=>Jf,OimoJSPlugin:()=>Sg,OnAfterEnteringVRObservableEvent:()=>Jc,OneMinusBlock:()=>vy,Orientation:()=>Ir,OutlineRenderer:()=>Jx,PBRAnisotropicConfiguration:()=>w_,PBRBaseMaterial:()=>W_,PBRBaseSimpleMaterial:()=>Ug,PBRClearCoatConfiguration:()=>D_,PBRIridescenceConfiguration:()=>F_,PBRMaterial:()=>H_,PBRMaterialDefines:()=>z_,PBRMetallicRoughnessBlock:()=>$y,PBRMetallicRoughnessMaterial:()=>Vg,PBRSheenConfiguration:()=>U_,PBRSpecularGlossinessMaterial:()=>kg,PBRSubSurfaceConfiguration:()=>k_,PHI:()=>f,PadNumber:()=>yt,PanoramaToCubeMapTools:()=>pg,Particle:()=>VE,ParticleBlendMultiplyBlock:()=>Pa,ParticleHelper:()=>HE,ParticleRampGradientBlock:()=>Ca,ParticleSystem:()=>GE,ParticleSystemSet:()=>WE,ParticleTextureBlock:()=>Ra,ParticlesOptimization:()=>GA,PassCubePostProcess:()=>Pl,PassPostProcess:()=>Cl,Path2:()=>Lr,Path3D:()=>wr,PathCursor:()=>en,PerfCollectionStrategy:()=>xR,PerfCounter:()=>gr,PerformanceConfigurator:()=>E,PerformanceMonitor:()=>In,PerformanceViewerCollector:()=>ER,PerturbNormalBlock:()=>wv,PhotoDome:()=>A_,Physics6DoFConstraint:()=>bS,Physics6DoFLimit:()=>yS,PhysicsAggregate:()=>PS,PhysicsBody:()=>lS,PhysicsConstraint:()=>vS,PhysicsConstraintAxis:()=>tS,PhysicsConstraintAxisLimitMode:()=>eS,PhysicsConstraintMotorType:()=>nS,PhysicsConstraintType:()=>iS,PhysicsEngine:()=>Tg,PhysicsEngineV2:()=>sS,PhysicsEventType:()=>oS,PhysicsHelper:()=>VS,PhysicsImpostor:()=>ea,PhysicsJoint:()=>Ko,PhysicsMaterialCombineMode:()=>cS,PhysicsMotionType:()=>aS,PhysicsRadialExplosionEventOptions:()=>HS,PhysicsRadialImpulseFalloff:()=>wS,PhysicsRaycastResult:()=>bg,PhysicsShape:()=>uS,PhysicsShapeBox:()=>fS,PhysicsShapeCapsule:()=>dS,PhysicsShapeContainer:()=>gS,PhysicsShapeConvexHull:()=>_S,PhysicsShapeCylinder:()=>pS,PhysicsShapeMesh:()=>mS,PhysicsShapeSphere:()=>hS,PhysicsShapeType:()=>rS,PhysicsUpdraftEventOptions:()=>XS,PhysicsUpdraftMode:()=>BS,PhysicsViewer:()=>kh,PhysicsVortexEventOptions:()=>jS,PickingInfo:()=>ji,PipelineErrorReason:()=>vp,PivotTools:()=>Fo,Plane:()=>vr,PlaneBlock:()=>RT,PlaneBuilder:()=>Bo,PlaneDragGizmo:()=>s_,PlaneRotationGizmo:()=>o_,PlayAnimationAction:()=>ne,PlaySoundAction:()=>pe,PointColor:()=>XE,PointLight:()=>hg,PointParticleEmitter:()=>za,PointerDragBehavior:()=>Vo,PointerEventTypes:()=>$i,PointerInfo:()=>ir,PointerInfoBase:()=>er,PointerInfoPre:()=>tr,PointerInput:()=>wi,PointsCloudSystem:()=>$E,PointsGroup:()=>JE,Polar:()=>wb,Polygon:()=>th,PolygonBuilder:()=>ah,PolygonMeshBuilder:()=>ih,PolyhedronBuilder:()=>gh,PolyhedronData:()=>Ih,PoseEnabledController:()=>vl,PoseEnabledControllerHelper:()=>gl,PoseEnabledControllerType:()=>dl,PositionGizmo:()=>l_,PositionNormalTextureVertex:()=>ba,PositionNormalVertex:()=>ya,PostProcess:()=>Da,PostProcessManager:()=>Yi,PostProcessRenderEffect:()=>KS,PostProcessRenderPipeline:()=>vx,PostProcessRenderPipelineManager:()=>yx,PostProcessRenderPipelineManagerSceneComponent:()=>bx,PostProcessesOptimization:()=>UA,PosterizeBlock:()=>Ny,PowBlock:()=>Ry,PowerEase:()=>Xr,PowerPreference:()=>Jd,PrePassOutputBlock:()=>Yv,PrePassRenderer:()=>jx,PrePassRendererSceneComponent:()=>Yx,PrePassTextureBlock:()=>iy,PrecisionDate:()=>st,PredicateCondition:()=>Z,PressureObserverWrapper:()=>mR,PrimitiveTopology:()=>bp,PrismaticConstraint:()=>RS,ProceduralTexture:()=>as,ProceduralTextureSceneComponent:()=>ns,PropertyTypeForEdition:()=>da,PushMaterial:()=>na,QuadraticEase:()=>jr,QuadraticErrorSimplification:()=>rT,QuarticEase:()=>Yr,Quaternion:()=>P,QueryType:()=>Fp,QuinticEase:()=>Kr,RGBDTextureTools:()=>_d,RandomBlock:()=>YT,RandomBlockLocks:()=>XT,RandomGUID:()=>Si,RandomNumberBlock:()=>Cy,RawCubeTexture:()=>Av,RawTexture:()=>Ao,RawTexture2DArray:()=>vg,RawTexture3D:()=>Rv,Ray:()=>No,RayHelper:()=>Gh,ReadFile:()=>di,ReadFileError:()=>si,RecastJSCrowd:()=>IE,RecastJSPlugin:()=>PE,ReciprocalBlock:()=>My,ReflectBlock:()=>zy,ReflectionBlock:()=>Yy,ReflectionProbe:()=>Ag,ReflectionTextureBlock:()=>$v,Reflector:()=>_R,RefractBlock:()=>Wy,RefractionBlock:()=>qy,RefractionPostProcess:()=>mx,RefractionTexture:()=>Cv,RegisterClass:()=>b,RegisterMaterialPlugin:()=>hc,RegisterNativeTypeAsync:()=>Kd,RemapBlock:()=>Fa,RenderPassTimestampLocation:()=>Op,RenderTargetTexture:()=>rs,RenderTargetWrapper:()=>Ma,RenderTargetsOptimization:()=>zA,RenderingGroup:()=>Ki,RenderingGroupInfo:()=>Qi,RenderingManager:()=>qi,ReplaceColorBlock:()=>Oy,RequestFile:()=>fi,RequestFileError:()=>ai,RetryStrategy:()=>ct,RibbonBuilder:()=>Mu,RichTypeAny:()=>PC,RichTypeBoolean:()=>OC,RichTypeColor3:()=>wC,RichTypeColor4:()=>BC,RichTypeMatrix:()=>LC,RichTypeNumber:()=>MC,RichTypeQuaternion:()=>UC,RichTypeString:()=>IC,RichTypeVector2:()=>DC,RichTypeVector3:()=>NC,RichTypeVector4:()=>FC,RollingAverage:()=>Mn,Rotate2dBlock:()=>Gy,RotationGizmo:()=>a_,RotationXBlock:()=>oE,RotationYBlock:()=>aE,RotationZBlock:()=>sE,RuntimeAnimation:()=>et,RuntimeError:()=>dt,SSAO2RenderingPipeline:()=>xx,SSAORenderingPipeline:()=>Ax,SSRRenderingPipeline:()=>Dx,SamplerBindingType:()=>fp,Scalar:()=>h,ScaleBlock:()=>ay,ScaleGizmo:()=>c_,ScalingBlock:()=>lE,Scene:()=>xr,SceneComponentConstants:()=>Zi,SceneDepthBlock:()=>ey,SceneInstrumentation:()=>Wm,SceneLoader:()=>ra,SceneLoaderAnimationGroupLoadingMode:()=>$o,SceneLoaderFlags:()=>Rn,SceneOptimization:()=>FA,SceneOptimizer:()=>XA,SceneOptimizerOptions:()=>HA,ScenePerformancePriority:()=>ar,SceneRecorder:()=>cR,SceneSerializer:()=>QA,ScreenSizeBlock:()=>Gv,ScreenSpaceBlock:()=>zv,ScreenSpaceCurvaturePostProcess:()=>wx,ScreenSpaceReflectionPostProcess:()=>Cx,ScreenshotTools:()=>oR,SerializationHelper:()=>Ue,SetColorsBlock:()=>VT,SetCorsBehavior:()=>ui,SetMaterialIDBlock:()=>iE,SetNormalsBlock:()=>BT,SetParentAction:()=>ce,SetPositionsBlock:()=>wT,SetStateAction:()=>te,SetTangentsBlock:()=>GT,SetUVsBlock:()=>UT,SetValueAction:()=>ie,ShaderCodeInliner:()=>Bd,ShaderLanguage:()=>ot,ShaderMaterial:()=>Hu,ShaderStage:()=>dp,ShaderStore:()=>Vt,ShadowDepthWrapper:()=>bb,ShadowGenerator:()=>eg,ShadowGeneratorSceneComponent:()=>ug,ShadowLight:()=>h_,ShadowMapBlock:()=>jv,ShadowsOptimization:()=>BA,ShapeBuilder:()=>uh,SharpenPostProcess:()=>gx,SheenBlock:()=>Xy,SimplexPerlin3DBlock:()=>Vy,SimplicationQueueSceneComponent:()=>nT,SimplificationQueue:()=>Jb,SimplificationSettings:()=>Zb,SimplificationType:()=>Qb,SineEase:()=>Qr,SixDofDragBehavior:()=>zo,Size:()=>We,Skeleton:()=>Cs,SkeletonViewer:()=>zh,SliderConstraint:()=>xS,SmartArray:()=>Pi,SmartArrayNoDuplicate:()=>Ii,SmoothStepBlock:()=>Iy,SolidParticle:()=>jE,SolidParticleSystem:()=>qE,SolidParticleVertex:()=>QE,Sound:()=>co,SoundTrack:()=>uo,SourceTextureFormat:()=>tm,Space:()=>Sr,SphereBlock:()=>IT,SphereBuilder:()=>xu,SphereDirectedParticleEmitter:()=>Ha,SphereParticleEmitter:()=>Wa,Spherical:()=>Bb,SphericalHarmonics:()=>ad,SphericalPolynomial:()=>sd,SpotLight:()=>__,SpringConstraint:()=>CS,Sprite:()=>uA,SpriteManager:()=>pA,SpriteMap:()=>_A,SpritePackedManager:()=>mA,SpriteSceneComponent:()=>hA,Stage:()=>Ji,StandardMaterial:()=>yc,StandardMaterialDefines:()=>vc,StandardRenderingPipeline:()=>Px,StartsWith:()=>ft,StateCondition:()=>J,StencilOperation:()=>Rp,StencilState:()=>zt,StencilStateComposer:()=>ei,StepBlock:()=>gy,StereoscopicArcRotateCamera:()=>Ul,StereoscopicFreeCamera:()=>Vl,StereoscopicGamepadCamera:()=>kl,StereoscopicInterlacePostProcess:()=>wl,StereoscopicInterlacePostProcessI:()=>Ll,StereoscopicScreenUniversalCamera:()=>zl,StereoscopicUniversalCamera:()=>Gl,StickValues:()=>Ns,StopAnimationAction:()=>oe,StopSoundAction:()=>fe,StorageBuffer:()=>Ps,StorageTextureAccess:()=>mp,StoreOp:()=>Np,StringDictionary:()=>Mi,StringTools:()=>bt,SubEmitter:()=>kE,SubEmitterType:()=>FE,SubMesh:()=>Sn,SubSurfaceBlock:()=>Zy,SubSurfaceSceneComponent:()=>qx,SubtractBlock:()=>my,SurfaceMagnetismBehavior:()=>Wo,SwitchBooleanAction:()=>ee,SwitchInput:()=>Gi,TBNBlock:()=>Lv,TGATools:()=>nv,Tags:()=>me,TargetCamera:()=>nl,TargetedAnimation:()=>Jr,TeleportInBlock:()=>TE,TeleportOutBlock:()=>EE,TestBase64DataUrl:()=>gi,TextFileAssetTask:()=>EA,Texture:()=>To,TextureAspect:()=>ap,TextureAssetTask:()=>AA,TextureBlock:()=>Zv,TextureDimension:()=>rp,TextureFormat:()=>sp,TextureOptimization:()=>LA,TexturePacker:()=>Ev,TexturePackerFrame:()=>Tv,TextureSampleType:()=>_p,TextureSampler:()=>Ht,TextureTools:()=>fd,TextureUsage:()=>np,TextureViewDimension:()=>op,ThinEngine:()=>ii,ThinRenderTargetTexture:()=>Pv,ThinTexture:()=>_o,TiledBoxBuilder:()=>Vu,TiledPlaneBuilder:()=>wu,TimerState:()=>Im,TmpColors:()=>V,TmpVectors:()=>O,ToGammaSpace:()=>d,ToHalfFloat:()=>ud,ToLinearSpace:()=>p,TonemapPostProcess:()=>Fx,TonemappingOperator:()=>Nx,Tools:()=>Ai,TorusBlock:()=>OT,TorusBuilder:()=>Vc,TorusKnotBuilder:()=>zu,TouchCamera:()=>al,TrailMesh:()=>qb,Trajectory:()=>uR,TrajectoryClassifier:()=>fR,TranscodeAsync:()=>fv,TranscodeTarget:()=>im,TransformBlock:()=>ha,TransformNode:()=>Fn,TranslationBlock:()=>uE,TriPlanarBlock:()=>sb,TrigonometryBlock:()=>ss,TrigonometryBlockOperations:()=>os,TubeBuilder:()=>fh,TwirlBlock:()=>Wv,UniformBuffer:()=>Wi,UniversalCamera:()=>Al,UnregisterAllMaterialPlugins:()=>pc,UnregisterMaterialPlugin:()=>dc,UploadContent:()=>rv,UploadEnvLevelsAsync:()=>Rd,UploadEnvSpherical:()=>Id,UploadLevelsAsync:()=>Pd,UtilityLayerRenderer:()=>hu,VRCameraMetrics:()=>Hl,VRDeviceOrientationArcRotateCamera:()=>Zl,VRDeviceOrientationFreeCamera:()=>Jl,VRDeviceOrientationGamepadCamera:()=>$l,VRDistortionCorrectionPostProcess:()=>Xl,VRExperienceHelper:()=>$c,VRMultiviewToSingleviewPostProcess:()=>Ql,ValidatedNativeDataStream:()=>Up,ValueCondition:()=>q,Vector2:()=>A,Vector3:()=>R,Vector4:()=>C,VectorConverterBlock:()=>$T,VectorMergerBlock:()=>Na,VectorSplitterBlock:()=>py,VertexAnimationBaker:()=>Ro,VertexBuffer:()=>Xi,VertexData:()=>An,VertexDataMaterialInfo:()=>xn,VertexFormat:()=>Pp,VertexOutputBlock:()=>pa,VertexStepMode:()=>Ip,VideoDome:()=>Gm,VideoRecorder:()=>qA,VideoTexture:()=>km,ViewDirectionBlock:()=>yy,Viewport:()=>un,VirtualJoystick:()=>il,VirtualJoysticksCamera:()=>Wl,ViveController:()=>$f,VolumetricLightScatteringPostProcess:()=>Lx,VoronoiNoiseBlock:()=>ob,WaveBlock:()=>Fy,WaveBlockKind:()=>Dy,WebGL2ParticleSystem:()=>DE,WebGL2ShaderProcessor:()=>Kt,WebGLDataBuffer:()=>qt,WebGLHardwareTexture:()=>Jt,WebGLPipelineContext:()=>Zt,WebGPUCacheBindGroups:()=>bf,WebGPUCacheRenderPipeline:()=>hf,WebGPUCacheRenderPipelineTree:()=>pf,WebGPUCacheSampler:()=>lf,WebGPUDataBuffer:()=>tf,WebGPUDrawContext:()=>vf,WebGPUEngine:()=>kf,WebGPUTintWASM:()=>Ff,WebRequest:()=>He,WebVRController:()=>rc,WebVRFreeCamera:()=>ic,WebXRAbstractFeature:()=>Yo,WebXRAbstractMotionController:()=>mm,WebXRAnchorSystem:()=>PR,WebXRBackgroundRemover:()=>OR,WebXRCamera:()=>pm,WebXRCompositionLayerWrapper:()=>QR,WebXRControllerComponent:()=>_m,WebXRControllerMovement:()=>GR,WebXRControllerPhysics:()=>NR,WebXRControllerPointerSelection:()=>Cm,WebXRDefaultExperience:()=>Bm,WebXRDefaultExperienceOptions:()=>wm,WebXRDepthSensing:()=>iC,WebXRDomOverlay:()=>kR,WebXREnterExitUI:()=>Dm,WebXREnterExitUIButton:()=>Mm,WebXREnterExitUIOptions:()=>Om,WebXRExperienceHelper:()=>fm,WebXREyeTracking:()=>WR,WebXRFeatureName:()=>Xo,WebXRFeaturePointSystem:()=>LR,WebXRFeaturesManager:()=>jo,WebXRGenericHandController:()=>aC,WebXRGenericTriggerMotionController:()=>gm,WebXRHTCViveMotionController:()=>dC,WebXRHand:()=>Es,WebXRHandJoint:()=>_s,WebXRHandTracking:()=>Ss,WebXRHitTest:()=>FR,WebXRHitTestLegacy:()=>RR,WebXRImageTracking:()=>VR,WebXRInput:()=>Rm,WebXRInputSource:()=>Am,WebXRLayers:()=>tC,WebXRLightEstimation:()=>zR,WebXRManagedOutputCanvas:()=>Ic,WebXRManagedOutputCanvasOptions:()=>Pc,WebXRMeshDetector:()=>UR,WebXRMicrosoftMixedRealityController:()=>lC,WebXRMotionControllerManager:()=>Tm,WebXRMotionControllerTeleportation:()=>Lm,WebXRNearControllerMode:()=>Sm,WebXRNearInteraction:()=>Pm,WebXROculusTouchMotionController:()=>uC,WebXRPlaneDetector:()=>MR,WebXRProfiledMotionController:()=>ym,WebXRProjectionLayerWrapper:()=>ZR,WebXRSessionManager:()=>Nc,WebXRSpaceWarp:()=>oC,WebXRSpaceWarpRenderTargetTextureProvider:()=>nC,WebXRState:()=>Tc,WebXRTrackingState:()=>Ec,WebXRWalkingLocomotion:()=>KR,WeightedSound:()=>po,WindowsMotionController:()=>t_,WorkerPool:()=>om,WorleyNoise3DBlock:()=>Uy,XRSpaceWarpRenderTarget:()=>rC,XRWindowsMotionController:()=>i_,Xbox360Button:()=>_l,Xbox360Dpad:()=>ml,Xbox360Pad:()=>Tl,XboxInput:()=>ki,_BabylonLoaderRegistered:()=>Rg,_BasisTextureLoader:()=>yv,_CreationDataStorage:()=>qn,_DDSTextureLoader:()=>$_,_ENVTextureLoader:()=>em,_HDRTextureLoader:()=>av,_IAnimationState:()=>Xe,_InstancesBatch:()=>Jn,_KTXTextureLoader:()=>dm,_MeshCollisionData:()=>Ln,_OcclusionDataStorage:()=>Yh,_PrimaryIsoTriangle:()=>Ph,_TGATextureLoader:()=>ov,_TimeToken:()=>jh,_UpdateRGBDAsync:()=>Md,_forceSceneHelpersToBundle:()=>Um,_forceTransformFeedbackToBundle:()=>Kh,_injectLTSFileTools:()=>Ti,addClipPlaneUniforms:()=>Vn,allocateAndCopyTypedBuffer:()=>On,bindClipPlane:()=>zn,captureEquirectangularFromScene:()=>AR,className:()=>Ri,createDetailMapPlugin:()=>Ib,createPBRAnisotropicPlugin:()=>Sb,createPBRBRDFPlugin:()=>xb,createPBRClearCoatPlugin:()=>Ab,createPBRIridescencePlugin:()=>Rb,createPBRSheenPlugin:()=>Cb,createPBRSubSurfacePlugin:()=>Pb,createYieldingScheduler:()=>nn,editableInPropertyPage:()=>fa,expandToProperty:()=>Se,extractMinAndMax:()=>En,extractMinAndMaxIndexed:()=>Tn,getRichTypeFromValue:()=>VC,inlineScheduler:()=>rn,makeAsyncFunction:()=>cn,makeSyncFunction:()=>ln,nativeOverride:()=>Ve,normalizeEnvInfo:()=>Ed,prepareDefinesForClipPlanes:()=>Gn,prepareStringDefinesForClipPlanes:()=>kn,runCoroutine:()=>on,runCoroutineAsync:()=>sn,runCoroutineSync:()=>an,serialize:()=>xe,serializeAsCameraReference:()=>we,serializeAsColor3:()=>Re,serializeAsColor4:()=>De,serializeAsColorCurves:()=>Oe,serializeAsFresnelParameters:()=>Ce,serializeAsImageProcessingConfiguration:()=>Ne,serializeAsMatrix:()=>Le,serializeAsMeshReference:()=>Me,serializeAsQuaternion:()=>Fe,serializeAsTexture:()=>Ae,serializeAsVector2:()=>Pe,serializeAsVector3:()=>Ie,setAndStartTimer:()=>Nm,setStereoscopicAnaglyphRigMode:()=>Ml,setStereoscopicRigMode:()=>Bl,setVRRigMode:()=>ql,setWebVRRigMode:()=>tc});var n={};e.r(n),e.d(n,{AbstractActionManager:()=>s,AbstractAssetTask:()=>gA,AbstractMesh:()=>Un,AbstractScene:()=>o,AcquireNativeObjectAsync:()=>Yd,Action:()=>k,ActionEvent:()=>G,ActionManager:()=>de,AddBlock:()=>oy,AddressMode:()=>lp,AdvancedTimer:()=>Fm,AlignBlock:()=>cE,AlphaState:()=>Wt,AmmoJSPlugin:()=>xg,AnaglyphArcRotateCamera:()=>Ol,AnaglyphFreeCamera:()=>Dl,AnaglyphGamepadCamera:()=>Nl,AnaglyphPostProcess:()=>Il,AnaglyphUniversalCamera:()=>Fl,Analyser:()=>so,AndOrNotEvaluator:()=>_e,Angle:()=>Nr,Animatable:()=>Pr,AnimatedInputBlockTypes:()=>va,Animation:()=>Ye,AnimationAssetTask:()=>TA,AnimationEvent:()=>Zr,AnimationGroup:()=>$r,AnimationGroupMask:()=>tn,AnimationGroupMaskMode:()=>Or,AnimationKeyInterpolation:()=>Be,AnimationPropertiesOverride:()=>Mr,AnimationRange:()=>ke,AnisotropyBlock:()=>jy,ApplyPostProcess:()=>cd,Arc2:()=>Fr,ArcFollowCamera:()=>fl,ArcRotateCamera:()=>sl,ArcRotateCameraGamepadInput:()=>ws,ArcRotateCameraInputsManager:()=>ks,ArcRotateCameraKeyboardMoveInput:()=>Bs,ArcRotateCameraMouseWheelInput:()=>Us,ArcRotateCameraPointersInput:()=>Vs,ArcRotateCameraVRDeviceOrientationInput:()=>Gs,ArcTan2Block:()=>Py,AssetContainer:()=>ao,AssetTaskState:()=>fA,AssetsManager:()=>IA,AssetsProgressEvent:()=>vA,AsyncLoop:()=>Ci,AttachToBoxBehavior:()=>Oo,AudioEngine:()=>lo,AudioSceneComponent:()=>ho,AutoLayoutMode:()=>yp,AutoReleaseWorkerPool:()=>am,AutoRotationBehavior:()=>Co,AxesViewer:()=>_u,Axis:()=>Rr,AxisDragGizmo:()=>fu,AxisScaleGizmo:()=>r_,BRDFTextureTools:()=>P_,BabylonFileLoaderConfiguration:()=>Cg,BackEase:()=>kr,BackgroundMaterial:()=>E_,BakedVertexAnimationManager:()=>fo,BallAndSocketConstraint:()=>TS,BaseCameraMouseWheelInput:()=>Is,BaseCameraPointersInput:()=>Ms,BaseError:()=>ut,BaseParticleSystem:()=>Ya,BaseSixDofDragBehavior:()=>Go,BaseTexture:()=>mo,BasisTools:()=>gv,BasisToolsOptions:()=>cv,BasisTranscodeConfiguration:()=>lv,BezierCurve:()=>Dr,BezierCurveEase:()=>qr,BiPlanarBlock:()=>lb,BinaryFileAssetTask:()=>SA,BlackAndWhitePostProcess:()=>YS,BlendFactor:()=>xp,BlendOperation:()=>Ap,BloomEffect:()=>ZS,BloomMergePostProcess:()=>qS,BlurPostProcess:()=>v_,Bone:()=>Cr,BoneAxesViewer:()=>mu,BoneIKController:()=>As,BoneLookController:()=>Rs,BonesBlock:()=>Mv,BooleanGeometryBlock:()=>CE,BooleanGeometryOperations:()=>AE,BounceEase:()=>Gr,BouncingBehavior:()=>Po,BoundingBlock:()=>RE,BoundingBox:()=>pn,BoundingBoxGizmo:()=>n_,BoundingBoxRenderer:()=>Bx,BoundingInfo:()=>yn,BoundingSphere:()=>fn,BoxBlock:()=>ST,BoxBuilder:()=>Tu,BoxParticleEmitter:()=>Ba,Buffer:()=>Hi,BufferBindingType:()=>pp,BufferMapState:()=>ep,BufferUsage:()=>tp,CSG:()=>Yb,Camera:()=>hn,CameraGizmo:()=>g_,CameraInputTypes:()=>Os,CameraInputsManager:()=>Ds,CannonJSPlugin:()=>Eg,CanvasAlphaMode:()=>Lp,CapsuleBlock:()=>NT,CapsuleBuilder:()=>Cu,CascadedShadowGenerator:()=>cg,ChromaticAberrationPostProcess:()=>JS,CircleEase:()=>Vr,CircleOfConfusionPostProcess:()=>$S,ClampBlock:()=>sy,ClearCoatBlock:()=>Ky,ClipPlanesBlock:()=>ty,ClipboardEventTypes:()=>Yf,ClipboardInfo:()=>Kf,CloudBlock:()=>nb,CloudPoint:()=>ZE,Collider:()=>tu,Color3:()=>B,Color3Gradient:()=>wE,Color4:()=>U,ColorCorrectionPostProcess:()=>ex,ColorCurves:()=>Di,ColorGradient:()=>LE,ColorGradingTexture:()=>Gg,ColorMergerBlock:()=>dy,ColorSplitterBlock:()=>Ka,ColorWrite:()=>Sp,CombineAction:()=>se,CompareFunction:()=>hp,CompatibilityOptions:()=>Cn,CompilationMessageType:()=>gp,CompleteGreasedLineColorTable:()=>mT,CompleteGreasedLineWidthTable:()=>_T,ComputeBindingType:()=>ru,ComputeEffect:()=>nu,ComputeNormalsBlock:()=>JT,ComputePassTimestampLocation:()=>Mp,ComputeShader:()=>ou,ComputeShaderParticleSystem:()=>NE,Condition:()=>Q,ConditionBlock:()=>jT,ConditionBlockTests:()=>WT,ConditionalBlock:()=>rb,ConditionalBlockConditions:()=>tb,ConeParticleEmitter:()=>Ua,Constants:()=>a,ContainerAssetTask:()=>yA,ConversionMode:()=>iA,ConvolutionPostProcess:()=>tx,Coordinate:()=>Ar,CopyTextureToTexture:()=>oA,CopyTools:()=>bo,CreateBox:()=>bu,CreateBoxVertexData:()=>vu,CreateCapsule:()=>Ru,CreateCapsuleVertexData:()=>Au,CreateCylinder:()=>Lc,CreateCylinderVertexData:()=>Fc,CreateDashedLines:()=>Zu,CreateDashedLinesVertexData:()=>Ku,CreateDecal:()=>Ah,CreateDisc:()=>Du,CreateDiscVertexData:()=>Ou,CreateEnvTextureAsync:()=>Sd,CreateGeodesic:()=>Oh,CreateGoldberg:()=>Fh,CreateGoldbergVertexData:()=>Nh,CreateGreasedLine:()=>fT,CreateGreasedLineMaterial:()=>pT,CreateGround:()=>Hc,CreateGroundFromHeightMap:()=>jc,CreateGroundFromHeightMapVertexData:()=>Wc,CreateGroundVertexData:()=>Gc,CreateHemisphere:()=>p_,CreateIcoSphere:()=>ds,CreateIcoSphereVertexData:()=>hs,CreateImageDataArrayBufferViews:()=>Ad,CreateLathe:()=>hh,CreateLineSystem:()=>Qu,CreateLineSystemVertexData:()=>Yu,CreateLines:()=>qu,CreatePlane:()=>wo,CreatePlaneVertexData:()=>Lo,CreatePolygon:()=>nh,CreatePolygonVertexData:()=>rh,CreatePolyhedron:()=>mh,CreatePolyhedronVertexData:()=>_h,CreateResizedCopy:()=>ld,CreateRibbon:()=>Iu,CreateRibbonVertexData:()=>Pu,CreateScreenshot:()=>JA,CreateScreenshotAsync:()=>$A,CreateScreenshotUsingRenderTarget:()=>tR,CreateScreenshotUsingRenderTargetAsync:()=>iR,CreateScreenshotWithResizeAsync:()=>eR,CreateSegmentedBoxVertexData:()=>yu,CreateSphere:()=>Su,CreateSphereVertexData:()=>Eu,CreateText:()=>Uh,CreateTextShapePaths:()=>Bh,CreateTiledBox:()=>Uu,CreateTiledBoxVertexData:()=>Bu,CreateTiledGround:()=>Xc,CreateTiledGroundVertexData:()=>zc,CreateTiledPlane:()=>Lu,CreateTiledPlaneVertexData:()=>Fu,CreateTorus:()=>Uc,CreateTorusKnot:()=>Gu,CreateTorusKnotVertexData:()=>ku,CreateTorusVertexData:()=>Bc,CreateTube:()=>ph,CrossBlock:()=>ly,CubeMapToSphericalPolynomialTools:()=>gd,CubeTexture:()=>b_,CubeTextureAssetTask:()=>RA,CubicEase:()=>zr,CullMode:()=>Ep,CurrentScreenBlock:()=>Aa,Curve3:()=>Br,CurveBlock:()=>fb,CurveBlockTypes:()=>db,CustomBlock:()=>cy,CustomOptimization:()=>kA,CustomParticleEmitter:()=>Xa,CustomProceduralTexture:()=>Sv,CylinderBlock:()=>DT,CylinderBuilder:()=>wc,CylinderDirectedParticleEmitter:()=>ka,CylinderParticleEmitter:()=>Va,DDSTools:()=>J_,DataBuffer:()=>Qt,DataReader:()=>sR,DataStorage:()=>lR,Database:()=>ME,DaydreamController:()=>Qf,Debug:()=>cM,DebugBlock:()=>mE,DebugLayer:()=>gu,DebugLayerTab:()=>du,DecalBuilder:()=>Rh,DecalMapConfiguration:()=>Eb,DecalMapDefines:()=>Tb,Decode:()=>_t,DecodeBase64ToBinary:()=>vt,DecodeBase64ToString:()=>gt,DecodeBase64UrlToBinary:()=>vi,DecodeBase64UrlToString:()=>bi,DeepCopier:()=>he,DefaultCollisionCoordinator:()=>iu,DefaultKTX2DecoderOptions:()=>cm,DefaultLoadingScreen:()=>dg,DefaultRenderingPipeline:()=>Tx,Deferred:()=>MA,DepthCullingState:()=>Gt,DepthOfFieldBlurPostProcess:()=>ix,DepthOfFieldEffect:()=>ox,DepthOfFieldEffectBlurLevel:()=>rx,DepthOfFieldMergePostProcess:()=>nx,DepthPeelingRenderer:()=>kx,DepthPeelingSceneComponent:()=>Gx,DepthReducer:()=>rg,DepthRenderer:()=>tg,DepthRendererSceneComponent:()=>Ux,DepthSortedParticle:()=>KE,DerivativeBlock:()=>Vv,DesaturateBlock:()=>Hy,DetailMapConfiguration:()=>mc,DeviceInputEventType:()=>zi,DeviceLostReason:()=>wp,DeviceOrientationCamera:()=>ll,DeviceSource:()=>dr,DeviceSourceManager:()=>fr,DeviceType:()=>Li,DirectionalLight:()=>d_,DirectionalLightFrustumViewer:()=>Wh,DiscBlock:()=>FT,DiscBuilder:()=>Nu,DiscardBlock:()=>Bv,DisplayPassPostProcess:()=>ax,DistanceBlock:()=>Sy,DistanceConstraint:()=>ES,DistanceJoint:()=>Qo,DivideBlock:()=>_y,DoNothingAction:()=>ae,DomManagement:()=>at,DotBlock:()=>uy,DracoCompression:()=>kb,DrawWrapper:()=>$t,DualSenseInput:()=>Vi,DualShockButton:()=>yl,DualShockDpad:()=>bl,DualShockInput:()=>Ui,DualShockPad:()=>El,DumpTools:()=>is,DynamicFloat32Array:()=>gR,DynamicTexture:()=>bc,EasingFunction:()=>Ur,EdgesRenderer:()=>Wx,Effect:()=>kt,EffectFallbacks:()=>Ia,EffectLayer:()=>Hm,EffectLayerSceneComponent:()=>Xm,EffectRenderer:()=>qa,EffectWrapper:()=>Za,ElasticEase:()=>Wr,ElbowBlock:()=>ab,EncodeArrayBufferToBase64:()=>mt,EndsWith:()=>pt,Engine:()=>Dn,EngineFactory:()=>jf,EngineFormat:()=>rm,EngineInstrumentation:()=>zm,EngineStore:()=>S,EngineView:()=>Qh,EnvironmentHelper:()=>S_,EnvironmentTextureTools:()=>Od,Epsilon:()=>_,EquiRectangularCubeTexture:()=>zg,EquiRectangularCubeTextureAssetTask:()=>PA,ErrorCodes:()=>ht,ErrorFilter:()=>Bp,EventConstants:()=>sr,EventState:()=>l,ExecuteCodeAction:()=>le,ExponentialEase:()=>Hr,ExternalTexture:()=>mf,ExtractHighlightsPostProcess:()=>QS,ExtrudePolygon:()=>oh,ExtrudeShape:()=>sh,ExtrudeShapeCustom:()=>lh,FactorGradient:()=>BE,FadeInOutBehavior:()=>Do,FeatureName:()=>$d,FileTools:()=>yi,FileToolsOptions:()=>li,FilesInput:()=>DA,FilesInputStore:()=>lt,FilterMode:()=>cp,FilterPostProcess:()=>sx,FlowGraph:()=>yC,FlowGraphACosNumberBlock:()=>ZP,FlowGraphASinNumberBlock:()=>qP,FlowGraphATan2NumberBlock:()=>tI,FlowGraphATanNumberBlock:()=>JP,FlowGraphAbsNumberBlock:()=>BP,FlowGraphAddMatrixAndNumberBlock:()=>HI,FlowGraphAddMatrixBlock:()=>WI,FlowGraphAddNumberBlock:()=>PP,FlowGraphAddVector2Block:()=>hI,FlowGraphAddVector3Block:()=>TI,FlowGraphAddVector4Block:()=>FI,FlowGraphBitwiseAndBlock:()=>mP,FlowGraphBitwiseLeftShiftBlock:()=>bP,FlowGraphBitwiseNotBlock:()=>yP,FlowGraphBitwiseOrBlock:()=>gP,FlowGraphBitwiseRightShiftBlock:()=>TP,FlowGraphBitwiseXorBlock:()=>vP,FlowGraphBlock:()=>EC,FlowGraphBranchBlock:()=>YC,FlowGraphCeilNumberBlock:()=>kP,FlowGraphClampMatrixBlock:()=>ZI,FlowGraphComposeMatrixBlock:()=>$I,FlowGraphConditionalDataBlock:()=>uP,FlowGraphConstantBlock:()=>pP,FlowGraphContext:()=>mC,FlowGraphCoordinateTransformBlock:()=>dP,FlowGraphCoordinator:()=>GC,FlowGraphCosNumberBlock:()=>KP,FlowGraphCountLeadingZerosBlock:()=>EP,FlowGraphCountTrailingZerosBlock:()=>SP,FlowGraphCounterBlock:()=>tP,FlowGraphCreateVector2Block:()=>vI,FlowGraphCreateVector3Block:()=>MI,FlowGraphCreateVector4Block:()=>GI,FlowGraphCrossVector3Block:()=>II,FlowGraphDebounceBlock:()=>rP,FlowGraphDecomposeMatrixBlock:()=>JI,FlowGraphDivideMatrixAndNumberBlock:()=>QI,FlowGraphDivideMatrixBlock:()=>KI,FlowGraphDivideNumberBlock:()=>OP,FlowGraphDivideVector2Block:()=>fI,FlowGraphDivideVector3Block:()=>xI,FlowGraphDivideVector4Block:()=>BI,FlowGraphDoNBlock:()=>KC,FlowGraphDotVector3Block:()=>PI,FlowGraphENumberBlock:()=>$P,FlowGraphEqualsNumberBlock:()=>oI,FlowGraphEventBlock:()=>RC,FlowGraphEventCoordinator:()=>CC,FlowGraphExecutionBlock:()=>xC,FlowGraphExpNumberBlock:()=>WP,FlowGraphFlipFlopBlock:()=>nP,FlowGraphFloorNumberBlock:()=>VP,FlowGraphForLoopBlock:()=>QC,FlowGraphGetTransformationMatrixBlock:()=>tM,FlowGraphGetVariableBlock:()=>hP,FlowGraphGreaterThanNumberBlock:()=>aI,FlowGraphGreaterThanOrEqualsNumberBlock:()=>sI,FlowGraphIsInfinityNumberBlock:()=>LP,FlowGraphIsNaNNumberBlock:()=>FP,FlowGraphLengthVector2Block:()=>mI,FlowGraphLengthVector3Block:()=>RI,FlowGraphLengthVector4Block:()=>VI,FlowGraphLessThanNumberBlock:()=>lI,FlowGraphLessThanOrEqualsNumberBlock:()=>cI,FlowGraphLnNumberBlock:()=>jP,FlowGraphLog10NumberBlock:()=>HP,FlowGraphLogBlock:()=>WC,FlowGraphLogNumberBlock:()=>XP,FlowGraphLogicAndBlock:()=>xP,FlowGraphLogicNotBlock:()=>RP,FlowGraphLogicOrBlock:()=>AP,FlowGraphMaxNumberBlock:()=>nI,FlowGraphMeshPickEventBlock:()=>iM,FlowGraphMinNumberBlock:()=>rI,FlowGraphMixNumberBlock:()=>uI,FlowGraphModNumberBlock:()=>DP,FlowGraphMultiGateBlock:()=>JC,FlowGraphMultiplyMatrixBlock:()=>YI,FlowGraphMultiplyNumberBlock:()=>MP,FlowGraphMultiplyVector2Block:()=>pI,FlowGraphMultiplyVector3Block:()=>SI,FlowGraphMultiplyVector4Block:()=>wI,FlowGraphNegateNumberBlock:()=>UP,FlowGraphNormalizeVector2Block:()=>gI,FlowGraphNormalizeVector3Block:()=>CI,FlowGraphNormalizeVector4Block:()=>kI,FlowGraphPauseAnimationBlock:()=>sP,FlowGraphPiNumberBlock:()=>eI,FlowGraphPlayAnimationBlock:()=>oP,FlowGraphPlayAudioBlock:()=>lP,FlowGraphPowNumberBlock:()=>NP,FlowGraphQuaternionToRotationMatrixBlock:()=>eM,FlowGraphRandomNumberBlock:()=>iI,FlowGraphReceiveCustomEventBlock:()=>nM,FlowGraphRotate2dVector2Block:()=>bI,FlowGraphRotate3dVector3Block:()=>DI,FlowGraphRoundNumberBlock:()=>GP,FlowGraphScaleMatrixBlock:()=>qI,FlowGraphScaleVector2Block:()=>_I,FlowGraphScaleVector3Block:()=>AI,FlowGraphScaleVector4Block:()=>UI,FlowGraphSceneReadyEventBlock:()=>rM,FlowGraphSceneTickEventBlock:()=>oM,FlowGraphSendCustomEventBlock:()=>jC,FlowGraphSetPropertyBlock:()=>XC,FlowGraphSetVariableBlock:()=>HC,FlowGraphSignalConnection:()=>SC,FlowGraphSinNumberBlock:()=>YP,FlowGraphSplitVector2Block:()=>yI,FlowGraphSplitVector3Block:()=>OI,FlowGraphSplitVector4Block:()=>zI,FlowGraphSqrtNumberBlock:()=>wP,FlowGraphState:()=>_C,FlowGraphStopAnimationBlock:()=>aP,FlowGraphStopAudioBlock:()=>cP,FlowGraphSubtractMatrixAndNumberBlock:()=>jI,FlowGraphSubtractMatrixBlock:()=>XI,FlowGraphSubtractNumberBlock:()=>IP,FlowGraphSubtractVector2Block:()=>dI,FlowGraphSubtractVector3Block:()=>EI,FlowGraphSubtractVector4Block:()=>LI,FlowGraphSwitchBlock:()=>$C,FlowGraphTanNumberBlock:()=>QP,FlowGraphThrottleBlock:()=>qC,FlowGraphTimerBlock:()=>ZC,FlowGraphTransformVector3Block:()=>NI,FlowGraphTruncNumberBlock:()=>zP,FlowGraphWaitAllBlock:()=>eP,FlowGraphWhileLoopBlock:()=>iP,FluidRenderer:()=>cA,FluidRendererSceneComponent:()=>lA,FluidRenderingDebug:()=>Zx,FluidRenderingObject:()=>$x,FluidRenderingObjectCustomParticles:()=>nA,FluidRenderingObjectParticleSystem:()=>eA,FluidRenderingTargetRenderer:()=>rA,FlyCamera:()=>ul,FlyCameraInputsManager:()=>cl,FlyCameraKeyboardInput:()=>zs,FlyCameraMouseInput:()=>Ws,FogBlock:()=>Kv,FollowBehavior:()=>Ho,FollowCamera:()=>pl,FollowCameraInputsManager:()=>hl,FollowCameraKeyboardMoveInput:()=>Hs,FollowCameraMouseWheelInput:()=>Xs,FollowCameraPointersInput:()=>js,FragCoordBlock:()=>kv,FragDepthBlock:()=>Xv,FragmentOutputBlock:()=>ga,FramingBehavior:()=>Io,FreeCamera:()=>ol,FreeCameraDeviceOrientationInput:()=>$s,FreeCameraGamepadInput:()=>tl,FreeCameraInputsManager:()=>Js,FreeCameraKeyboardMoveInput:()=>Ys,FreeCameraMouseInput:()=>Qs,FreeCameraMouseWheelInput:()=>qs,FreeCameraTouchInput:()=>Zs,FreeCameraVirtualJoystickInput:()=>rl,FresnelBlock:()=>by,FresnelParameters:()=>wg,FromHalfFloat:()=>hd,FrontFace:()=>Tp,FrontFacingBlock:()=>Uv,Frustum:()=>yr,FxaaPostProcess:()=>lx,GPUParticleSystem:()=>zE,GUID:()=>xi,Gamepad:()=>Fs,GamepadCamera:()=>Rl,GamepadManager:()=>Sl,GamepadSystemSceneComponent:()=>xl,GearVRController:()=>qf,GenerateBase64StringFromPixelData:()=>go,GenerateBase64StringFromTexture:()=>vo,GenerateBase64StringFromTextureAsync:()=>yo,GenericController:()=>Zf,GenericPad:()=>Ls,GeodesicData:()=>Mh,Geometry:()=>Pn,GeometryBufferRenderer:()=>dx,GeometryBufferRendererSceneComponent:()=>fx,GeometryCollectionBlock:()=>qT,GeometryElbowBlock:()=>ZT,GeometryInfoBlock:()=>vE,GeometryInputBlock:()=>ET,GeometryOptimizeBlock:()=>AT,GeometryOutputBlock:()=>bT,GeometryTextureBlock:()=>SE,GeometryTextureFetchBlock:()=>xE,GeometryTransformBlock:()=>nE,GeometryTrigonometryBlock:()=>rE,GeometryTrigonometryBlockOperations:()=>tE,GetClass:()=>T,GetDOMTextContent:()=>nt,GetEnvInfo:()=>Td,GetEnvironmentBRDFTexture:()=>C_,GetInternalFormatFromBasisFormat:()=>uv,GetTGAHeader:()=>iv,GetTextureDataAsync:()=>pd,Gizmo:()=>pu,GizmoAnchorPoint:()=>lu,GizmoCoordinatesMode:()=>cu,GizmoManager:()=>u_,GlowLayer:()=>jm,GoldbergMesh:()=>Dh,GradientBlock:()=>wy,GradientBlockColorStep:()=>Ly,GradientHelper:()=>UE,GrainPostProcess:()=>cx,GreasedLineMesh:()=>dT,GreasedLineMeshColorDistribution:()=>sT,GreasedLineMeshColorDistributionType:()=>gb,GreasedLineMeshColorMode:()=>mb,GreasedLineMeshMaterialType:()=>_b,GreasedLineMeshWidthDistribution:()=>lT,GreasedLinePluginMaterial:()=>Ob,GreasedLineTools:()=>oT,GridBlock:()=>MT,GroundBuilder:()=>Yc,GroundMesh:()=>kc,HDRCubeTexture:()=>mg,HDRCubeTextureAssetTask:()=>CA,HDRFiltering:()=>_g,HDRTools:()=>fg,HandConstraintBehavior:()=>xs,HandConstraintOrientation:()=>vs,HandConstraintVisibility:()=>ys,HandConstraintZone:()=>gs,HandPart:()=>fs,HardwareScalingOptimization:()=>wA,HavokPlugin:()=>FS,HeightToNormalBlock:()=>Hv,HemisphereBuilder:()=>f_,HemisphericLight:()=>ec,HemisphericParticleEmitter:()=>Ga,HighlightLayer:()=>Km,HighlightsPostProcess:()=>ux,Hinge2Joint:()=>Jo,HingeConstraint:()=>SS,HingeJoint:()=>Zo,HtmlElementTexture:()=>Wg,IFlowGraphCoordinatorConfiguration:()=>kC,IWebXRControllerPhysicsOptions:()=>DR,IcoSphereBlock:()=>PT,IcoSphereBuilder:()=>ms,ImageAssetTask:()=>xA,ImageProcessingBlock:()=>Fv,ImageProcessingConfiguration:()=>Fi,ImageProcessingConfigurationDefines:()=>Ni,ImageProcessingPostProcess:()=>Sc,ImageSourceBlock:()=>qv,IncrementValueAction:()=>re,IndexFormat:()=>Cp,InputBlock:()=>xa,InspectableType:()=>nR,InstancedLinesMesh:()=>ju,InstancedMesh:()=>io,InstancesBlock:()=>Ov,InstantiateBlock:()=>fE,InstantiateOnFacesBlock:()=>dE,InstantiateOnVerticesBlock:()=>hE,InstantiateOnVolumeBlock:()=>pE,InstantiatedEntries:()=>oo,IntFloatConverterBlock:()=>_E,InternalTexture:()=>Xt,InternalTextureSource:()=>Mt,InterpolateValueAction:()=>Ke,IntersectionInfo:()=>dn,IsBase64DataUrl:()=>mi,IsDocumentAvailable:()=>rt,IsFileURL:()=>_i,IsNavigatorAvailable:()=>it,IsWindowObjectExist:()=>tt,JoystickAxis:()=>el,KeepAssets:()=>no,KeyboardEventTypes:()=>rr,KeyboardInfo:()=>nr,KeyboardInfoPre:()=>or,KhronosTextureContainer:()=>nm,KhronosTextureContainer2:()=>um,LatheBuilder:()=>dh,Layer:()=>qm,LayerSceneComponent:()=>Qm,LengthBlock:()=>xy,LensFlare:()=>Zm,LensFlareSystem:()=>Jm,LensFlareSystemSceneComponent:()=>$m,LensFlaresOptimization:()=>VA,LensRenderingPipeline:()=>Ex,LerpBlock:()=>fy,Light:()=>ro,LightBlock:()=>Qv,LightGizmo:()=>m_,LightInformationBlock:()=>Nv,LineEdgesRenderer:()=>Hx,LinesBuilder:()=>Ju,LinesMesh:()=>Xu,LoadFile:()=>pi,LoadFileError:()=>oi,LoadImage:()=>hi,LoadOp:()=>Dp,LoadTextureFromTranscodeResult:()=>mv,LockConstraint:()=>AS,Logger:()=>$,MapMode:()=>ip,MapRangeBlock:()=>HT,MappingBlock:()=>yE,MappingTypes:()=>gE,Material:()=>Yn,MaterialAnisotropicDefines:()=>L_,MaterialClearCoatDefines:()=>O_,MaterialDefines:()=>Oi,MaterialDetailMapDefines:()=>_c,MaterialFlags:()=>oc,MaterialGreasedLineDefines:()=>Mb,MaterialHelper:()=>Xn,MaterialIridescenceDefines:()=>N_,MaterialPluginBase:()=>fc,MaterialPluginEvent:()=>Hn,MaterialPluginManager:()=>sc,MaterialSheenDefines:()=>B_,MaterialSubSurfaceDefines:()=>V_,MathBlock:()=>zT,MathBlockOperations:()=>kT,Matrix:()=>I,MatrixBuilderBlock:()=>ib,MatrixComposeBlock:()=>bE,MatrixDeterminantBlock:()=>cb,MatrixTransposeBlock:()=>hb,MaxBlock:()=>Ty,MergeGeometryBlock:()=>QT,MergeMeshesOptimization:()=>WA,Mesh:()=>to,MeshAssetTask:()=>bA,MeshAttributeExistsBlock:()=>pb,MeshAttributeExistsBlockTypes:()=>ub,MeshBlock:()=>CT,MeshBuilder:()=>Vh,MeshDebugMode:()=>Db,MeshDebugPluginMaterial:()=>Lb,MeshExploder:()=>OA,MeshLODLevel:()=>Qn,MeshParticleEmitter:()=>ja,MeshUVSpaceRenderer:()=>Kb,MeshoptCompression:()=>Gb,MinBlock:()=>Ey,MinMaxReducer:()=>ig,MipmapFilterMode:()=>up,MirrorTexture:()=>y_,ModBlock:()=>eb,ModelShape:()=>YE,MorphTarget:()=>gg,MorphTargetManager:()=>yg,MorphTargetsBlock:()=>Dv,MotionBlurPostProcess:()=>_x,MotorEnabledJoint:()=>qo,MultiMaterial:()=>Kn,MultiObserver:()=>NA,MultiPointerScaleBehavior:()=>ko,MultiRenderTarget:()=>bv,MultiplyBlock:()=>wa,NLerpBlock:()=>By,NativeDataStream:()=>td,NativeEngine:()=>Zd,NativePointerInput:()=>Bi,NativeXRFrame:()=>fC,NativeXRLayerRenderTargetTextureProvider:()=>Oc,NativeXRLayerWrapper:()=>Mc,NativeXRRenderTarget:()=>Dc,NegateBlock:()=>Ay,Node:()=>ze,NodeGeometry:()=>xT,NodeGeometryBlock:()=>yT,NodeGeometryBlockConnectionPointTypes:()=>cT,NodeGeometryBuildState:()=>TT,NodeGeometryConnectionPoint:()=>vT,NodeGeometryConnectionPointCompatibilityStates:()=>uT,NodeGeometryConnectionPointDirection:()=>hT,NodeGeometryContextualSources:()=>gT,NodeMaterial:()=>us,NodeMaterialBlock:()=>ua,NodeMaterialBlockConnectionPointMode:()=>_a,NodeMaterialBlockConnectionPointTypes:()=>ta,NodeMaterialBlockTargets:()=>ia,NodeMaterialConnectionPoint:()=>ca,NodeMaterialConnectionPointCompatibilityStates:()=>oa,NodeMaterialConnectionPointCustomObject:()=>Iv,NodeMaterialConnectionPointDirection:()=>aa,NodeMaterialDefines:()=>cs,NodeMaterialModes:()=>La,NodeMaterialOptimizer:()=>vb,NodeMaterialSystemValues:()=>ma,NodeMaterialTeleportInBlock:()=>ry,NodeMaterialTeleportOutBlock:()=>ny,NoiseBlock:()=>KT,NoiseProceduralTexture:()=>xv,NormalBlendBlock:()=>ky,NormalizeBlock:()=>hy,NormalizeVectorBlock:()=>eE,NullBlock:()=>LT,NullEngine:()=>Xh,NullEngineOptions:()=>Hh,Observable:()=>u,Observer:()=>c,OcclusionMaterial:()=>Bg,Octree:()=>su,OctreeBlock:()=>au,OctreeSceneComponent:()=>uu,OculusTouchController:()=>Jf,OimoJSPlugin:()=>Sg,OnAfterEnteringVRObservableEvent:()=>Jc,OneMinusBlock:()=>vy,Orientation:()=>Ir,OutlineRenderer:()=>Jx,PBRAnisotropicConfiguration:()=>w_,PBRBaseMaterial:()=>W_,PBRBaseSimpleMaterial:()=>Ug,PBRClearCoatConfiguration:()=>D_,PBRIridescenceConfiguration:()=>F_,PBRMaterial:()=>H_,PBRMaterialDefines:()=>z_,PBRMetallicRoughnessBlock:()=>$y,PBRMetallicRoughnessMaterial:()=>Vg,PBRSheenConfiguration:()=>U_,PBRSpecularGlossinessMaterial:()=>kg,PBRSubSurfaceConfiguration:()=>k_,PHI:()=>f,PadNumber:()=>yt,PanoramaToCubeMapTools:()=>pg,Particle:()=>VE,ParticleBlendMultiplyBlock:()=>Pa,ParticleHelper:()=>HE,ParticleRampGradientBlock:()=>Ca,ParticleSystem:()=>GE,ParticleSystemSet:()=>WE,ParticleTextureBlock:()=>Ra,ParticlesOptimization:()=>GA,PassCubePostProcess:()=>Pl,PassPostProcess:()=>Cl,Path2:()=>Lr,Path3D:()=>wr,PathCursor:()=>en,PerfCollectionStrategy:()=>xR,PerfCounter:()=>gr,PerformanceConfigurator:()=>E,PerformanceMonitor:()=>In,PerformanceViewerCollector:()=>ER,PerturbNormalBlock:()=>wv,PhotoDome:()=>A_,Physics6DoFConstraint:()=>bS,Physics6DoFLimit:()=>yS,PhysicsAggregate:()=>PS,PhysicsBody:()=>lS,PhysicsConstraint:()=>vS,PhysicsConstraintAxis:()=>tS,PhysicsConstraintAxisLimitMode:()=>eS,PhysicsConstraintMotorType:()=>nS,PhysicsConstraintType:()=>iS,PhysicsEngine:()=>Tg,PhysicsEngineV2:()=>sS,PhysicsEventType:()=>oS,PhysicsHelper:()=>VS,PhysicsImpostor:()=>ea,PhysicsJoint:()=>Ko,PhysicsMaterialCombineMode:()=>cS,PhysicsMotionType:()=>aS,PhysicsRadialExplosionEventOptions:()=>HS,PhysicsRadialImpulseFalloff:()=>wS,PhysicsRaycastResult:()=>bg,PhysicsShape:()=>uS,PhysicsShapeBox:()=>fS,PhysicsShapeCapsule:()=>dS,PhysicsShapeContainer:()=>gS,PhysicsShapeConvexHull:()=>_S,PhysicsShapeCylinder:()=>pS,PhysicsShapeMesh:()=>mS,PhysicsShapeSphere:()=>hS,PhysicsShapeType:()=>rS,PhysicsUpdraftEventOptions:()=>XS,PhysicsUpdraftMode:()=>BS,PhysicsViewer:()=>kh,PhysicsVortexEventOptions:()=>jS,PickingInfo:()=>ji,PipelineErrorReason:()=>vp,PivotTools:()=>Fo,Plane:()=>vr,PlaneBlock:()=>RT,PlaneBuilder:()=>Bo,PlaneDragGizmo:()=>s_,PlaneRotationGizmo:()=>o_,PlayAnimationAction:()=>ne,PlaySoundAction:()=>pe,PointColor:()=>XE,PointLight:()=>hg,PointParticleEmitter:()=>za,PointerDragBehavior:()=>Vo,PointerEventTypes:()=>$i,PointerInfo:()=>ir,PointerInfoBase:()=>er,PointerInfoPre:()=>tr,PointerInput:()=>wi,PointsCloudSystem:()=>$E,PointsGroup:()=>JE,Polar:()=>wb,Polygon:()=>th,PolygonBuilder:()=>ah,PolygonMeshBuilder:()=>ih,PolyhedronBuilder:()=>gh,PolyhedronData:()=>Ih,PoseEnabledController:()=>vl,PoseEnabledControllerHelper:()=>gl,PoseEnabledControllerType:()=>dl,PositionGizmo:()=>l_,PositionNormalTextureVertex:()=>ba,PositionNormalVertex:()=>ya,PostProcess:()=>Da,PostProcessManager:()=>Yi,PostProcessRenderEffect:()=>KS,PostProcessRenderPipeline:()=>vx,PostProcessRenderPipelineManager:()=>yx,PostProcessRenderPipelineManagerSceneComponent:()=>bx,PostProcessesOptimization:()=>UA,PosterizeBlock:()=>Ny,PowBlock:()=>Ry,PowerEase:()=>Xr,PowerPreference:()=>Jd,PrePassOutputBlock:()=>Yv,PrePassRenderer:()=>jx,PrePassRendererSceneComponent:()=>Yx,PrePassTextureBlock:()=>iy,PrecisionDate:()=>st,PredicateCondition:()=>Z,PressureObserverWrapper:()=>mR,PrimitiveTopology:()=>bp,PrismaticConstraint:()=>RS,ProceduralTexture:()=>as,ProceduralTextureSceneComponent:()=>ns,PropertyTypeForEdition:()=>da,PushMaterial:()=>na,QuadraticEase:()=>jr,QuadraticErrorSimplification:()=>rT,QuarticEase:()=>Yr,Quaternion:()=>P,QueryType:()=>Fp,QuinticEase:()=>Kr,RGBDTextureTools:()=>_d,RandomBlock:()=>YT,RandomBlockLocks:()=>XT,RandomGUID:()=>Si,RandomNumberBlock:()=>Cy,RawCubeTexture:()=>Av,RawTexture:()=>Ao,RawTexture2DArray:()=>vg,RawTexture3D:()=>Rv,Ray:()=>No,RayHelper:()=>Gh,ReadFile:()=>di,ReadFileError:()=>si,RecastJSCrowd:()=>IE,RecastJSPlugin:()=>PE,ReciprocalBlock:()=>My,ReflectBlock:()=>zy,ReflectionBlock:()=>Yy,ReflectionProbe:()=>Ag,ReflectionTextureBlock:()=>$v,Reflector:()=>_R,RefractBlock:()=>Wy,RefractionBlock:()=>qy,RefractionPostProcess:()=>mx,RefractionTexture:()=>Cv,RegisterClass:()=>b,RegisterMaterialPlugin:()=>hc,RegisterNativeTypeAsync:()=>Kd,RemapBlock:()=>Fa,RenderPassTimestampLocation:()=>Op,RenderTargetTexture:()=>rs,RenderTargetWrapper:()=>Ma,RenderTargetsOptimization:()=>zA,RenderingGroup:()=>Ki,RenderingGroupInfo:()=>Qi,RenderingManager:()=>qi,ReplaceColorBlock:()=>Oy,RequestFile:()=>fi,RequestFileError:()=>ai,RetryStrategy:()=>ct,RibbonBuilder:()=>Mu,RichTypeAny:()=>PC,RichTypeBoolean:()=>OC,RichTypeColor3:()=>wC,RichTypeColor4:()=>BC,RichTypeMatrix:()=>LC,RichTypeNumber:()=>MC,RichTypeQuaternion:()=>UC,RichTypeString:()=>IC,RichTypeVector2:()=>DC,RichTypeVector3:()=>NC,RichTypeVector4:()=>FC,RollingAverage:()=>Mn,Rotate2dBlock:()=>Gy,RotationGizmo:()=>a_,RotationXBlock:()=>oE,RotationYBlock:()=>aE,RotationZBlock:()=>sE,RuntimeAnimation:()=>et,RuntimeError:()=>dt,SSAO2RenderingPipeline:()=>xx,SSAORenderingPipeline:()=>Ax,SSRRenderingPipeline:()=>Dx,SamplerBindingType:()=>fp,Scalar:()=>h,ScaleBlock:()=>ay,ScaleGizmo:()=>c_,ScalingBlock:()=>lE,Scene:()=>xr,SceneComponentConstants:()=>Zi,SceneDepthBlock:()=>ey,SceneInstrumentation:()=>Wm,SceneLoader:()=>ra,SceneLoaderAnimationGroupLoadingMode:()=>$o,SceneLoaderFlags:()=>Rn,SceneOptimization:()=>FA,SceneOptimizer:()=>XA,SceneOptimizerOptions:()=>HA,ScenePerformancePriority:()=>ar,SceneRecorder:()=>cR,SceneSerializer:()=>QA,ScreenSizeBlock:()=>Gv,ScreenSpaceBlock:()=>zv,ScreenSpaceCurvaturePostProcess:()=>wx,ScreenSpaceReflectionPostProcess:()=>Cx,ScreenshotTools:()=>oR,SerializationHelper:()=>Ue,SetColorsBlock:()=>VT,SetCorsBehavior:()=>ui,SetMaterialIDBlock:()=>iE,SetNormalsBlock:()=>BT,SetParentAction:()=>ce,SetPositionsBlock:()=>wT,SetStateAction:()=>te,SetTangentsBlock:()=>GT,SetUVsBlock:()=>UT,SetValueAction:()=>ie,ShaderCodeInliner:()=>Bd,ShaderLanguage:()=>ot,ShaderMaterial:()=>Hu,ShaderStage:()=>dp,ShaderStore:()=>Vt,ShadowDepthWrapper:()=>bb,ShadowGenerator:()=>eg,ShadowGeneratorSceneComponent:()=>ug,ShadowLight:()=>h_,ShadowMapBlock:()=>jv,ShadowsOptimization:()=>BA,ShapeBuilder:()=>uh,SharpenPostProcess:()=>gx,SheenBlock:()=>Xy,SimplexPerlin3DBlock:()=>Vy,SimplicationQueueSceneComponent:()=>nT,SimplificationQueue:()=>Jb,SimplificationSettings:()=>Zb,SimplificationType:()=>Qb,SineEase:()=>Qr,SixDofDragBehavior:()=>zo,Size:()=>We,Skeleton:()=>Cs,SkeletonViewer:()=>zh,SliderConstraint:()=>xS,SmartArray:()=>Pi,SmartArrayNoDuplicate:()=>Ii,SmoothStepBlock:()=>Iy,SolidParticle:()=>jE,SolidParticleSystem:()=>qE,SolidParticleVertex:()=>QE,Sound:()=>co,SoundTrack:()=>uo,SourceTextureFormat:()=>tm,Space:()=>Sr,SphereBlock:()=>IT,SphereBuilder:()=>xu,SphereDirectedParticleEmitter:()=>Ha,SphereParticleEmitter:()=>Wa,Spherical:()=>Bb,SphericalHarmonics:()=>ad,SphericalPolynomial:()=>sd,SpotLight:()=>__,SpringConstraint:()=>CS,Sprite:()=>uA,SpriteManager:()=>pA,SpriteMap:()=>_A,SpritePackedManager:()=>mA,SpriteSceneComponent:()=>hA,Stage:()=>Ji,StandardMaterial:()=>yc,StandardMaterialDefines:()=>vc,StandardRenderingPipeline:()=>Px,StartsWith:()=>ft,StateCondition:()=>J,StencilOperation:()=>Rp,StencilState:()=>zt,StencilStateComposer:()=>ei,StepBlock:()=>gy,StereoscopicArcRotateCamera:()=>Ul,StereoscopicFreeCamera:()=>Vl,StereoscopicGamepadCamera:()=>kl,StereoscopicInterlacePostProcess:()=>wl,StereoscopicInterlacePostProcessI:()=>Ll,StereoscopicScreenUniversalCamera:()=>zl,StereoscopicUniversalCamera:()=>Gl,StickValues:()=>Ns,StopAnimationAction:()=>oe,StopSoundAction:()=>fe,StorageBuffer:()=>Ps,StorageTextureAccess:()=>mp,StoreOp:()=>Np,StringDictionary:()=>Mi,StringTools:()=>bt,SubEmitter:()=>kE,SubEmitterType:()=>FE,SubMesh:()=>Sn,SubSurfaceBlock:()=>Zy,SubSurfaceSceneComponent:()=>qx,SubtractBlock:()=>my,SurfaceMagnetismBehavior:()=>Wo,SwitchBooleanAction:()=>ee,SwitchInput:()=>Gi,TBNBlock:()=>Lv,TGATools:()=>nv,Tags:()=>me,TargetCamera:()=>nl,TargetedAnimation:()=>Jr,TeleportInBlock:()=>TE,TeleportOutBlock:()=>EE,TestBase64DataUrl:()=>gi,TextFileAssetTask:()=>EA,Texture:()=>To,TextureAspect:()=>ap,TextureAssetTask:()=>AA,TextureBlock:()=>Zv,TextureDimension:()=>rp,TextureFormat:()=>sp,TextureOptimization:()=>LA,TexturePacker:()=>Ev,TexturePackerFrame:()=>Tv,TextureSampleType:()=>_p,TextureSampler:()=>Ht,TextureTools:()=>fd,TextureUsage:()=>np,TextureViewDimension:()=>op,ThinEngine:()=>ii,ThinRenderTargetTexture:()=>Pv,ThinTexture:()=>_o,TiledBoxBuilder:()=>Vu,TiledPlaneBuilder:()=>wu,TimerState:()=>Im,TmpColors:()=>V,TmpVectors:()=>O,ToGammaSpace:()=>d,ToHalfFloat:()=>ud,ToLinearSpace:()=>p,TonemapPostProcess:()=>Fx,TonemappingOperator:()=>Nx,Tools:()=>Ai,TorusBlock:()=>OT,TorusBuilder:()=>Vc,TorusKnotBuilder:()=>zu,TouchCamera:()=>al,TrailMesh:()=>qb,Trajectory:()=>uR,TrajectoryClassifier:()=>fR,TranscodeAsync:()=>fv,TranscodeTarget:()=>im,TransformBlock:()=>ha,TransformNode:()=>Fn,TranslationBlock:()=>uE,TriPlanarBlock:()=>sb,TrigonometryBlock:()=>ss,TrigonometryBlockOperations:()=>os,TubeBuilder:()=>fh,TwirlBlock:()=>Wv,UniformBuffer:()=>Wi,UniversalCamera:()=>Al,UnregisterAllMaterialPlugins:()=>pc,UnregisterMaterialPlugin:()=>dc,UploadContent:()=>rv,UploadEnvLevelsAsync:()=>Rd,UploadEnvSpherical:()=>Id,UploadLevelsAsync:()=>Pd,UtilityLayerRenderer:()=>hu,VRCameraMetrics:()=>Hl,VRDeviceOrientationArcRotateCamera:()=>Zl,VRDeviceOrientationFreeCamera:()=>Jl,VRDeviceOrientationGamepadCamera:()=>$l,VRDistortionCorrectionPostProcess:()=>Xl,VRExperienceHelper:()=>$c,VRMultiviewToSingleviewPostProcess:()=>Ql,ValidatedNativeDataStream:()=>Up,ValueCondition:()=>q,Vector2:()=>A,Vector3:()=>R,Vector4:()=>C,VectorConverterBlock:()=>$T,VectorMergerBlock:()=>Na,VectorSplitterBlock:()=>py,VertexAnimationBaker:()=>Ro,VertexBuffer:()=>Xi,VertexData:()=>An,VertexDataMaterialInfo:()=>xn,VertexFormat:()=>Pp,VertexOutputBlock:()=>pa,VertexStepMode:()=>Ip,VideoDome:()=>Gm,VideoRecorder:()=>qA,VideoTexture:()=>km,ViewDirectionBlock:()=>yy,Viewport:()=>un,VirtualJoystick:()=>il,VirtualJoysticksCamera:()=>Wl,ViveController:()=>$f,VolumetricLightScatteringPostProcess:()=>Lx,VoronoiNoiseBlock:()=>ob,WaveBlock:()=>Fy,WaveBlockKind:()=>Dy,WebGL2ParticleSystem:()=>DE,WebGL2ShaderProcessor:()=>Kt,WebGLDataBuffer:()=>qt,WebGLHardwareTexture:()=>Jt,WebGLPipelineContext:()=>Zt,WebGPUCacheBindGroups:()=>bf,WebGPUCacheRenderPipeline:()=>hf,WebGPUCacheRenderPipelineTree:()=>pf,WebGPUCacheSampler:()=>lf,WebGPUDataBuffer:()=>tf,WebGPUDrawContext:()=>vf,WebGPUEngine:()=>kf,WebGPUTintWASM:()=>Ff,WebRequest:()=>He,WebVRController:()=>rc,WebVRFreeCamera:()=>ic,WebXRAbstractFeature:()=>Yo,WebXRAbstractMotionController:()=>mm,WebXRAnchorSystem:()=>PR,WebXRBackgroundRemover:()=>OR,WebXRCamera:()=>pm,WebXRCompositionLayerWrapper:()=>QR,WebXRControllerComponent:()=>_m,WebXRControllerMovement:()=>GR,WebXRControllerPhysics:()=>NR,WebXRControllerPointerSelection:()=>Cm,WebXRDefaultExperience:()=>Bm,WebXRDefaultExperienceOptions:()=>wm,WebXRDepthSensing:()=>iC,WebXRDomOverlay:()=>kR,WebXREnterExitUI:()=>Dm,WebXREnterExitUIButton:()=>Mm,WebXREnterExitUIOptions:()=>Om,WebXRExperienceHelper:()=>fm,WebXREyeTracking:()=>WR,WebXRFeatureName:()=>Xo,WebXRFeaturePointSystem:()=>LR,WebXRFeaturesManager:()=>jo,WebXRGenericHandController:()=>aC,WebXRGenericTriggerMotionController:()=>gm,WebXRHTCViveMotionController:()=>dC,WebXRHand:()=>Es,WebXRHandJoint:()=>_s,WebXRHandTracking:()=>Ss,WebXRHitTest:()=>FR,WebXRHitTestLegacy:()=>RR,WebXRImageTracking:()=>VR,WebXRInput:()=>Rm,WebXRInputSource:()=>Am,WebXRLayers:()=>tC,WebXRLightEstimation:()=>zR,WebXRManagedOutputCanvas:()=>Ic,WebXRManagedOutputCanvasOptions:()=>Pc,WebXRMeshDetector:()=>UR,WebXRMicrosoftMixedRealityController:()=>lC,WebXRMotionControllerManager:()=>Tm,WebXRMotionControllerTeleportation:()=>Lm,WebXRNearControllerMode:()=>Sm,WebXRNearInteraction:()=>Pm,WebXROculusTouchMotionController:()=>uC,WebXRPlaneDetector:()=>MR,WebXRProfiledMotionController:()=>ym,WebXRProjectionLayerWrapper:()=>ZR,WebXRSessionManager:()=>Nc,WebXRSpaceWarp:()=>oC,WebXRSpaceWarpRenderTargetTextureProvider:()=>nC,WebXRState:()=>Tc,WebXRTrackingState:()=>Ec,WebXRWalkingLocomotion:()=>KR,WeightedSound:()=>po,WindowsMotionController:()=>t_,WorkerPool:()=>om,WorleyNoise3DBlock:()=>Uy,XRSpaceWarpRenderTarget:()=>rC,XRWindowsMotionController:()=>i_,Xbox360Button:()=>_l,Xbox360Dpad:()=>ml,Xbox360Pad:()=>Tl,XboxInput:()=>ki,_BabylonLoaderRegistered:()=>Rg,_BasisTextureLoader:()=>yv,_CreationDataStorage:()=>qn,_DDSTextureLoader:()=>$_,_ENVTextureLoader:()=>em,_HDRTextureLoader:()=>av,_IAnimationState:()=>Xe,_InstancesBatch:()=>Jn,_KTXTextureLoader:()=>dm,_MeshCollisionData:()=>Ln,_OcclusionDataStorage:()=>Yh,_PrimaryIsoTriangle:()=>Ph,_TGATextureLoader:()=>ov,_TimeToken:()=>jh,_UpdateRGBDAsync:()=>Md,_forceSceneHelpersToBundle:()=>Um,_forceTransformFeedbackToBundle:()=>Kh,_injectLTSFileTools:()=>Ti,addClipPlaneUniforms:()=>Vn,allocateAndCopyTypedBuffer:()=>On,bindClipPlane:()=>zn,captureEquirectangularFromScene:()=>AR,className:()=>Ri,createDetailMapPlugin:()=>Ib,createPBRAnisotropicPlugin:()=>Sb,createPBRBRDFPlugin:()=>xb,createPBRClearCoatPlugin:()=>Ab,createPBRIridescencePlugin:()=>Rb,createPBRSheenPlugin:()=>Cb,createPBRSubSurfacePlugin:()=>Pb,createYieldingScheduler:()=>nn,editableInPropertyPage:()=>fa,expandToProperty:()=>Se,extractMinAndMax:()=>En,extractMinAndMaxIndexed:()=>Tn,getRichTypeFromValue:()=>VC,inlineScheduler:()=>rn,makeAsyncFunction:()=>cn,makeSyncFunction:()=>ln,nativeOverride:()=>Ve,normalizeEnvInfo:()=>Ed,prepareDefinesForClipPlanes:()=>Gn,prepareStringDefinesForClipPlanes:()=>kn,runCoroutine:()=>on,runCoroutineAsync:()=>sn,runCoroutineSync:()=>an,serialize:()=>xe,serializeAsCameraReference:()=>we,serializeAsColor3:()=>Re,serializeAsColor4:()=>De,serializeAsColorCurves:()=>Oe,serializeAsFresnelParameters:()=>Ce,serializeAsImageProcessingConfiguration:()=>Ne,serializeAsMatrix:()=>Le,serializeAsMeshReference:()=>Me,serializeAsQuaternion:()=>Fe,serializeAsTexture:()=>Ae,serializeAsVector2:()=>Pe,serializeAsVector3:()=>Ie,setAndStartTimer:()=>Nm,setStereoscopicAnaglyphRigMode:()=>Ml,setStereoscopicRigMode:()=>Bl,setVRRigMode:()=>ql,setWebVRRigMode:()=>tc});var o=function(){function e(){this.rootNodes=new Array,this.cameras=new Array,this.lights=new Array,this.meshes=new Array,this.skeletons=new Array,this.particleSystems=new Array,this.animations=[],this.animationGroups=new Array,this.multiMaterials=new Array,this.materials=new Array,this.morphTargetManagers=new Array,this.geometries=new Array,this.transformNodes=new Array,this.actionManagers=new Array,this.textures=new Array,this._environmentTexture=null,this.postProcesses=new Array}return e.AddParser=function(e,t){this._BabylonFileParsers[e]=t},e.GetParser=function(e){return this._BabylonFileParsers[e]?this._BabylonFileParsers[e]:null},e.AddIndividualParser=function(e,t){this._IndividualBabylonFileParsers[e]=t},e.GetIndividualParser=function(e){return this._IndividualBabylonFileParsers[e]?this._IndividualBabylonFileParsers[e]:null},e.Parse=function(e,t,i,r){for(var n in this._BabylonFileParsers)Object.prototype.hasOwnProperty.call(this._BabylonFileParsers,n)&&this._BabylonFileParsers[n](e,t,i,r)},Object.defineProperty(e.prototype,"environmentTexture",{get:function(){return this._environmentTexture},set:function(e){this._environmentTexture=e},enumerable:!1,configurable:!0}),e.prototype.getNodes=function(){var e=new Array;return e=(e=(e=(e=e.concat(this.meshes)).concat(this.lights)).concat(this.cameras)).concat(this.transformNodes),this.skeletons.forEach((function(t){return e=e.concat(t.bones)})),e},e._BabylonFileParsers={},e._IndividualBabylonFileParsers={},e}(),a=function(){function e(){}return e.ALPHA_DISABLE=0,e.ALPHA_ADD=1,e.ALPHA_COMBINE=2,e.ALPHA_SUBTRACT=3,e.ALPHA_MULTIPLY=4,e.ALPHA_MAXIMIZED=5,e.ALPHA_ONEONE=6,e.ALPHA_PREMULTIPLIED=7,e.ALPHA_PREMULTIPLIED_PORTERDUFF=8,e.ALPHA_INTERPOLATE=9,e.ALPHA_SCREENMODE=10,e.ALPHA_ONEONE_ONEONE=11,e.ALPHA_ALPHATOCOLOR=12,e.ALPHA_REVERSEONEMINUS=13,e.ALPHA_SRC_DSTONEMINUSSRCALPHA=14,e.ALPHA_ONEONE_ONEZERO=15,e.ALPHA_EXCLUSION=16,e.ALPHA_LAYER_ACCUMULATE=17,e.ALPHA_EQUATION_ADD=0,e.ALPHA_EQUATION_SUBSTRACT=1,e.ALPHA_EQUATION_REVERSE_SUBTRACT=2,e.ALPHA_EQUATION_MAX=3,e.ALPHA_EQUATION_MIN=4,e.ALPHA_EQUATION_DARKEN=5,e.DELAYLOADSTATE_NONE=0,e.DELAYLOADSTATE_LOADED=1,e.DELAYLOADSTATE_LOADING=2,e.DELAYLOADSTATE_NOTLOADED=4,e.NEVER=512,e.ALWAYS=519,e.LESS=513,e.EQUAL=514,e.LEQUAL=515,e.GREATER=516,e.GEQUAL=518,e.NOTEQUAL=517,e.KEEP=7680,e.ZERO=0,e.REPLACE=7681,e.INCR=7682,e.DECR=7683,e.INVERT=5386,e.INCR_WRAP=34055,e.DECR_WRAP=34056,e.TEXTURE_CLAMP_ADDRESSMODE=0,e.TEXTURE_WRAP_ADDRESSMODE=1,e.TEXTURE_MIRROR_ADDRESSMODE=2,e.TEXTURE_CREATIONFLAG_STORAGE=1,e.TEXTUREFORMAT_ALPHA=0,e.TEXTUREFORMAT_LUMINANCE=1,e.TEXTUREFORMAT_LUMINANCE_ALPHA=2,e.TEXTUREFORMAT_RGB=4,e.TEXTUREFORMAT_RGBA=5,e.TEXTUREFORMAT_RED=6,e.TEXTUREFORMAT_R=6,e.TEXTUREFORMAT_RG=7,e.TEXTUREFORMAT_RED_INTEGER=8,e.TEXTUREFORMAT_R_INTEGER=8,e.TEXTUREFORMAT_RG_INTEGER=9,e.TEXTUREFORMAT_RGB_INTEGER=10,e.TEXTUREFORMAT_RGBA_INTEGER=11,e.TEXTUREFORMAT_BGRA=12,e.TEXTUREFORMAT_DEPTH24_STENCIL8=13,e.TEXTUREFORMAT_DEPTH32_FLOAT=14,e.TEXTUREFORMAT_DEPTH16=15,e.TEXTUREFORMAT_DEPTH24=16,e.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8=17,e.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8=18,e.TEXTUREFORMAT_STENCIL8=19,e.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM=36492,e.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM=36493,e.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT=36495,e.TEXTUREFORMAT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT=36494,e.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5=33779,e.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919,e.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT3=33778,e.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918,e.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1=33777,e.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1=33776,e.TEXTUREFORMAT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917,e.TEXTUREFORMAT_COMPRESSED_SRGB_S3TC_DXT1_EXT=35916,e.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4=37808,e.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840,e.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL=36196,e.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2=37492,e.TEXTUREFORMAT_COMPRESSED_SRGB8_ETC2=37493,e.TEXTUREFORMAT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494,e.TEXTUREFORMAT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495,e.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC=37496,e.TEXTUREFORMAT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497,e.TEXTURETYPE_UNSIGNED_BYTE=0,e.TEXTURETYPE_UNSIGNED_INT=0,e.TEXTURETYPE_FLOAT=1,e.TEXTURETYPE_HALF_FLOAT=2,e.TEXTURETYPE_BYTE=3,e.TEXTURETYPE_SHORT=4,e.TEXTURETYPE_UNSIGNED_SHORT=5,e.TEXTURETYPE_INT=6,e.TEXTURETYPE_UNSIGNED_INTEGER=7,e.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4=8,e.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1=9,e.TEXTURETYPE_UNSIGNED_SHORT_5_6_5=10,e.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV=11,e.TEXTURETYPE_UNSIGNED_INT_24_8=12,e.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV=13,e.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV=14,e.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV=15,e.TEXTURETYPE_UNDEFINED=16,e.TEXTURE_2D=3553,e.TEXTURE_2D_ARRAY=35866,e.TEXTURE_CUBE_MAP=34067,e.TEXTURE_CUBE_MAP_ARRAY=3735928559,e.TEXTURE_3D=32879,e.TEXTURE_NEAREST_SAMPLINGMODE=1,e.TEXTURE_NEAREST_NEAREST=1,e.TEXTURE_BILINEAR_SAMPLINGMODE=2,e.TEXTURE_LINEAR_LINEAR=2,e.TEXTURE_TRILINEAR_SAMPLINGMODE=3,e.TEXTURE_LINEAR_LINEAR_MIPLINEAR=3,e.TEXTURE_NEAREST_NEAREST_MIPNEAREST=4,e.TEXTURE_NEAREST_LINEAR_MIPNEAREST=5,e.TEXTURE_NEAREST_LINEAR_MIPLINEAR=6,e.TEXTURE_NEAREST_LINEAR=7,e.TEXTURE_NEAREST_NEAREST_MIPLINEAR=8,e.TEXTURE_LINEAR_NEAREST_MIPNEAREST=9,e.TEXTURE_LINEAR_NEAREST_MIPLINEAR=10,e.TEXTURE_LINEAR_LINEAR_MIPNEAREST=11,e.TEXTURE_LINEAR_NEAREST=12,e.TEXTURE_EXPLICIT_MODE=0,e.TEXTURE_SPHERICAL_MODE=1,e.TEXTURE_PLANAR_MODE=2,e.TEXTURE_CUBIC_MODE=3,e.TEXTURE_PROJECTION_MODE=4,e.TEXTURE_SKYBOX_MODE=5,e.TEXTURE_INVCUBIC_MODE=6,e.TEXTURE_EQUIRECTANGULAR_MODE=7,e.TEXTURE_FIXED_EQUIRECTANGULAR_MODE=8,e.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE=9,e.TEXTURE_FILTERING_QUALITY_OFFLINE=4096,e.TEXTURE_FILTERING_QUALITY_HIGH=64,e.TEXTURE_FILTERING_QUALITY_MEDIUM=16,e.TEXTURE_FILTERING_QUALITY_LOW=8,e.SCALEMODE_FLOOR=1,e.SCALEMODE_NEAREST=2,e.SCALEMODE_CEILING=3,e.MATERIAL_TextureDirtyFlag=1,e.MATERIAL_LightDirtyFlag=2,e.MATERIAL_FresnelDirtyFlag=4,e.MATERIAL_AttributesDirtyFlag=8,e.MATERIAL_MiscDirtyFlag=16,e.MATERIAL_PrePassDirtyFlag=32,e.MATERIAL_AllDirtyFlag=63,e.MATERIAL_TriangleFillMode=0,e.MATERIAL_WireFrameFillMode=1,e.MATERIAL_PointFillMode=2,e.MATERIAL_PointListDrawMode=3,e.MATERIAL_LineListDrawMode=4,e.MATERIAL_LineLoopDrawMode=5,e.MATERIAL_LineStripDrawMode=6,e.MATERIAL_TriangleStripDrawMode=7,e.MATERIAL_TriangleFanDrawMode=8,e.MATERIAL_ClockWiseSideOrientation=0,e.MATERIAL_CounterClockWiseSideOrientation=1,e.ACTION_NothingTrigger=0,e.ACTION_OnPickTrigger=1,e.ACTION_OnLeftPickTrigger=2,e.ACTION_OnRightPickTrigger=3,e.ACTION_OnCenterPickTrigger=4,e.ACTION_OnPickDownTrigger=5,e.ACTION_OnDoublePickTrigger=6,e.ACTION_OnPickUpTrigger=7,e.ACTION_OnPickOutTrigger=16,e.ACTION_OnLongPressTrigger=8,e.ACTION_OnPointerOverTrigger=9,e.ACTION_OnPointerOutTrigger=10,e.ACTION_OnEveryFrameTrigger=11,e.ACTION_OnIntersectionEnterTrigger=12,e.ACTION_OnIntersectionExitTrigger=13,e.ACTION_OnKeyDownTrigger=14,e.ACTION_OnKeyUpTrigger=15,e.PARTICLES_BILLBOARDMODE_Y=2,e.PARTICLES_BILLBOARDMODE_ALL=7,e.PARTICLES_BILLBOARDMODE_STRETCHED=8,e.PARTICLES_BILLBOARDMODE_STRETCHED_LOCAL=9,e.MESHES_CULLINGSTRATEGY_STANDARD=0,e.MESHES_CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY=1,e.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION=2,e.MESHES_CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY=3,e.SCENELOADER_NO_LOGGING=0,e.SCENELOADER_MINIMAL_LOGGING=1,e.SCENELOADER_SUMMARY_LOGGING=2,e.SCENELOADER_DETAILED_LOGGING=3,e.PREPASS_IRRADIANCE_TEXTURE_TYPE=0,e.PREPASS_POSITION_TEXTURE_TYPE=1,e.PREPASS_VELOCITY_TEXTURE_TYPE=2,e.PREPASS_REFLECTIVITY_TEXTURE_TYPE=3,e.PREPASS_COLOR_TEXTURE_TYPE=4,e.PREPASS_DEPTH_TEXTURE_TYPE=5,e.PREPASS_NORMAL_TEXTURE_TYPE=6,e.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE=7,e.BUFFER_CREATIONFLAG_READ=1,e.BUFFER_CREATIONFLAG_WRITE=2,e.BUFFER_CREATIONFLAG_READWRITE=3,e.BUFFER_CREATIONFLAG_UNIFORM=4,e.BUFFER_CREATIONFLAG_VERTEX=8,e.BUFFER_CREATIONFLAG_INDEX=16,e.BUFFER_CREATIONFLAG_STORAGE=32,e.RENDERPASS_MAIN=0,e.INPUT_ALT_KEY=18,e.INPUT_CTRL_KEY=17,e.INPUT_META_KEY1=91,e.INPUT_META_KEY2=92,e.INPUT_META_KEY3=93,e.INPUT_SHIFT_KEY=16,e.SNAPSHOTRENDERING_STANDARD=0,e.SNAPSHOTRENDERING_FAST=1,e.PERSPECTIVE_CAMERA=0,e.ORTHOGRAPHIC_CAMERA=1,e.FOVMODE_VERTICAL_FIXED=0,e.FOVMODE_HORIZONTAL_FIXED=1,e.RIG_MODE_NONE=0,e.RIG_MODE_STEREOSCOPIC_ANAGLYPH=10,e.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL=11,e.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED=12,e.RIG_MODE_STEREOSCOPIC_OVERUNDER=13,e.RIG_MODE_STEREOSCOPIC_INTERLACED=14,e.RIG_MODE_VR=20,e.RIG_MODE_WEBVR=21,e.RIG_MODE_CUSTOM=22,e.MAX_SUPPORTED_UV_SETS=6,e.GL_ALPHA_EQUATION_ADD=32774,e.GL_ALPHA_EQUATION_MIN=32775,e.GL_ALPHA_EQUATION_MAX=32776,e.GL_ALPHA_EQUATION_SUBTRACT=32778,e.GL_ALPHA_EQUATION_REVERSE_SUBTRACT=32779,e.GL_ALPHA_FUNCTION_SRC=768,e.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR=769,e.GL_ALPHA_FUNCTION_SRC_ALPHA=770,e.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA=771,e.GL_ALPHA_FUNCTION_DST_ALPHA=772,e.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA=773,e.GL_ALPHA_FUNCTION_DST_COLOR=774,e.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR=775,e.GL_ALPHA_FUNCTION_SRC_ALPHA_SATURATED=776,e.GL_ALPHA_FUNCTION_CONSTANT_COLOR=32769,e.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR=32770,e.GL_ALPHA_FUNCTION_CONSTANT_ALPHA=32771,e.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA=32772,e.SnippetUrl="https://snippet.babylonjs.com",e}(),s=function(){function e(){this.hoverCursor="",this.actions=new Array,this.isRecursive=!1}return Object.defineProperty(e,"HasTriggers",{get:function(){for(var t in e.Triggers)if(Object.prototype.hasOwnProperty.call(e.Triggers,t))return!0;return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e,"HasPickTriggers",{get:function(){for(var t in e.Triggers)if(Object.prototype.hasOwnProperty.call(e.Triggers,t)){var i=parseInt(t);if(i>=a.ACTION_OnPickTrigger&&i<=a.ACTION_OnPickUpTrigger)return!0}return!1},enumerable:!1,configurable:!0}),e.HasSpecificTrigger=function(t){for(var i in e.Triggers)if(Object.prototype.hasOwnProperty.call(e.Triggers,i)&&parseInt(i)===t)return!0;return!1},e.Triggers={},e}(),l=function(){function e(e,t,i,r){void 0===t&&(t=!1),this.initialize(e,t,i,r)}return e.prototype.initialize=function(e,t,i,r){return void 0===t&&(t=!1),this.mask=e,this.skipNextObservers=t,this.target=i,this.currentTarget=r,this},e}(),c=function(){function e(e,t,i){void 0===i&&(i=null),this.callback=e,this.mask=t,this.scope=i,this._willBeUnregistered=!1,this.unregisterOnNextCall=!1,this._remove=null}return e.prototype.remove=function(){this._remove&&this._remove()},e}(),u=function(){function e(e,t){void 0===t&&(t=!1),this.notifyIfTriggered=t,this._observers=new Array,this._numObserversMarkedAsDeleted=0,this._hasNotified=!1,this._eventState=new l(0),e&&(this._onObserverAdded=e)}return e.FromPromise=function(t,i){var r=new e;return t.then((function(e){r.notifyObservers(e)})).catch((function(e){if(!i)throw e;i.notifyObservers(e)})),r},Object.defineProperty(e.prototype,"observers",{get:function(){return this._observers},enumerable:!1,configurable:!0}),e.prototype.add=function(e,t,i,r,n){var o=this;if(void 0===t&&(t=-1),void 0===i&&(i=!1),void 0===r&&(r=null),void 0===n&&(n=!1),!e)return null;var a=new c(e,t,r);return a.unregisterOnNextCall=n,i?this._observers.unshift(a):this._observers.push(a),this._onObserverAdded&&this._onObserverAdded(a),this._hasNotified&&this.notifyIfTriggered&&void 0!==this._lastNotifiedValue&&this.notifyObserver(a,this._lastNotifiedValue),a._remove=function(){o.remove(a)},a},e.prototype.addOnce=function(e){return this.add(e,void 0,void 0,void 0,!0)},e.prototype.remove=function(e){return!!e&&(e._remove=null,-1!==this._observers.indexOf(e)&&(this._deferUnregister(e),!0))},e.prototype.removeCallback=function(e,t){for(var i=0;i0},e.prototype.clear=function(){for(;this._observers.length;){var e=this._observers.pop();e&&(e._remove=null)}this._onObserverAdded=null,this._numObserversMarkedAsDeleted=0,this.cleanLastNotifiedState()},e.prototype.cleanLastNotifiedState=function(){this._hasNotified=!1,this._lastNotifiedValue=void 0},e.prototype.clone=function(){var t=new e;return t._observers=this._observers.slice(0),t},e.prototype.hasSpecificMask=function(e){void 0===e&&(e=-1);for(var t=0,i=this._observers;t0?1:-1},e.Clamp=function(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=1),Math.min(i,Math.max(t,e))},e.Log2=function(e){return Math.log(e)*Math.LOG2E},e.ILog2=function(e){if(Math.log2)return Math.floor(Math.log2(e));if(e<0)return NaN;if(0===e)return-1/0;var t=0;if(e<1){for(;e<1;)t++,e*=2;t=-t}else if(e>1)for(;e>1;)t++,e=Math.floor(e/2);return t},e.Repeat=function(e,t){return e-Math.floor(e/t)*t},e.Normalize=function(e,t,i){return(e-t)/(i-t)},e.Denormalize=function(e,t,i){return e*(i-t)+t},e.DeltaAngle=function(t,i){var r=e.Repeat(i-t,360);return r>180&&(r-=360),r},e.PingPong=function(t,i){var r=e.Repeat(t,2*i);return i-Math.abs(r-i)},e.SmoothStep=function(t,i,r){var n=e.Clamp(r);return i*(n=-2*n*n*n+3*n*n)+t*(1-n)},e.MoveTowards=function(t,i,r){return Math.abs(i-t)<=r?i:t+e.Sign(i-t)*r},e.MoveTowardsAngle=function(t,i,r){var n=e.DeltaAngle(t,i),o=0;return-r180&&(n-=360),t+n*e.Clamp(r)},e.InverseLerp=function(t,i,r){return t!=i?e.Clamp((r-t)/(i-t)):0},e.Hermite=function(e,t,i,r,n){var o=n*n,a=n*o;return e*(2*a-3*o+1)+i*(-2*a+3*o)+t*(a-2*o+n)+r*(a-o)},e.Hermite1stDerivative=function(e,t,i,r,n){var o=n*n;return 6*(o-n)*e+(3*o-4*n+1)*t+6*(-o+n)*i+(3*o-2*n)*r},e.RandomRange=function(e,t){return e===t?e:Math.random()*(t-e)+e},e.RangeToPercent=function(e,t,i){return(e-t)/(i-t)},e.PercentToRange=function(e,t,i){return(i-t)*e+t},e.NormalizeRadians=function(t){return t-e.TwoPi*Math.floor((t+Math.PI)/e.TwoPi)},e.HCF=function(t,i){var r=t%i;return 0===r?i:e.HCF(i,r)},e.TwoPi=2*Math.PI,e}(),d=1/2.2,p=2.2,f=(1+Math.sqrt(5))/2,_=.001,m=function(){function e(){}return e.BuildArray=function(e,t){for(var i=[],r=0;ri.x?i.x:r)i.y?i.y:n)t.x?e.x:t.x,r=e.y>t.y?e.y:t.y;return new e.constructor(i,r)},e.Transform=function(t,i){var r=new t.constructor;return e.TransformToRef(t,i,r),r},e.TransformToRef=function(e,t,i){var r=t.m,n=e.x*r[0]+e.y*r[4]+r[12],o=e.x*r[1]+e.y*r[5]+r[13];return i.x=n,i.y=o,i},e.PointInTriangle=function(e,t,i,r){var n=.5*(-i.y*r.x+t.y*(-i.x+r.x)+t.x*(i.y-r.y)+i.x*r.y),o=n<0?-1:1,a=(t.y*r.x-t.x*r.y+(r.y-t.y)*e.x+(t.x-r.x)*e.y)*o,s=(t.x*i.y-t.y*i.x+(t.y-i.y)*e.x+(i.x-t.x)*e.y)*o;return a>0&&s>0&&a+s<2*n*o},e.Distance=function(t,i){return Math.sqrt(e.DistanceSquared(t,i))},e.DistanceSquared=function(e,t){var i=e.x-t.x,r=e.y-t.y;return i*i+r*r},e.Center=function(t,i){var r=new t.constructor;return e.CenterToRef(t,i,r)},e.CenterToRef=function(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2)},e.DistanceOfPointFromSegment=function(t,i,r){var n=e.DistanceSquared(i,r);if(0===n)return e.Distance(t,i);var o=r.subtract(i),a=Math.max(0,Math.min(1,e.Dot(t.subtract(i),o)/n)),s=i.add(o.multiplyByFloats(a,a));return e.Distance(t,s)},e._ZeroReadOnly=e.Zero(),e}(),R=function(){function e(e,t,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),this._isDirty=!0,this._x=e,this._y=t,this._z=i}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(e){this._z=e,this._isDirty=!0},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"{X: ".concat(this._x," Y: ").concat(this._y," Z: ").concat(this._z,"}")},e.prototype.getClassName=function(){return"Vector3"},e.prototype.getHashCode=function(){var e=x(this._x);return 397*(e=397*e^x(this._y))^x(this._z)},e.prototype.asArray=function(){var e=[];return this.toArray(e,0),e},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,this},e.prototype.fromArray=function(t,i){return void 0===i&&(i=0),e.FromArrayToRef(t,i,this),this},e.prototype.toQuaternion=function(){return P.RotationYawPitchRoll(this._y,this._x,this._z)},e.prototype.addInPlace=function(e){return this.addInPlaceFromFloats(e._x,e._y,e._z)},e.prototype.addInPlaceFromFloats=function(e,t,i){return this._x+=e,this._y+=t,this._z+=i,this._isDirty=!0,this},e.prototype.add=function(e){return new this.constructor(this._x+e._x,this._y+e._y,this._z+e._z)},e.prototype.addToRef=function(e,t){return t.copyFromFloats(this._x+e._x,this._y+e._y,this._z+e._z)},e.prototype.subtractInPlace=function(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._isDirty=!0,this},e.prototype.subtract=function(e){return new this.constructor(this._x-e._x,this._y-e._y,this._z-e._z)},e.prototype.subtractToRef=function(e,t){return this.subtractFromFloatsToRef(e._x,e._y,e._z,t)},e.prototype.subtractFromFloats=function(e,t,i){return new this.constructor(this._x-e,this._y-t,this._z-i)},e.prototype.subtractFromFloatsToRef=function(e,t,i,r){return r.copyFromFloats(this._x-e,this._y-t,this._z-i)},e.prototype.negate=function(){return new this.constructor(-this._x,-this._y,-this._z)},e.prototype.negateInPlace=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this},e.prototype.negateToRef=function(e){return e.copyFromFloats(-1*this._x,-1*this._y,-1*this._z)},e.prototype.scaleInPlace=function(e){return this._x*=e,this._y*=e,this._z*=e,this._isDirty=!0,this},e.prototype.scale=function(e){return new this.constructor(this._x*e,this._y*e,this._z*e)},e.prototype.scaleToRef=function(e,t){return t.copyFromFloats(this._x*e,this._y*e,this._z*e)},e.prototype.getNormalToRef=function(e){var t=this.length(),i=Math.acos(this.y/t),r=Math.atan2(this.z,this.x);i>Math.PI/2?i-=Math.PI/2:i+=Math.PI/2;var n=t*Math.sin(i)*Math.cos(r),o=t*Math.cos(i),a=t*Math.sin(i)*Math.sin(r);return e.set(n,o,a),e},e.prototype.applyRotationQuaternionToRef=function(e,t){var i=this._x,r=this._y,n=this._z,o=e._x,a=e._y,s=e._z,l=e._w,c=2*(a*n-s*r),u=2*(s*i-o*n),h=2*(o*r-a*i);return t._x=i+l*c+a*h-s*u,t._y=r+l*u+s*c-o*h,t._z=n+l*h+o*u-a*c,t._isDirty=!0,t},e.prototype.applyRotationQuaternionInPlace=function(e){return this.applyRotationQuaternionToRef(e,this)},e.prototype.applyRotationQuaternion=function(e){return this.applyRotationQuaternionToRef(e,new this.constructor)},e.prototype.scaleAndAddToRef=function(e,t){return t.addInPlaceFromFloats(this._x*e,this._y*e,this._z*e)},e.prototype.projectOnPlane=function(e,t){var i=new this.constructor;return this.projectOnPlaneToRef(e,t,i),i},e.prototype.projectOnPlaneToRef=function(t,i,r){var n=t.normal,o=t.d,a=M.Vector3[0];this.subtractToRef(i,a),a.normalize();var s=e.Dot(a,n);if(Math.abs(s)this._x&&(this.x=e),t>this._y&&(this.y=t),i>this._z&&(this.z=i),this},e.prototype.isNonUniformWithinEpsilon=function(e){var t=Math.abs(this._x),i=Math.abs(this._y);if(!h.WithinEpsilon(t,i,e))return!0;var r=Math.abs(this._z);return!h.WithinEpsilon(t,r,e)||!h.WithinEpsilon(i,r,e)},Object.defineProperty(e.prototype,"isNonUniform",{get:function(){var e=Math.abs(this._x);return e!==Math.abs(this._y)||e!==Math.abs(this._z)},enumerable:!1,configurable:!0}),e.prototype.floor=function(){return new this.constructor(Math.floor(this._x),Math.floor(this._y),Math.floor(this._z))},e.prototype.fract=function(){return new this.constructor(this._x-Math.floor(this._x),this._y-Math.floor(this._y),this._z-Math.floor(this._z))},e.prototype.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z)},e.prototype.lengthSquared=function(){return this._x*this._x+this._y*this._y+this._z*this._z},Object.defineProperty(e.prototype,"hasAZeroComponent",{get:function(){return this._x*this._y*this._z==0},enumerable:!1,configurable:!0}),e.prototype.normalize=function(){return this.normalizeFromLength(this.length())},e.prototype.reorderInPlace=function(e){var t=this;return"xyz"===(e=e.toLowerCase())||(M.Vector3[0].copyFrom(this),["x","y","z"].forEach((function(i,r){t[i]=M.Vector3[0][e[r]]}))),this},e.prototype.rotateByQuaternionToRef=function(t,i){return t.toRotationMatrix(M.Matrix[0]),e.TransformCoordinatesToRef(this,M.Matrix[0],i),i},e.prototype.rotateByQuaternionAroundPointToRef=function(e,t,i){return this.subtractToRef(t,M.Vector3[0]),M.Vector3[0].rotateByQuaternionToRef(e,M.Vector3[0]),t.addToRef(M.Vector3[0],i),i},e.prototype.cross=function(t){var i=new this.constructor;return e.CrossToRef(this,t,i)},e.prototype.normalizeFromLength=function(e){return 0===e||1===e?this:this.scaleInPlace(1/e)},e.prototype.normalizeToNew=function(){var e=new this.constructor(0,0,0);return this.normalizeToRef(e),e},e.prototype.normalizeToRef=function(e){var t=this.length();return 0===t||1===t?e.copyFromFloats(this._x,this._y,this._z):this.scaleToRef(1/t,e)},e.prototype.clone=function(){return new this.constructor(this._x,this._y,this._z)},e.prototype.copyFrom=function(e){return this.copyFromFloats(e._x,e._y,e._z)},e.prototype.copyFromFloats=function(e,t,i){return this._x=e,this._y=t,this._z=i,this._isDirty=!0,this},e.prototype.set=function(e,t,i){return this.copyFromFloats(e,t,i)},e.prototype.setAll=function(e){return this._x=this._y=this._z=e,this._isDirty=!0,this},e.GetClipFactor=function(t,i,r,n){var o=e.Dot(t,r)-n;return o/(o-(e.Dot(i,r)-n))},e.GetAngleBetweenVectors=function(t,i,r){var n=t.normalizeToRef(M.Vector3[1]),o=i.normalizeToRef(M.Vector3[2]),a=e.Dot(n,o);a=h.Clamp(a,-1,1);var s=Math.acos(a),l=M.Vector3[3];return e.CrossToRef(n,o,l),e.Dot(l,r)>0?isNaN(s)?0:s:isNaN(s)?-Math.PI:-Math.acos(a)},e.GetAngleBetweenVectorsOnPlane=function(t,i,r){M.Vector3[0].copyFrom(t);var n=M.Vector3[0];M.Vector3[1].copyFrom(i);var o=M.Vector3[1];M.Vector3[2].copyFrom(r);var a=M.Vector3[2],s=M.Vector3[3],l=M.Vector3[4];n.normalize(),o.normalize(),a.normalize(),e.CrossToRef(a,n,s),e.CrossToRef(s,a,l);var c=Math.atan2(e.Dot(o,s),e.Dot(o,l));return h.NormalizeRadians(c)},e.PitchYawRollToMoveBetweenPointsToRef=function(e,t,i){var r=O.Vector3[0];return t.subtractToRef(e,r),i._y=Math.atan2(r.x,r.z)||0,i._x=Math.atan2(Math.sqrt(Math.pow(r.x,2)+Math.pow(r.z,2)),r.y)||0,i._z=0,i._isDirty=!0,i},e.PitchYawRollToMoveBetweenPoints=function(t,i){var r=e.Zero();return e.PitchYawRollToMoveBetweenPointsToRef(t,i,r)},e.SlerpToRef=function(t,i,r,n){r=h.Clamp(r,0,1);var o=M.Vector3[0],a=M.Vector3[1];o.copyFrom(t);var s=o.length();o.normalizeFromLength(s),a.copyFrom(i);var l=a.length();a.normalizeFromLength(l);var c,u,d=e.Dot(o,a);if(d<1-_){var p=Math.acos(d),f=1/Math.sin(p);c=Math.sin((1-r)*p)*f,u=Math.sin(r*p)*f}else c=1-r,u=r;return o.scaleInPlace(c),a.scaleInPlace(u),n.copyFrom(o).addInPlace(a),n.scaleInPlace(h.Lerp(s,l,r)),n},e.SmoothToRef=function(t,i,r,n,o){return e.SlerpToRef(t,i,0===n?1:r/n,o),o},e.FromArray=function(t,i){return void 0===i&&(i=0),new e(t[i],t[i+1],t[i+2])},e.FromFloatArray=function(t,i){return e.FromArray(t,i)},e.FromArrayToRef=function(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._isDirty=!0,i},e.FromFloatArrayToRef=function(t,i,r){return e.FromArrayToRef(t,i,r)},e.FromFloatsToRef=function(e,t,i,r){return r.copyFromFloats(e,t,i),r},e.Zero=function(){return new e(0,0,0)},e.One=function(){return new e(1,1,1)},e.Up=function(){return new e(0,1,0)},Object.defineProperty(e,"UpReadOnly",{get:function(){return e._UpReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DownReadOnly",{get:function(){return e._DownReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"RightReadOnly",{get:function(){return e._RightReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LeftReadOnly",{get:function(){return e._LeftReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LeftHandedForwardReadOnly",{get:function(){return e._LeftHandedForwardReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"RightHandedForwardReadOnly",{get:function(){return e._RightHandedForwardReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LeftHandedBackwardReadOnly",{get:function(){return e._LeftHandedBackwardReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"RightHandedBackwardReadOnly",{get:function(){return e._RightHandedBackwardReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ZeroReadOnly",{get:function(){return e._ZeroReadOnly},enumerable:!1,configurable:!0}),Object.defineProperty(e,"OneReadOnly",{get:function(){return e._OneReadOnly},enumerable:!1,configurable:!0}),e.Down=function(){return new e(0,-1,0)},e.Forward=function(t){return void 0===t&&(t=!1),new e(0,0,t?-1:1)},e.Backward=function(t){return void 0===t&&(t=!1),new e(0,0,t?1:-1)},e.Right=function(){return new e(1,0,0)},e.Left=function(){return new e(-1,0,0)},e.Random=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=1),new e(h.RandomRange(t,i),h.RandomRange(t,i),h.RandomRange(t,i))},e.TransformCoordinates=function(t,i){var r=e.Zero();return e.TransformCoordinatesToRef(t,i,r),r},e.TransformCoordinatesToRef=function(t,i,r){return e.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,i,r),r},e.TransformCoordinatesFromFloatsToRef=function(e,t,i,r,n){var o=r.m,a=e*o[0]+t*o[4]+i*o[8]+o[12],s=e*o[1]+t*o[5]+i*o[9]+o[13],l=e*o[2]+t*o[6]+i*o[10]+o[14],c=1/(e*o[3]+t*o[7]+i*o[11]+o[15]);return n._x=a*c,n._y=s*c,n._z=l*c,n._isDirty=!0,n},e.TransformNormal=function(t,i){var r=e.Zero();return e.TransformNormalToRef(t,i,r),r},e.TransformNormalToRef=function(e,t,i){return this.TransformNormalFromFloatsToRef(e._x,e._y,e._z,t,i),i},e.TransformNormalFromFloatsToRef=function(e,t,i,r,n){var o=r.m;return n._x=e*o[0]+t*o[4]+i*o[8],n._y=e*o[1]+t*o[5]+i*o[9],n._z=e*o[2]+t*o[6]+i*o[10],n._isDirty=!0,n},e.CatmullRom=function(e,t,i,r,n){var o=n*n,a=n*o,s=.5*(2*t._x+(-e._x+i._x)*n+(2*e._x-5*t._x+4*i._x-r._x)*o+(-e._x+3*t._x-3*i._x+r._x)*a),l=.5*(2*t._y+(-e._y+i._y)*n+(2*e._y-5*t._y+4*i._y-r._y)*o+(-e._y+3*t._y-3*i._y+r._y)*a),c=.5*(2*t._z+(-e._z+i._z)*n+(2*e._z-5*t._z+4*i._z-r._z)*o+(-e._z+3*t._z-3*i._z+r._z)*a);return new e.constructor(s,l,c)},e.Clamp=function(t,i,r){var n=new t.constructor;return e.ClampToRef(t,i,r,n),n},e.ClampToRef=function(e,t,i,r){var n=e._x;n=(n=n>i._x?i._x:n)i._y?i._y:o)i._z?i._z:a)0&&C<0?(D.copyFrom(a),P=i,I=r):C>0&&O<0?(D.copyFrom(l),P=r,I=n):(D.copyFrom(s).scaleInPlace(-1),P=n,I=i);var N=M.Vector3[9],F=M.Vector3[4];if(P.subtractToRef(b,x),I.subtractToRef(b,N),e.CrossToRef(x,N,F),!(e.Dot(F,c)<0))return o.copyFrom(b),Math.abs(g*v);var L=M.Vector3[5];e.CrossToRef(D,F,L),L.normalize();var w=M.Vector3[9];w.copyFrom(P).subtractInPlace(b);var B=w.length();if(B<_)return o.copyFrom(P),e.Distance(t,P);w.normalizeFromLength(B);var U=e.Dot(L,w),V=M.Vector3[7];V.copyFrom(b).addInPlace(L.scaleInPlace(B*U)),x.copyFrom(V).subtractInPlace(P),g=D.length(),D.normalizeFromLength(g);var k=e.Dot(x,D)/Math.max(g,_);return k=h.Clamp(k,0,1),V.copyFrom(P).addInPlace(D.scaleInPlace(k*g)),o.copyFrom(V),e.Distance(t,V)},e.Center=function(t,i){return e.CenterToRef(t,i,e.Zero())},e.CenterToRef=function(e,t,i){return i.copyFromFloats((e._x+t._x)/2,(e._y+t._y)/2,(e._z+t._z)/2)},e.RotationFromAxis=function(t,i,r){var n=new t.constructor;return e.RotationFromAxisToRef(t,i,r,n),n},e.RotationFromAxisToRef=function(e,t,i,r){var n=M.Quaternion[0];return P.RotationQuaternionFromAxisToRef(e,t,i,n),n.toEulerAnglesToRef(r),r},e._UpReadOnly=e.Up(),e._DownReadOnly=e.Down(),e._LeftHandedForwardReadOnly=e.Forward(!1),e._RightHandedForwardReadOnly=e.Forward(!0),e._LeftHandedBackwardReadOnly=e.Backward(!1),e._RightHandedBackwardReadOnly=e.Backward(!0),e._RightReadOnly=e.Right(),e._LeftReadOnly=e.Left(),e._ZeroReadOnly=e.Zero(),e._OneReadOnly=e.One(),e}(),C=function(){function e(e,t,i,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=e,this.y=t,this.z=i,this.w=r}return e.prototype.toString=function(){return"{X: ".concat(this.x," Y: ").concat(this.y," Z: ").concat(this.z," W: ").concat(this.w,"}")},e.prototype.getClassName=function(){return"Vector4"},e.prototype.getHashCode=function(){var e=x(this.x);return 397*(e=397*(e=397*e^x(this.y))^x(this.z))^x(this.w)},e.prototype.asArray=function(){var e=new Array;return this.toArray(e,0),e},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,this},e.prototype.fromArray=function(t,i){return void 0===i&&(i=0),e.FromArrayToRef(t,i,this),this},e.prototype.addInPlace=function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this},e.prototype.add=function(e){return new this.constructor(this.x+e.x,this.y+e.y,this.z+e.z,this.w+e.w)},e.prototype.addToRef=function(e,t){return t.x=this.x+e.x,t.y=this.y+e.y,t.z=this.z+e.z,t.w=this.w+e.w,t},e.prototype.subtractInPlace=function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},e.prototype.subtract=function(e){return new this.constructor(this.x-e.x,this.y-e.y,this.z-e.z,this.w-e.w)},e.prototype.subtractToRef=function(e,t){return t.x=this.x-e.x,t.y=this.y-e.y,t.z=this.z-e.z,t.w=this.w-e.w,t},e.prototype.subtractFromFloats=function(e,t,i,r){return new this.constructor(this.x-e,this.y-t,this.z-i,this.w-r)},e.prototype.subtractFromFloatsToRef=function(e,t,i,r,n){return n.x=this.x-e,n.y=this.y-t,n.z=this.z-i,n.w=this.w-r,n},e.prototype.negate=function(){return new this.constructor(-this.x,-this.y,-this.z,-this.w)},e.prototype.negateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.w*=-1,this},e.prototype.negateToRef=function(e){return e.copyFromFloats(-1*this.x,-1*this.y,-1*this.z,-1*this.w)},e.prototype.scaleInPlace=function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},e.prototype.scale=function(e){return new this.constructor(this.x*e,this.y*e,this.z*e,this.w*e)},e.prototype.scaleToRef=function(e,t){return t.x=this.x*e,t.y=this.y*e,t.z=this.z*e,t.w=this.w*e,t},e.prototype.scaleAndAddToRef=function(e,t){return t.x+=this.x*e,t.y+=this.y*e,t.z+=this.z*e,t.w+=this.w*e,t},e.prototype.equals=function(e){return e&&this.x===e.x&&this.y===e.y&&this.z===e.z&&this.w===e.w},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=_),e&&h.WithinEpsilon(this.x,e.x,t)&&h.WithinEpsilon(this.y,e.y,t)&&h.WithinEpsilon(this.z,e.z,t)&&h.WithinEpsilon(this.w,e.w,t)},e.prototype.equalsToFloats=function(e,t,i,r){return this.x===e&&this.y===t&&this.z===i&&this.w===r},e.prototype.multiplyInPlace=function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},e.prototype.multiply=function(e){return new this.constructor(this.x*e.x,this.y*e.y,this.z*e.z,this.w*e.w)},e.prototype.multiplyToRef=function(e,t){return t.x=this.x*e.x,t.y=this.y*e.y,t.z=this.z*e.z,t.w=this.w*e.w,t},e.prototype.multiplyByFloats=function(e,t,i,r){return new this.constructor(this.x*e,this.y*t,this.z*i,this.w*r)},e.prototype.divide=function(e){return new this.constructor(this.x/e.x,this.y/e.y,this.z/e.z,this.w/e.w)},e.prototype.divideToRef=function(e,t){return t.x=this.x/e.x,t.y=this.y/e.y,t.z=this.z/e.z,t.w=this.w/e.w,t},e.prototype.divideInPlace=function(e){return this.divideToRef(e,this)},e.prototype.minimizeInPlace=function(e){return e.xthis.x&&(this.x=e.x),e.y>this.y&&(this.y=e.y),e.z>this.z&&(this.z=e.z),e.w>this.w&&(this.w=e.w),this},e.prototype.floor=function(){return new this.constructor(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))},e.prototype.fract=function(){return new this.constructor(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z),this.w-Math.floor(this.w))},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},e.prototype.normalize=function(){var e=this.length();return 0===e?this:this.scaleInPlace(1/e)},e.prototype.toVector3=function(){return new R(this.x,this.y,this.z)},e.prototype.clone=function(){return new this.constructor(this.x,this.y,this.z,this.w)},e.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},e.prototype.copyFromFloats=function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},e.prototype.set=function(e,t,i,r){return this.copyFromFloats(e,t,i,r)},e.prototype.setAll=function(e){return this.x=this.y=this.z=this.w=e,this},e.FromArray=function(t,i){return i||(i=0),new e(t[i],t[i+1],t[i+2],t[i+3])},e.FromArrayToRef=function(e,t,i){return i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},e.FromFloatArrayToRef=function(t,i,r){return e.FromArrayToRef(t,i,r),r},e.FromFloatsToRef=function(e,t,i,r,n){return n.x=e,n.y=t,n.z=i,n.w=r,n},e.Zero=function(){return new e(0,0,0,0)},e.One=function(){return new e(1,1,1,1)},e.Random=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=1),new e(h.RandomRange(t,i),h.RandomRange(t,i),h.RandomRange(t,i),h.RandomRange(t,i))},Object.defineProperty(e,"ZeroReadOnly",{get:function(){return e._ZeroReadOnly},enumerable:!1,configurable:!0}),e.Normalize=function(t){var i=e.Zero();return e.NormalizeToRef(t,i),i},e.NormalizeToRef=function(e,t){return t.copyFrom(e),t.normalize(),t},e.Minimize=function(e,t){var i=new e.constructor;return i.copyFrom(e),i.minimizeInPlace(t),i},e.Maximize=function(e,t){var i=new e.constructor;return i.copyFrom(e),i.maximizeInPlace(t),i},e.Distance=function(t,i){return Math.sqrt(e.DistanceSquared(t,i))},e.DistanceSquared=function(e,t){var i=e.x-t.x,r=e.y-t.y,n=e.z-t.z,o=e.w-t.w;return i*i+r*r+n*n+o*o},e.Center=function(t,i){return e.CenterToRef(t,i,e.Zero())},e.CenterToRef=function(e,t,i){return i.copyFromFloats((e.x+t.x)/2,(e.y+t.y)/2,(e.z+t.z)/2,(e.w+t.w)/2)},e.TransformCoordinates=function(t,i){var r=e.Zero();return e.TransformCoordinatesToRef(t,i,r),r},e.TransformCoordinatesToRef=function(t,i,r){return e.TransformCoordinatesFromFloatsToRef(t._x,t._y,t._z,i,r),r},e.TransformCoordinatesFromFloatsToRef=function(e,t,i,r,n){var o=r.m,a=e*o[0]+t*o[4]+i*o[8]+o[12],s=e*o[1]+t*o[5]+i*o[9]+o[13],l=e*o[2]+t*o[6]+i*o[10]+o[14],c=e*o[3]+t*o[7]+i*o[11]+o[15];return n.x=a,n.y=s,n.z=l,n.w=c,n},e.TransformNormal=function(t,i){var r=new t.constructor;return e.TransformNormalToRef(t,i,r),r},e.TransformNormalToRef=function(e,t,i){var r=t.m,n=e.x*r[0]+e.y*r[4]+e.z*r[8],o=e.x*r[1]+e.y*r[5]+e.z*r[9],a=e.x*r[2]+e.y*r[6]+e.z*r[10];return i.x=n,i.y=o,i.z=a,i.w=e.w,i},e.TransformNormalFromFloatsToRef=function(e,t,i,r,n,o){var a=n.m;return o.x=e*a[0]+t*a[4]+i*a[8],o.y=e*a[1]+t*a[5]+i*a[9],o.z=e*a[2]+t*a[6]+i*a[10],o.w=r,o},e.FromVector3=function(t,i){return void 0===i&&(i=0),new e(t._x,t._y,t._z,i)},e._ZeroReadOnly=e.Zero(),e}(),P=function(){function e(e,t,i,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=1),this._isDirty=!0,this._x=e,this._y=t,this._z=i,this._w=r}return Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"z",{get:function(){return this._z},set:function(e){this._z=e,this._isDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"w",{get:function(){return this._w},set:function(e){this._w=e,this._isDirty=!0},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"{X: ".concat(this._x," Y: ").concat(this._y," Z: ").concat(this._z," W: ").concat(this._w,"}")},e.prototype.getClassName=function(){return"Quaternion"},e.prototype.getHashCode=function(){var e=x(this._x);return 397*(e=397*(e=397*e^x(this._y))^x(this._z))^x(this._w)},e.prototype.asArray=function(){return[this._x,this._y,this._z,this._w]},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,this},e.prototype.equals=function(e){return e&&this._x===e._x&&this._y===e._y&&this._z===e._z&&this._w===e._w},e.prototype.equalsWithEpsilon=function(e,t){return void 0===t&&(t=_),e&&h.WithinEpsilon(this._x,e._x,t)&&h.WithinEpsilon(this._y,e._y,t)&&h.WithinEpsilon(this._z,e._z,t)&&h.WithinEpsilon(this._w,e._w,t)},e.prototype.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},e.prototype.copyFrom=function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._w=e._w,this._isDirty=!0,this},e.prototype.copyFromFloats=function(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._isDirty=!0,this},e.prototype.set=function(e,t,i,r){return this.copyFromFloats(e,t,i,r)},e.prototype.add=function(e){return new this.constructor(this._x+e._x,this._y+e._y,this._z+e._z,this._w+e._w)},e.prototype.addInPlace=function(e){return this._x+=e._x,this._y+=e._y,this._z+=e._z,this._w+=e._w,this._isDirty=!0,this},e.prototype.subtract=function(e){return new this.constructor(this._x-e._x,this._y-e._y,this._z-e._z,this._w-e._w)},e.prototype.subtractInPlace=function(e){return this._x-=e._x,this._y-=e._y,this._z-=e._z,this._w-=e._w,this._isDirty=!0,this},e.prototype.scale=function(e){return new this.constructor(this._x*e,this._y*e,this._z*e,this._w*e)},e.prototype.scaleToRef=function(e,t){return t._x=this._x*e,t._y=this._y*e,t._z=this._z*e,t._w=this._w*e,t._isDirty=!0,t},e.prototype.scaleInPlace=function(e){return this._x*=e,this._y*=e,this._z*=e,this._w*=e,this._isDirty=!0,this},e.prototype.scaleAndAddToRef=function(e,t){return t._x+=this._x*e,t._y+=this._y*e,t._z+=this._z*e,t._w+=this._w*e,t._isDirty=!0,t},e.prototype.multiply=function(e){var t=new this.constructor(0,0,0,1);return this.multiplyToRef(e,t),t},e.prototype.multiplyToRef=function(e,t){var i=this._x*e._w+this._y*e._z-this._z*e._y+this._w*e._x,r=-this._x*e._z+this._y*e._w+this._z*e._x+this._w*e._y,n=this._x*e._y-this._y*e._x+this._z*e._w+this._w*e._z,o=-this._x*e._x-this._y*e._y-this._z*e._z+this._w*e._w;return t.copyFromFloats(i,r,n,o),t},e.prototype.multiplyInPlace=function(e){return this.multiplyToRef(e,this),this},e.prototype.conjugateToRef=function(e){return e.copyFromFloats(-this._x,-this._y,-this._z,this._w),e},e.prototype.conjugateInPlace=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._isDirty=!0,this},e.prototype.conjugate=function(){return new this.constructor(-this._x,-this._y,-this._z,this._w)},e.prototype.invert=function(){var e=this.conjugate(),t=this.lengthSquared();return 0==t||1==t||e.scaleInPlace(1/t),e},e.prototype.invertInPlace=function(){this.conjugateInPlace();var e=this.lengthSquared();return 0==e||1==e||this.scaleInPlace(1/e),this},e.prototype.lengthSquared=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},e.prototype.length=function(){return Math.sqrt(this.lengthSquared())},e.prototype.normalize=function(){var e=this.length();if(0===e)return this;var t=1/e;return this.scaleInPlace(t),this},e.prototype.normalizeToNew=function(){var e=this.length();if(0===e)return this.clone();var t=1/e;return this.scale(t)},e.prototype.toEulerAngles=function(){var e=R.Zero();return this.toEulerAnglesToRef(e),e},e.prototype.toEulerAnglesToRef=function(e){var t=this._z,i=this._x,r=this._y,n=this._w,o=r*t-i*n,a=.4999999;if(o<-a)e._y=2*Math.atan2(r,n),e._x=Math.PI/2,e._z=0,e._isDirty=!0;else if(o>a)e._y=2*Math.atan2(r,n),e._x=-Math.PI/2,e._z=0,e._isDirty=!0;else{var s=n*n,l=t*t,c=i*i,u=r*r;e._z=Math.atan2(2*(i*r+t*n),-l-c+u+s),e._x=Math.asin(-2*o),e._y=Math.atan2(2*(t*i+r*n),l-c-u+s),e._isDirty=!0}return e},e.prototype.toRotationMatrix=function(e){return I.FromQuaternionToRef(this,e),e},e.prototype.fromRotationMatrix=function(t){return e.FromRotationMatrixToRef(t,this),this},e.FromRotationMatrix=function(t){var i=new e;return e.FromRotationMatrixToRef(t,i),i},e.FromRotationMatrixToRef=function(e,t){var i,r=e.m,n=r[0],o=r[4],a=r[8],s=r[1],l=r[5],c=r[9],u=r[2],h=r[6],d=r[10],p=n+l+d;return p>0?(i=.5/Math.sqrt(p+1),t._w=.25/i,t._x=(h-c)*i,t._y=(a-u)*i,t._z=(s-o)*i,t._isDirty=!0):n>l&&n>d?(i=2*Math.sqrt(1+n-l-d),t._w=(h-c)/i,t._x=.25*i,t._y=(o+s)/i,t._z=(a+u)/i,t._isDirty=!0):l>d?(i=2*Math.sqrt(1+l-n-d),t._w=(a-u)/i,t._x=(o+s)/i,t._y=.25*i,t._z=(c+h)/i,t._isDirty=!0):(i=2*Math.sqrt(1+d-n-l),t._w=(s-o)/i,t._x=(a+u)/i,t._y=(c+h)/i,t._z=.25*i,t._isDirty=!0),t},e.Dot=function(e,t){return e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w},e.AreClose=function(t,i,r){void 0===r&&(r=.1);var n=e.Dot(t,i);return 1-n*n<=r},e.SmoothToRef=function(t,i,r,n,o){var a=0===n?1:r/n;return a=h.Clamp(a,0,1),e.SlerpToRef(t,i,a,o),o},e.Zero=function(){return new e(0,0,0,0)},e.Inverse=function(e){return new e.constructor(-e._x,-e._y,-e._z,e._w)},e.InverseToRef=function(e,t){return t.set(-e._x,-e._y,-e._z,e._w),t},e.Identity=function(){return new e(0,0,0,1)},e.IsIdentity=function(e){return e&&0===e._x&&0===e._y&&0===e._z&&1===e._w},e.RotationAxis=function(t,i){return e.RotationAxisToRef(t,i,new e)},e.RotationAxisToRef=function(e,t,i){var r=Math.sin(t/2);return e.normalize(),i._w=Math.cos(t/2),i._x=e._x*r,i._y=e._y*r,i._z=e._z*r,i._isDirty=!0,i},e.FromArray=function(t,i){return i||(i=0),new e(t[i],t[i+1],t[i+2],t[i+3])},e.FromArrayToRef=function(e,t,i){return i._x=e[t],i._y=e[t+1],i._z=e[t+2],i._w=e[t+3],i._isDirty=!0,i},e.FromEulerAngles=function(t,i,r){var n=new e;return e.RotationYawPitchRollToRef(i,t,r,n),n},e.FromEulerAnglesToRef=function(t,i,r,n){return e.RotationYawPitchRollToRef(i,t,r,n),n},e.FromEulerVector=function(t){var i=new e;return e.RotationYawPitchRollToRef(t._y,t._x,t._z,i),i},e.FromEulerVectorToRef=function(t,i){return e.RotationYawPitchRollToRef(t._y,t._x,t._z,i),i},e.FromUnitVectorsToRef=function(e,t,i,r){void 0===r&&(r=_);var n=R.Dot(e,t)+1;return nMath.abs(e.z)?i.set(-e.y,e.x,0,0):i.set(0,-e.z,e.y,0):(R.CrossToRef(e,t,O.Vector3[0]),i.set(O.Vector3[0].x,O.Vector3[0].y,O.Vector3[0].z,n)),i.normalize()},e.RotationYawPitchRoll=function(t,i,r){var n=new e;return e.RotationYawPitchRollToRef(t,i,r,n),n},e.RotationYawPitchRollToRef=function(e,t,i,r){var n=.5*i,o=.5*t,a=.5*e,s=Math.sin(n),l=Math.cos(n),c=Math.sin(o),u=Math.cos(o),h=Math.sin(a),d=Math.cos(a);return r._x=d*c*l+h*u*s,r._y=h*u*l-d*c*s,r._z=d*u*s-h*c*l,r._w=d*u*l+h*c*s,r._isDirty=!0,r},e.RotationAlphaBetaGamma=function(t,i,r){var n=new e;return e.RotationAlphaBetaGammaToRef(t,i,r,n),n},e.RotationAlphaBetaGammaToRef=function(e,t,i,r){var n=.5*(i+e),o=.5*(i-e),a=.5*t;return r._x=Math.cos(o)*Math.sin(a),r._y=Math.sin(o)*Math.sin(a),r._z=Math.sin(n)*Math.cos(a),r._w=Math.cos(n)*Math.cos(a),r._isDirty=!0,r},e.RotationQuaternionFromAxis=function(t,i,r){var n=new e(0,0,0,0);return e.RotationQuaternionFromAxisToRef(t,i,r,n),n},e.RotationQuaternionFromAxisToRef=function(t,i,r,n){var o=M.Matrix[0];return I.FromXYZAxesToRef(t.normalize(),i.normalize(),r.normalize(),o),e.FromRotationMatrixToRef(o,n),n},e.FromLookDirectionLH=function(t,i){var r=new e;return e.FromLookDirectionLHToRef(t,i,r),r},e.FromLookDirectionLHToRef=function(t,i,r){var n=M.Matrix[0];return I.LookDirectionLHToRef(t,i,n),e.FromRotationMatrixToRef(n,r),r},e.FromLookDirectionRH=function(t,i){var r=new e;return e.FromLookDirectionRHToRef(t,i,r),r},e.FromLookDirectionRHToRef=function(t,i,r){var n=M.Matrix[0];return I.LookDirectionRHToRef(t,i,n),e.FromRotationMatrixToRef(n,r)},e.Slerp=function(t,i,r){var n=e.Identity();return e.SlerpToRef(t,i,r,n),n},e.SlerpToRef=function(e,t,i,r){var n,o,a=e._x*t._x+e._y*t._y+e._z*t._z+e._w*t._w,s=!1;if(a<0&&(s=!0,a=-a),a>.999999)o=1-i,n=s?-i:i;else{var l=Math.acos(a),c=1/Math.sin(l);o=Math.sin((1-i)*l)*c,n=s?-Math.sin(i*l)*c:Math.sin(i*l)*c}return r._x=o*e._x+n*t._x,r._y=o*e._y+n*t._y,r._z=o*e._z+n*t._z,r._w=o*e._w+n*t._w,r._isDirty=!0,r},e.Hermite=function(e,t,i,r,n){var o=n*n,a=n*o,s=2*a-3*o+1,l=-2*a+3*o,c=a-2*o+n,u=a-o,h=e._x*s+i._x*l+t._x*c+r._x*u,d=e._y*s+i._y*l+t._y*c+r._y*u,p=e._z*s+i._z*l+t._z*c+r._z*u,f=e._w*s+i._w*l+t._w*c+r._w*u;return new e.constructor(h,d,p,f)},e.Hermite1stDerivative=function(e,t,i,r,n){var o=new e.constructor;return this.Hermite1stDerivativeToRef(e,t,i,r,n,o),o},e.Hermite1stDerivativeToRef=function(e,t,i,r,n,o){var a=n*n;return o._x=6*(a-n)*e._x+(3*a-4*n+1)*t._x+6*(-a+n)*i._x+(3*a-2*n)*r._x,o._y=6*(a-n)*e._y+(3*a-4*n+1)*t._y+6*(-a+n)*i._y+(3*a-2*n)*r._y,o._z=6*(a-n)*e._z+(3*a-4*n+1)*t._z+6*(-a+n)*i._z+(3*a-2*n)*r._z,o._w=6*(a-n)*e._w+(3*a-4*n+1)*t._w+6*(-a+n)*i._w+(3*a-2*n)*r._w,o._isDirty=!0,o},e}(),I=function(){function e(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this.updateFlag=-1,E.MatrixTrackPrecisionChange&&E.MatrixTrackedMatrices.push(this),this._m=new E.MatrixCurrentType(16),this.markAsUpdated()}return Object.defineProperty(e,"Use64Bits",{get:function(){return E.MatrixUse64Bits},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"m",{get:function(){return this._m},enumerable:!1,configurable:!0}),e.prototype.markAsUpdated=function(){this.updateFlag=e._UpdateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0},e.prototype._updateIdentityStatus=function(e,t,i,r){void 0===t&&(t=!1),void 0===i&&(i=!1),void 0===r&&(r=!0),this._isIdentity=e,this._isIdentity3x2=e||i,this._isIdentityDirty=!this._isIdentity&&t,this._isIdentity3x2Dirty=!this._isIdentity3x2&&r},e.prototype.isIdentity=function(){if(this._isIdentityDirty){this._isIdentityDirty=!1;var e=this._m;this._isIdentity=1===e[0]&&0===e[1]&&0===e[2]&&0===e[3]&&0===e[4]&&1===e[5]&&0===e[6]&&0===e[7]&&0===e[8]&&0===e[9]&&1===e[10]&&0===e[11]&&0===e[12]&&0===e[13]&&0===e[14]&&1===e[15]}return this._isIdentity},e.prototype.isIdentityAs3x2=function(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,1!==this._m[0]||1!==this._m[5]||1!==this._m[15]||0!==this._m[1]||0!==this._m[2]||0!==this._m[3]||0!==this._m[4]||0!==this._m[6]||0!==this._m[7]||0!==this._m[8]||0!==this._m[9]||0!==this._m[10]||0!==this._m[11]||0!==this._m[12]||0!==this._m[13]||0!==this._m[14]?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2},e.prototype.determinant=function(){if(!0===this._isIdentity)return 1;var e=this._m,t=e[0],i=e[1],r=e[2],n=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],f=e[13],_=e[14],m=e[15],g=h*m-_*d,v=u*m-f*d,y=u*_-f*h,b=c*m-p*d,T=c*_-h*p,E=c*f-p*u;return t*+(a*g-s*v+l*y)+i*-(o*g-s*b+l*T)+r*+(o*v-a*b+l*E)+n*-(o*y-a*T+s*E)},e.prototype.toString=function(){return"{".concat(this.m[0],", ").concat(this.m[1],", ").concat(this.m[2],", ").concat(this.m[3],"\n").concat(this.m[4],", ").concat(this.m[5],", ").concat(this.m[6],", ").concat(this.m[7],"\n").concat(this.m[8],", ").concat(this.m[9],", ").concat(this.m[10],", ").concat(this.m[11],"\n").concat(this.m[12],", ").concat(this.m[13],", ").concat(this.m[14],", ").concat(this.m[15],"}")},e.prototype.toArray=function(){return this._m},e.prototype.asArray=function(){return this._m},e.prototype.invert=function(){return this.invertToRef(this),this},e.prototype.reset=function(){return e.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this},e.prototype.add=function(e){var t=new this.constructor;return this.addToRef(e,t),t},e.prototype.addToRef=function(e,t){for(var i=this._m,r=t._m,n=e.m,o=0;o<16;o++)r[o]=i[o]+n[o];return t.markAsUpdated(),t},e.prototype.addToSelf=function(e){for(var t=this._m,i=e.m,r=0;r<16;r++)t[r]+=i[r];return this.markAsUpdated(),this},e.prototype.invertToRef=function(t){if(!0===this._isIdentity)return e.IdentityToRef(t),t;var i=this._m,r=i[0],n=i[1],o=i[2],a=i[3],s=i[4],l=i[5],c=i[6],u=i[7],h=i[8],d=i[9],p=i[10],f=i[11],_=i[12],m=i[13],g=i[14],v=i[15],y=p*v-g*f,b=d*v-m*f,T=d*g-m*p,E=h*v-_*f,S=h*g-p*_,x=h*m-_*d,A=+(l*y-c*b+u*T),R=-(s*y-c*E+u*S),C=+(s*b-l*E+u*x),P=-(s*T-l*S+c*x),I=r*A+n*R+o*C+a*P;if(0===I)return t.copyFrom(this),t;var M=1/I,O=c*v-g*u,D=l*v-m*u,N=l*g-m*c,F=s*v-_*u,L=s*g-_*c,w=s*m-_*l,B=c*f-p*u,U=l*f-d*u,V=l*p-d*c,k=s*f-h*u,G=s*p-h*c,z=s*d-h*l,W=-(n*y-o*b+a*T),H=+(r*y-o*E+a*S),X=-(r*b-n*E+a*x),j=+(r*T-n*S+o*x),Y=+(n*O-o*D+a*N),K=-(r*O-o*F+a*L),Q=+(r*D-n*F+a*w),q=-(r*N-n*L+o*w),Z=-(n*B-o*U+a*V),J=+(r*B-o*k+a*G),$=-(r*U-n*k+a*z),ee=+(r*V-n*G+o*z);return e.FromValuesToRef(A*M,W*M,Y*M,Z*M,R*M,H*M,K*M,J*M,C*M,X*M,Q*M,$*M,P*M,j*M,q*M,ee*M,t),t},e.prototype.addAtIndex=function(e,t){return this._m[e]+=t,this.markAsUpdated(),this},e.prototype.multiplyAtIndex=function(e,t){return this._m[e]*=t,this.markAsUpdated(),this},e.prototype.setTranslationFromFloats=function(e,t,i){return this._m[12]=e,this._m[13]=t,this._m[14]=i,this.markAsUpdated(),this},e.prototype.addTranslationFromFloats=function(e,t,i){return this._m[12]+=e,this._m[13]+=t,this._m[14]+=i,this.markAsUpdated(),this},e.prototype.setTranslation=function(e){return this.setTranslationFromFloats(e._x,e._y,e._z)},e.prototype.getTranslation=function(){return new R(this._m[12],this._m[13],this._m[14])},e.prototype.getTranslationToRef=function(e){return e.x=this._m[12],e.y=this._m[13],e.z=this._m[14],e},e.prototype.removeRotationAndScaling=function(){var t=this.m;return e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t[12],t[13],t[14],t[15],this),this._updateIdentityStatus(0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]),this},e.prototype.multiply=function(e){var t=new this.constructor;return this.multiplyToRef(e,t),t},e.prototype.copyFrom=function(e){e.copyToArray(this._m);var t=e;return this.updateFlag=t.updateFlag,this._updateIdentityStatus(t._isIdentity,t._isIdentityDirty,t._isIdentity3x2,t._isIdentity3x2Dirty),this},e.prototype.copyToArray=function(e,t){void 0===t&&(t=0);var i=this._m;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],this},e.prototype.multiplyToRef=function(e,t){return this._isIdentity?(t.copyFrom(e),t):e._isIdentity?(t.copyFrom(this),t):(this.multiplyToArray(e,t._m,0),t.markAsUpdated(),t)},e.prototype.multiplyToArray=function(e,t,i){var r=this._m,n=e.m,o=r[0],a=r[1],s=r[2],l=r[3],c=r[4],u=r[5],h=r[6],d=r[7],p=r[8],f=r[9],_=r[10],m=r[11],g=r[12],v=r[13],y=r[14],b=r[15],T=n[0],E=n[1],S=n[2],x=n[3],A=n[4],R=n[5],C=n[6],P=n[7],I=n[8],M=n[9],O=n[10],D=n[11],N=n[12],F=n[13],L=n[14],w=n[15];return t[i]=o*T+a*A+s*I+l*N,t[i+1]=o*E+a*R+s*M+l*F,t[i+2]=o*S+a*C+s*O+l*L,t[i+3]=o*x+a*P+s*D+l*w,t[i+4]=c*T+u*A+h*I+d*N,t[i+5]=c*E+u*R+h*M+d*F,t[i+6]=c*S+u*C+h*O+d*L,t[i+7]=c*x+u*P+h*D+d*w,t[i+8]=p*T+f*A+_*I+m*N,t[i+9]=p*E+f*R+_*M+m*F,t[i+10]=p*S+f*C+_*O+m*L,t[i+11]=p*x+f*P+_*D+m*w,t[i+12]=g*T+v*A+y*I+b*N,t[i+13]=g*E+v*R+y*M+b*F,t[i+14]=g*S+v*C+y*O+b*L,t[i+15]=g*x+v*P+y*D+b*w,this},e.prototype.equals=function(e){var t=e;if(!t)return!1;if((this._isIdentity||t._isIdentity)&&!this._isIdentityDirty&&!t._isIdentityDirty)return this._isIdentity&&t._isIdentity;var i=this.m,r=t.m;return i[0]===r[0]&&i[1]===r[1]&&i[2]===r[2]&&i[3]===r[3]&&i[4]===r[4]&&i[5]===r[5]&&i[6]===r[6]&&i[7]===r[7]&&i[8]===r[8]&&i[9]===r[9]&&i[10]===r[10]&&i[11]===r[11]&&i[12]===r[12]&&i[13]===r[13]&&i[14]===r[14]&&i[15]===r[15]},e.prototype.clone=function(){var e=new this.constructor;return e.copyFrom(this),e},e.prototype.getClassName=function(){return"Matrix"},e.prototype.getHashCode=function(){for(var e=x(this._m[0]),t=1;t<16;t++)e=397*e^x(this._m[t]);return e},e.prototype.decomposeToTransformNode=function(e){return e.rotationQuaternion=e.rotationQuaternion||new P,this.decompose(e.scaling,e.rotationQuaternion,e.position)},e.prototype.decompose=function(t,i,r,n){if(this._isIdentity)return r&&r.setAll(0),t&&t.setAll(1),i&&i.copyFromFloats(0,0,0,1),!0;var o=this._m;if(r&&r.copyFromFloats(o[12],o[13],o[14]),(t=t||M.Vector3[0]).x=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]),t.y=Math.sqrt(o[4]*o[4]+o[5]*o[5]+o[6]*o[6]),t.z=Math.sqrt(o[8]*o[8]+o[9]*o[9]+o[10]*o[10]),n){var a=n.absoluteScaling.x<0?-1:1,s=n.absoluteScaling.y<0?-1:1,l=n.absoluteScaling.z<0?-1:1;t.x*=a,t.y*=s,t.z*=l}else this.determinant()<=0&&(t.y*=-1);if(0===t._x||0===t._y||0===t._z)return i&&i.copyFromFloats(0,0,0,1),!1;if(i){var c=1/t._x,u=1/t._y,h=1/t._z;e.FromValuesToRef(o[0]*c,o[1]*c,o[2]*c,0,o[4]*u,o[5]*u,o[6]*u,0,o[8]*h,o[9]*h,o[10]*h,0,0,0,0,1,M.Matrix[0]),P.FromRotationMatrixToRef(M.Matrix[0],i)}return!0},e.prototype.getRow=function(e){if(e<0||e>3)return null;var t=4*e;return new C(this._m[t+0],this._m[t+1],this._m[t+2],this._m[t+3])},e.prototype.getRowToRef=function(e,t){if(e>=0&&e<3){var i=4*e;t.x=this._m[i+0],t.y=this._m[i+1],t.z=this._m[i+2],t.w=this._m[i+3]}return t},e.prototype.setRow=function(e,t){return this.setRowFromFloats(e,t.x,t.y,t.z,t.w)},e.prototype.transpose=function(){var t=new this.constructor;return e.TransposeToRef(this,t),t},e.prototype.transposeToRef=function(t){return e.TransposeToRef(this,t),t},e.prototype.setRowFromFloats=function(e,t,i,r,n){if(e<0||e>3)return this;var o=4*e;return this._m[o+0]=t,this._m[o+1]=i,this._m[o+2]=r,this._m[o+3]=n,this.markAsUpdated(),this},e.prototype.scale=function(e){var t=new this.constructor;return this.scaleToRef(e,t),t},e.prototype.scaleToRef=function(e,t){for(var i=0;i<16;i++)t._m[i]=this._m[i]*e;return t.markAsUpdated(),t},e.prototype.scaleAndAddToRef=function(e,t){for(var i=0;i<16;i++)t._m[i]+=this._m[i]*e;return t.markAsUpdated(),t},e.prototype.toNormalMatrix=function(t){var i=M.Matrix[0];this.invertToRef(i),i.transposeToRef(t);var r=t._m;return e.FromValuesToRef(r[0],r[1],r[2],0,r[4],r[5],r[6],0,r[8],r[9],r[10],0,0,0,0,1,t),t},e.prototype.getRotationMatrix=function(){var e=new this.constructor;return this.getRotationMatrixToRef(e),e},e.prototype.getRotationMatrixToRef=function(t){var i=M.Vector3[0];if(!this.decompose(i))return e.IdentityToRef(t),t;var r=this._m,n=1/i._x,o=1/i._y,a=1/i._z;return e.FromValuesToRef(r[0]*n,r[1]*n,r[2]*n,0,r[4]*o,r[5]*o,r[6]*o,0,r[8]*a,r[9]*a,r[10]*a,0,0,0,0,1,t),t},e.prototype.toggleModelMatrixHandInPlace=function(){var e=this._m;return e[2]*=-1,e[6]*=-1,e[8]*=-1,e[9]*=-1,e[14]*=-1,this.markAsUpdated(),this},e.prototype.toggleProjectionMatrixHandInPlace=function(){var e=this._m;return e[8]*=-1,e[9]*=-1,e[10]*=-1,e[11]*=-1,this.markAsUpdated(),this},e.FromArray=function(t,i){void 0===i&&(i=0);var r=new e;return e.FromArrayToRef(t,i,r),r},e.FromArrayToRef=function(e,t,i){for(var r=0;r<16;r++)i._m[r]=e[r+t];return i.markAsUpdated(),i},e.FromFloat32ArrayToRefScaled=function(e,t,i,r){for(var n=0;n<16;n++)r._m[n]=e[n+t]*i;return r.markAsUpdated(),r},Object.defineProperty(e,"IdentityReadOnly",{get:function(){return e._IdentityReadOnly},enumerable:!1,configurable:!0}),e.FromValuesToRef=function(e,t,i,r,n,o,a,s,l,c,u,h,d,p,f,_,m){var g=m._m;g[0]=e,g[1]=t,g[2]=i,g[3]=r,g[4]=n,g[5]=o,g[6]=a,g[7]=s,g[8]=l,g[9]=c,g[10]=u,g[11]=h,g[12]=d,g[13]=p,g[14]=f,g[15]=_,m.markAsUpdated()},e.FromValues=function(t,i,r,n,o,a,s,l,c,u,h,d,p,f,_,m){var g=new e,v=g._m;return v[0]=t,v[1]=i,v[2]=r,v[3]=n,v[4]=o,v[5]=a,v[6]=s,v[7]=l,v[8]=c,v[9]=u,v[10]=h,v[11]=d,v[12]=p,v[13]=f,v[14]=_,v[15]=m,g.markAsUpdated(),g},e.Compose=function(t,i,r){var n=new e;return e.ComposeToRef(t,i,r,n),n},e.ComposeToRef=function(e,t,i,r){var n=r._m,o=t._x,a=t._y,s=t._z,l=t._w,c=o+o,u=a+a,h=s+s,d=o*c,p=o*u,f=o*h,_=a*u,m=a*h,g=s*h,v=l*c,y=l*u,b=l*h,T=e._x,E=e._y,S=e._z;return n[0]=(1-(_+g))*T,n[1]=(p+b)*T,n[2]=(f-y)*T,n[3]=0,n[4]=(p-b)*E,n[5]=(1-(d+g))*E,n[6]=(m+v)*E,n[7]=0,n[8]=(f+y)*S,n[9]=(m-v)*S,n[10]=(1-(d+_))*S,n[11]=0,n[12]=i._x,n[13]=i._y,n[14]=i._z,n[15]=1,r.markAsUpdated(),r},e.Identity=function(){var t=e.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return t._updateIdentityStatus(!0),t},e.IdentityToRef=function(t){return e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,t),t._updateIdentityStatus(!0),t},e.Zero=function(){var t=e.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return t._updateIdentityStatus(!1),t},e.RotationX=function(t){var i=new e;return e.RotationXToRef(t,i),i},e.Invert=function(e){var t=new e.constructor;return e.invertToRef(t),t},e.RotationXToRef=function(t,i){var r=Math.sin(t),n=Math.cos(t);return e.FromValuesToRef(1,0,0,0,0,n,r,0,0,-r,n,0,0,0,0,1,i),i._updateIdentityStatus(1===n&&0===r),i},e.RotationY=function(t){var i=new e;return e.RotationYToRef(t,i),i},e.RotationYToRef=function(t,i){var r=Math.sin(t),n=Math.cos(t);return e.FromValuesToRef(n,0,-r,0,0,1,0,0,r,0,n,0,0,0,0,1,i),i._updateIdentityStatus(1===n&&0===r),i},e.RotationZ=function(t){var i=new e;return e.RotationZToRef(t,i),i},e.RotationZToRef=function(t,i){var r=Math.sin(t),n=Math.cos(t);return e.FromValuesToRef(n,r,0,0,-r,n,0,0,0,0,1,0,0,0,0,1,i),i._updateIdentityStatus(1===n&&0===r),i},e.RotationAxis=function(t,i){var r=new e;return e.RotationAxisToRef(t,i,r),r},e.RotationAxisToRef=function(e,t,i){var r=Math.sin(-t),n=Math.cos(-t),o=1-n;e.normalize();var a=i._m;return a[0]=e._x*e._x*o+n,a[1]=e._x*e._y*o-e._z*r,a[2]=e._x*e._z*o+e._y*r,a[3]=0,a[4]=e._y*e._x*o+e._z*r,a[5]=e._y*e._y*o+n,a[6]=e._y*e._z*o-e._x*r,a[7]=0,a[8]=e._z*e._x*o-e._y*r,a[9]=e._z*e._y*o+e._x*r,a[10]=e._z*e._z*o+n,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,i.markAsUpdated(),i},e.RotationAlignToRef=function(e,t,i,r){void 0===r&&(r=!1);var n=R.Dot(t,e),o=i._m;if(n<-1+_)o[0]=-1,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=r?1:-1,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=r?-1:1,o[11]=0;else{var a=R.Cross(t,e),s=1/(1+n);o[0]=a._x*a._x*s+n,o[1]=a._y*a._x*s-a._z,o[2]=a._z*a._x*s+a._y,o[3]=0,o[4]=a._x*a._y*s+a._z,o[5]=a._y*a._y*s+n,o[6]=a._z*a._y*s-a._x,o[7]=0,o[8]=a._x*a._z*s-a._y,o[9]=a._y*a._z*s+a._x,o[10]=a._z*a._z*s+n,o[11]=0}return o[12]=0,o[13]=0,o[14]=0,o[15]=1,i.markAsUpdated(),i},e.RotationYawPitchRoll=function(t,i,r){var n=new e;return e.RotationYawPitchRollToRef(t,i,r,n),n},e.RotationYawPitchRollToRef=function(e,t,i,r){return P.RotationYawPitchRollToRef(e,t,i,M.Quaternion[0]),M.Quaternion[0].toRotationMatrix(r),r},e.Scaling=function(t,i,r){var n=new e;return e.ScalingToRef(t,i,r,n),n},e.ScalingToRef=function(t,i,r,n){return e.FromValuesToRef(t,0,0,0,0,i,0,0,0,0,r,0,0,0,0,1,n),n._updateIdentityStatus(1===t&&1===i&&1===r),n},e.Translation=function(t,i,r){var n=new e;return e.TranslationToRef(t,i,r,n),n},e.TranslationToRef=function(t,i,r,n){return e.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,t,i,r,1,n),n._updateIdentityStatus(0===t&&0===i&&0===r),n},e.Lerp=function(t,i,r){var n=new t.constructor;return e.LerpToRef(t,i,r,n),n},e.LerpToRef=function(e,t,i,r){for(var n=r._m,o=e.m,a=t.m,s=0;s<16;s++)n[s]=o[s]*(1-i)+a[s]*i;return r.markAsUpdated(),r},e.DecomposeLerp=function(t,i,r){var n=new t.constructor;return e.DecomposeLerpToRef(t,i,r,n),n},e.DecomposeLerpToRef=function(t,i,r,n){var o=M.Vector3[0],a=M.Quaternion[0],s=M.Vector3[1];t.decompose(o,a,s);var l=M.Vector3[2],c=M.Quaternion[1],u=M.Vector3[3];i.decompose(l,c,u);var h=M.Vector3[4];R.LerpToRef(o,l,r,h);var d=M.Quaternion[2];P.SlerpToRef(a,c,r,d);var p=M.Vector3[5];return R.LerpToRef(s,u,r,p),e.ComposeToRef(h,d,p,n),n},e.LookAtLH=function(t,i,r){var n=new e;return e.LookAtLHToRef(t,i,r,n),n},e.LookAtLHToRef=function(t,i,r,n){var o=M.Vector3[0],a=M.Vector3[1],s=M.Vector3[2];i.subtractToRef(t,s),s.normalize(),R.CrossToRef(r,s,o);var l=o.lengthSquared();0===l?o.x=1:o.normalizeFromLength(Math.sqrt(l)),R.CrossToRef(s,o,a),a.normalize();var c=-R.Dot(o,t),u=-R.Dot(a,t),h=-R.Dot(s,t);e.FromValuesToRef(o._x,a._x,s._x,0,o._y,a._y,s._y,0,o._z,a._z,s._z,0,c,u,h,1,n)},e.LookAtRH=function(t,i,r){var n=new e;return e.LookAtRHToRef(t,i,r,n),n},e.LookAtRHToRef=function(t,i,r,n){var o=M.Vector3[0],a=M.Vector3[1],s=M.Vector3[2];t.subtractToRef(i,s),s.normalize(),R.CrossToRef(r,s,o);var l=o.lengthSquared();0===l?o.x=1:o.normalizeFromLength(Math.sqrt(l)),R.CrossToRef(s,o,a),a.normalize();var c=-R.Dot(o,t),u=-R.Dot(a,t),h=-R.Dot(s,t);return e.FromValuesToRef(o._x,a._x,s._x,0,o._y,a._y,s._y,0,o._z,a._z,s._z,0,c,u,h,1,n),n},e.LookDirectionLH=function(t,i){var r=new e;return e.LookDirectionLHToRef(t,i,r),r},e.LookDirectionLHToRef=function(t,i,r){var n=M.Vector3[0];n.copyFrom(t),n.scaleInPlace(-1);var o=M.Vector3[1];return R.CrossToRef(i,n,o),e.FromValuesToRef(o._x,o._y,o._z,0,i._x,i._y,i._z,0,n._x,n._y,n._z,0,0,0,0,1,r),r},e.LookDirectionRH=function(t,i){var r=new e;return e.LookDirectionRHToRef(t,i,r),r},e.LookDirectionRHToRef=function(t,i,r){var n=M.Vector3[2];return R.CrossToRef(i,t,n),e.FromValuesToRef(n._x,n._y,n._z,0,i._x,i._y,i._z,0,t._x,t._y,t._z,0,0,0,0,1,r),r},e.OrthoLH=function(t,i,r,n,o){var a=new e;return e.OrthoLHToRef(t,i,r,n,a,o),a},e.OrthoLHToRef=function(t,i,r,n,o,a){var s=2/t,l=2/i,c=2/(n-r),u=-(n+r)/(n-r);return e.FromValuesToRef(s,0,0,0,0,l,0,0,0,0,c,0,0,0,u,1,o),a&&o.multiplyToRef(D,o),o._updateIdentityStatus(1===s&&1===l&&1===c&&0===u),o},e.OrthoOffCenterLH=function(t,i,r,n,o,a,s){var l=new e;return e.OrthoOffCenterLHToRef(t,i,r,n,o,a,l,s),l},e.OrthoOffCenterLHToRef=function(t,i,r,n,o,a,s,l){var c=2/(i-t),u=2/(n-r),h=2/(a-o),d=-(a+o)/(a-o),p=(t+i)/(t-i),f=(n+r)/(r-n);return e.FromValuesToRef(c,0,0,0,0,u,0,0,0,0,h,0,p,f,d,1,s),l&&s.multiplyToRef(D,s),s.markAsUpdated(),s},e.OrthoOffCenterRH=function(t,i,r,n,o,a,s){var l=new e;return e.OrthoOffCenterRHToRef(t,i,r,n,o,a,l,s),l},e.OrthoOffCenterRHToRef=function(t,i,r,n,o,a,s,l){return e.OrthoOffCenterLHToRef(t,i,r,n,o,a,s,l),s._m[10]*=-1,s},e.PerspectiveLH=function(t,i,r,n,o,a){void 0===a&&(a=0);var s=new e,l=2*r/t,c=2*r/i,u=(n+r)/(n-r),h=-2*n*r/(n-r),d=Math.tan(a);return e.FromValuesToRef(l,0,0,0,0,c,0,d,0,0,u,1,0,0,h,0,s),o&&s.multiplyToRef(D,s),s._updateIdentityStatus(!1),s},e.PerspectiveFovLH=function(t,i,r,n,o,a,s){void 0===a&&(a=0),void 0===s&&(s=!1);var l=new e;return e.PerspectiveFovLHToRef(t,i,r,n,l,!0,o,a,s),l},e.PerspectiveFovLHToRef=function(t,i,r,n,o,a,s,l,c){void 0===a&&(a=!0),void 0===l&&(l=0),void 0===c&&(c=!1);var u=r,h=n,d=1/Math.tan(.5*t),p=a?d/i:d,f=a?d:d*i,_=c&&0===u?-1:0!==h?(h+u)/(h-u):1,m=c&&0===u?2*h:0!==h?-2*h*u/(h-u):-2*u,g=Math.tan(l);return e.FromValuesToRef(p,0,0,0,0,f,0,g,0,0,_,1,0,0,m,0,o),s&&o.multiplyToRef(D,o),o._updateIdentityStatus(!1),o},e.PerspectiveFovReverseLHToRef=function(t,i,r,n,o,a,s,l){void 0===a&&(a=!0),void 0===l&&(l=0);var c=1/Math.tan(.5*t),u=a?c/i:c,h=a?c:c*i,d=Math.tan(l);return e.FromValuesToRef(u,0,0,0,0,h,0,d,0,0,-r,1,0,0,1,0,o),s&&o.multiplyToRef(D,o),o._updateIdentityStatus(!1),o},e.PerspectiveFovRH=function(t,i,r,n,o,a,s){void 0===a&&(a=0),void 0===s&&(s=!1);var l=new e;return e.PerspectiveFovRHToRef(t,i,r,n,l,!0,o,a,s),l},e.PerspectiveFovRHToRef=function(t,i,r,n,o,a,s,l,c){void 0===a&&(a=!0),void 0===l&&(l=0),void 0===c&&(c=!1);var u=r,h=n,d=1/Math.tan(.5*t),p=a?d/i:d,f=a?d:d*i,_=c&&0===u?1:0!==h?-(h+u)/(h-u):-1,m=c&&0===u?2*h:0!==h?-2*h*u/(h-u):-2*u,g=Math.tan(l);return e.FromValuesToRef(p,0,0,0,0,f,0,g,0,0,_,-1,0,0,m,0,o),s&&o.multiplyToRef(D,o),o._updateIdentityStatus(!1),o},e.PerspectiveFovReverseRHToRef=function(t,i,r,n,o,a,s,l){void 0===a&&(a=!0),void 0===l&&(l=0);var c=1/Math.tan(.5*t),u=a?c/i:c,h=a?c:c*i,d=Math.tan(l);return e.FromValuesToRef(u,0,0,0,0,h,0,d,0,0,-r,-1,0,0,-1,0,o),s&&o.multiplyToRef(D,o),o._updateIdentityStatus(!1),o},e.PerspectiveFovWebVRToRef=function(e,t,i,r,n,o,a){void 0===n&&(n=!1),void 0===a&&(a=0);var s=n?-1:1,l=Math.tan(e.upDegrees*Math.PI/180),c=Math.tan(e.downDegrees*Math.PI/180),u=Math.tan(e.leftDegrees*Math.PI/180),h=Math.tan(e.rightDegrees*Math.PI/180),d=2/(u+h),p=2/(l+c),f=Math.tan(a),_=r._m;return _[0]=d,_[1]=_[2]=_[3]=_[4]=0,_[5]=p,_[6]=0,_[7]=f,_[8]=(u-h)*d*.5,_[9]=-(l-c)*p*.5,_[10]=-i/(t-i),_[11]=1*s,_[12]=_[13]=_[15]=0,_[14]=-2*i*t/(i-t),o&&r.multiplyToRef(D,r),r.markAsUpdated(),r},e.GetFinalMatrix=function(t,i,r,n,o,a){var s=t.width,l=t.height,c=t.x,u=t.y,h=e.FromValues(s/2,0,0,0,0,-l/2,0,0,0,0,a-o,0,c+s/2,l/2+u,o,1),d=new i.constructor;return i.multiplyToRef(r,d),d.multiplyToRef(n,d),d.multiplyToRef(h,d)},e.GetAsMatrix2x2=function(e){var t=e.m,i=[t[0],t[1],t[4],t[5]];return E.MatrixUse64Bits?i:new Float32Array(i)},e.GetAsMatrix3x3=function(e){var t=e.m,i=[t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]];return E.MatrixUse64Bits?i:new Float32Array(i)},e.Transpose=function(t){var i=new t.constructor;return e.TransposeToRef(t,i),i},e.TransposeToRef=function(e,t){var i=t._m,r=e.m;return i[0]=r[0],i[1]=r[4],i[2]=r[8],i[3]=r[12],i[4]=r[1],i[5]=r[5],i[6]=r[9],i[7]=r[13],i[8]=r[2],i[9]=r[6],i[10]=r[10],i[11]=r[14],i[12]=r[3],i[13]=r[7],i[14]=r[11],i[15]=r[15],t.markAsUpdated(),t._updateIdentityStatus(e._isIdentity,e._isIdentityDirty),t},e.Reflection=function(t){var i=new e;return e.ReflectionToRef(t,i),i},e.ReflectionToRef=function(t,i){t.normalize();var r=t.normal.x,n=t.normal.y,o=t.normal.z,a=-2*r,s=-2*n,l=-2*o;return e.FromValuesToRef(a*r+1,s*r,l*r,0,a*n,s*n+1,l*n,0,a*o,s*o,l*o+1,0,a*t.d,s*t.d,l*t.d,1,i),i},e.FromXYZAxesToRef=function(t,i,r,n){return e.FromValuesToRef(t._x,t._y,t._z,0,i._x,i._y,i._z,0,r._x,r._y,r._z,0,0,0,0,1,n),n},e.FromQuaternionToRef=function(e,t){var i=e._x*e._x,r=e._y*e._y,n=e._z*e._z,o=e._x*e._y,a=e._z*e._w,s=e._z*e._x,l=e._y*e._w,c=e._y*e._z,u=e._x*e._w;return t._m[0]=1-2*(r+n),t._m[1]=2*(o+a),t._m[2]=2*(s-l),t._m[3]=0,t._m[4]=2*(o-a),t._m[5]=1-2*(n+i),t._m[6]=2*(c+u),t._m[7]=0,t._m[8]=2*(s+l),t._m[9]=2*(c-u),t._m[10]=1-2*(r+i),t._m[11]=0,t._m[12]=0,t._m[13]=0,t._m[14]=0,t._m[15]=1,t.markAsUpdated(),t},e._UpdateFlagSeed=0,e._IdentityReadOnly=e.Identity(),e}(),M=function(){function e(){}return e.Vector3=m.BuildTuple(11,R.Zero),e.Matrix=m.BuildTuple(2,I.Identity),e.Quaternion=m.BuildTuple(3,P.Zero),e}(),O=function(){function e(){}return e.Vector2=m.BuildTuple(3,A.Zero),e.Vector3=m.BuildTuple(13,R.Zero),e.Vector4=m.BuildTuple(3,C.Zero),e.Quaternion=m.BuildTuple(2,P.Zero),e.Matrix=m.BuildTuple(8,I.Identity),e}();b("BABYLON.Vector2",A),b("BABYLON.Vector3",R),b("BABYLON.Vector4",C),b("BABYLON.Matrix",I);var D=I.FromValues(1,0,0,0,0,1,0,0,0,0,.5,0,0,0,.5,1);function N(e){return Math.pow(e,p)}function F(e){return e<=.04045?.0773993808*e:Math.pow(.947867299*(e+.055),2.4)}function L(e){return Math.pow(e,d)}function w(e){return e<=.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var B=function(){function e(e,t,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),this.r=e,this.g=t,this.b=i}return e.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"},e.prototype.getClassName=function(){return"Color3"},e.prototype.getHashCode=function(){var e=255*this.r|0;return 397*(e=397*e^(255*this.g|0))^(255*this.b|0)},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,this},e.prototype.fromArray=function(t,i){return void 0===i&&(i=0),e.FromArrayToRef(t,i,this),this},e.prototype.toColor4=function(e){return void 0===e&&(e=1),new U(this.r,this.g,this.b,e)},e.prototype.asArray=function(){return[this.r,this.g,this.b]},e.prototype.toLuminance=function(){return.3*this.r+.59*this.g+.11*this.b},e.prototype.multiply=function(t){return new e(this.r*t.r,this.g*t.g,this.b*t.b)},e.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,this},e.prototype.equals=function(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b},e.prototype.equalsFloats=function(e,t,i){return this.r===e&&this.g===t&&this.b===i},e.prototype.scale=function(t){return new e(this.r*t,this.g*t,this.b*t)},e.prototype.scaleInPlace=function(e){return this.r*=e,this.g*=e,this.b*=e,this},e.prototype.scaleToRef=function(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,this},e.prototype.clampToRef=function(e,t,i){return void 0===e&&(e=0),void 0===t&&(t=1),i.r=h.Clamp(this.r,e,t),i.g=h.Clamp(this.g,e,t),i.b=h.Clamp(this.b,e,t),this},e.prototype.add=function(t){return new e(this.r+t.r,this.g+t.g,this.b+t.b)},e.prototype.addToRef=function(e,t){return t.r=this.r+e.r,t.g=this.g+e.g,t.b=this.b+e.b,this},e.prototype.subtract=function(t){return new e(this.r-t.r,this.g-t.g,this.b-t.b)},e.prototype.subtractToRef=function(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,this},e.prototype.clone=function(){return new e(this.r,this.g,this.b)},e.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},e.prototype.copyFromFloats=function(e,t,i){return this.r=e,this.g=t,this.b=i,this},e.prototype.set=function(e,t,i){return this.copyFromFloats(e,t,i)},e.prototype.toHexString=function(){var e=Math.round(255*this.r),t=Math.round(255*this.g),i=Math.round(255*this.b);return"#"+h.ToHex(e)+h.ToHex(t)+h.ToHex(i)},e.prototype.toHSV=function(){var t=new e;return this.toHSVToRef(t),t},e.prototype.toHSVToRef=function(e){var t=this.r,i=this.g,r=this.b,n=Math.max(t,i,r),o=Math.min(t,i,r),a=0,s=0,l=n,c=n-o;0!==n&&(s=c/n),n!=o&&(n==t?(a=(i-r)/c,i=0&&o<=1?(s=n,l=a):o>=1&&o<=2?(s=a,l=n):o>=2&&o<=3?(l=n,c=a):o>=3&&o<=4?(l=a,c=n):o>=4&&o<=5?(s=a,c=n):o>=5&&o<=6&&(s=n,c=a);var u=i-n;r.set(s+u,l+u,c+u)},e.FromHSV=function(t,i,r){var n=new e(0,0,0);return e.HSVtoRGBToRef(t,i,r,n),n},e.FromHexString=function(t){if("#"!==t.substring(0,1)||7!==t.length)return new e(0,0,0);var i=parseInt(t.substring(1,3),16),r=parseInt(t.substring(3,5),16),n=parseInt(t.substring(5,7),16);return e.FromInts(i,r,n)},e.FromArray=function(t,i){return void 0===i&&(i=0),new e(t[i],t[i+1],t[i+2])},e.FromArrayToRef=function(e,t,i){void 0===t&&(t=0),i.r=e[t],i.g=e[t+1],i.b=e[t+2]},e.FromInts=function(t,i,r){return new e(t/255,i/255,r/255)},e.Lerp=function(t,i,r){var n=new e(0,0,0);return e.LerpToRef(t,i,r,n),n},e.LerpToRef=function(e,t,i,r){r.r=e.r+(t.r-e.r)*i,r.g=e.g+(t.g-e.g)*i,r.b=e.b+(t.b-e.b)*i},e.Hermite=function(t,i,r,n,o){var a=o*o,s=o*a,l=2*s-3*a+1,c=-2*s+3*a,u=s-2*a+o,h=s-a;return new e(t.r*l+r.r*c+i.r*u+n.r*h,t.g*l+r.g*c+i.g*u+n.g*h,t.b*l+r.b*c+i.b*u+n.b*h)},e.Hermite1stDerivative=function(t,i,r,n,o){var a=e.Black();return this.Hermite1stDerivativeToRef(t,i,r,n,o,a),a},e.Hermite1stDerivativeToRef=function(e,t,i,r,n,o){var a=n*n;o.r=6*(a-n)*e.r+(3*a-4*n+1)*t.r+6*(-a+n)*i.r+(3*a-2*n)*r.r,o.g=6*(a-n)*e.g+(3*a-4*n+1)*t.g+6*(-a+n)*i.g+(3*a-2*n)*r.g,o.b=6*(a-n)*e.b+(3*a-4*n+1)*t.b+6*(-a+n)*i.b+(3*a-2*n)*r.b},e.Red=function(){return new e(1,0,0)},e.Green=function(){return new e(0,1,0)},e.Blue=function(){return new e(0,0,1)},e.Black=function(){return new e(0,0,0)},Object.defineProperty(e,"BlackReadOnly",{get:function(){return e._BlackReadOnly},enumerable:!1,configurable:!0}),e.White=function(){return new e(1,1,1)},e.Purple=function(){return new e(.5,0,.5)},e.Magenta=function(){return new e(1,0,1)},e.Yellow=function(){return new e(1,1,0)},e.Gray=function(){return new e(.5,.5,.5)},e.Teal=function(){return new e(0,1,1)},e.Random=function(){return new e(Math.random(),Math.random(),Math.random())},e._BlackReadOnly=e.Black(),e}(),U=function(){function e(e,t,i,r){void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=0),void 0===r&&(r=1),this.r=e,this.g=t,this.b=i,this.a=r}return e.prototype.addInPlace=function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this.a+=e.a,this},e.prototype.asArray=function(){return[this.r,this.g,this.b,this.a]},e.prototype.toArray=function(e,t){return void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,this},e.prototype.fromArray=function(t,i){return void 0===i&&(i=0),e.FromArrayToRef(t,i,this),this},e.prototype.equals=function(e){return e&&this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a},e.prototype.add=function(t){return new e(this.r+t.r,this.g+t.g,this.b+t.b,this.a+t.a)},e.prototype.subtract=function(t){return new e(this.r-t.r,this.g-t.g,this.b-t.b,this.a-t.a)},e.prototype.subtractToRef=function(e,t){return t.r=this.r-e.r,t.g=this.g-e.g,t.b=this.b-e.b,t.a=this.a-e.a,this},e.prototype.scale=function(t){return new e(this.r*t,this.g*t,this.b*t,this.a*t)},e.prototype.scaleInPlace=function(e){return this.r*=e,this.g*=e,this.b*=e,this.a*=e,this},e.prototype.scaleToRef=function(e,t){return t.r=this.r*e,t.g=this.g*e,t.b=this.b*e,t.a=this.a*e,this},e.prototype.scaleAndAddToRef=function(e,t){return t.r+=this.r*e,t.g+=this.g*e,t.b+=this.b*e,t.a+=this.a*e,this},e.prototype.clampToRef=function(e,t,i){return void 0===e&&(e=0),void 0===t&&(t=1),i.r=h.Clamp(this.r,e,t),i.g=h.Clamp(this.g,e,t),i.b=h.Clamp(this.b,e,t),i.a=h.Clamp(this.a,e,t),this},e.prototype.multiply=function(t){return new e(this.r*t.r,this.g*t.g,this.b*t.b,this.a*t.a)},e.prototype.multiplyToRef=function(e,t){return t.r=this.r*e.r,t.g=this.g*e.g,t.b=this.b*e.b,t.a=this.a*e.a,t},e.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"},e.prototype.getClassName=function(){return"Color4"},e.prototype.getHashCode=function(){var e=255*this.r|0;return 397*(e=397*(e=397*e^(255*this.g|0))^(255*this.b|0))^(255*this.a|0)},e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.a)},e.prototype.copyFrom=function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this},e.prototype.copyFromFloats=function(e,t,i,r){return this.r=e,this.g=t,this.b=i,this.a=r,this},e.prototype.set=function(e,t,i,r){return this.copyFromFloats(e,t,i,r)},e.prototype.toHexString=function(e){void 0===e&&(e=!1);var t=Math.round(255*this.r),i=Math.round(255*this.g),r=Math.round(255*this.b);if(e)return"#"+h.ToHex(t)+h.ToHex(i)+h.ToHex(r);var n=Math.round(255*this.a);return"#"+h.ToHex(t)+h.ToHex(i)+h.ToHex(r)+h.ToHex(n)},e.prototype.toLinearSpace=function(t){void 0===t&&(t=!1);var i=new e;return this.toLinearSpaceToRef(i,t),i},e.prototype.toLinearSpaceToRef=function(e,t){return void 0===t&&(t=!1),t?(e.r=F(this.r),e.g=F(this.g),e.b=F(this.b)):(e.r=N(this.r),e.g=N(this.g),e.b=N(this.b)),e.a=this.a,this},e.prototype.toGammaSpace=function(t){void 0===t&&(t=!1);var i=new e;return this.toGammaSpaceToRef(i,t),i},e.prototype.toGammaSpaceToRef=function(e,t){return void 0===t&&(t=!1),t?(e.r=w(this.r),e.g=w(this.g),e.b=w(this.b)):(e.r=L(this.r),e.g=L(this.g),e.b=L(this.b)),e.a=this.a,this},e.FromHexString=function(t){if("#"!==t.substring(0,1)||9!==t.length&&7!==t.length)return new e(0,0,0,0);var i=parseInt(t.substring(1,3),16),r=parseInt(t.substring(3,5),16),n=parseInt(t.substring(5,7),16),o=9===t.length?parseInt(t.substring(7,9),16):255;return e.FromInts(i,r,n,o)},e.Lerp=function(t,i,r){var n=new e(0,0,0,0);return e.LerpToRef(t,i,r,n),n},e.LerpToRef=function(e,t,i,r){r.r=e.r+(t.r-e.r)*i,r.g=e.g+(t.g-e.g)*i,r.b=e.b+(t.b-e.b)*i,r.a=e.a+(t.a-e.a)*i},e.Hermite=function(t,i,r,n,o){var a=o*o,s=o*a,l=2*s-3*a+1,c=-2*s+3*a,u=s-2*a+o,h=s-a;return new e(t.r*l+r.r*c+i.r*u+n.r*h,t.g*l+r.g*c+i.g*u+n.g*h,t.b*l+r.b*c+i.b*u+n.b*h,t.a*l+r.a*c+i.a*u+n.a*h)},e.Hermite1stDerivative=function(t,i,r,n,o){var a=new e;return this.Hermite1stDerivativeToRef(t,i,r,n,o,a),a},e.Hermite1stDerivativeToRef=function(e,t,i,r,n,o){var a=n*n;o.r=6*(a-n)*e.r+(3*a-4*n+1)*t.r+6*(-a+n)*i.r+(3*a-2*n)*r.r,o.g=6*(a-n)*e.g+(3*a-4*n+1)*t.g+6*(-a+n)*i.g+(3*a-2*n)*r.g,o.b=6*(a-n)*e.b+(3*a-4*n+1)*t.b+6*(-a+n)*i.b+(3*a-2*n)*r.b,o.a=6*(a-n)*e.a+(3*a-4*n+1)*t.a+6*(-a+n)*i.a+(3*a-2*n)*r.a},e.FromColor3=function(t,i){return void 0===i&&(i=1),new e(t.r,t.g,t.b,i)},e.FromArray=function(t,i){return void 0===i&&(i=0),new e(t[i],t[i+1],t[i+2],t[i+3])},e.FromArrayToRef=function(e,t,i){void 0===t&&(t=0),i.r=e[t],i.g=e[t+1],i.b=e[t+2],i.a=e[t+3]},e.FromInts=function(t,i,r,n){return new e(t/255,i/255,r/255,n/255)},e.CheckColors4=function(e,t){if(e.length===3*t){for(var i=[],r=0;r=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a}function j(e,t,i,r){return new(i||(i=Promise))((function(n,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function Y(e,t){var i,r,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]this.value;case t.IsLesser:return this._effectiveTarget[this._property]").concat(n,"
");e._AddLogEntry(a),e._GenerateLimitMessage(i,t)}},Object.defineProperty(e,"LogCache",{get:function(){return e._LogCache},enumerable:!1,configurable:!0}),e.ClearLogCache=function(){e._LogCache="",e._LogLimitOutputs={},e.errorsCount=0},Object.defineProperty(e,"LogLevels",{set:function(t){var i=this;e.Log=e._LogDisabled,e.Warn=e._LogDisabled,e.Error=e._LogDisabled,[e.MessageLogLevel,e.WarningLogLevel,e.ErrorLogLevel].forEach((function(r){(t&r)===r&&(e[i._Levels[r].name]=e._LogEnabled.bind(e,r))}))},enumerable:!1,configurable:!0}),e.NoneLogLevel=0,e.MessageLogLevel=1,e.WarningLogLevel=2,e.ErrorLogLevel=4,e.AllLogLevel=7,e.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.",e._LogCache="",e._LogLimitOutputs={},e._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}],e.errorsCount=0,e.Log=e._LogEnabled.bind(e,e.MessageLogLevel),e.Warn=e._LogEnabled.bind(e,e.WarningLogLevel),e.Error=e._LogEnabled.bind(e,e.ErrorLogLevel),e}(),ee=function(e){function t(t,i,r,n){var o=e.call(this,t,n)||this;return o.propertyPath=r,o._target=o._effectiveTarget=i,o}return W(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)},t.prototype.execute=function(){this._effectiveTarget[this._property]=!this._effectiveTarget[this._property]},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SwitchBooleanAction",properties:[k._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath}]},t)},t}(k),te=function(e){function t(t,i,r,n){var o=e.call(this,t,n)||this;return o.value=r,o._target=i,o}return W(t,e),t.prototype.execute=function(){this._target.state=this.value},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SetStateAction",properties:[k._GetTargetProperty(this._target),{name:"value",value:this.value}]},t)},t}(k),ie=function(e){function t(t,i,r,n,o){var a=e.call(this,t,o)||this;return a.propertyPath=r,a.value=n,a._target=a._effectiveTarget=i,a}return W(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath)},t.prototype.execute=function(){this._effectiveTarget[this._property]=this.value,this._target.markAsDirty&&this._target.markAsDirty(this._property)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"SetValueAction",properties:[k._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:k._SerializeValueAsString(this.value)}]},t)},t}(k),re=function(e){function t(t,i,r,n,o){var a=e.call(this,t,o)||this;return a.propertyPath=r,a.value=n,a._target=a._effectiveTarget=i,a}return W(t,e),t.prototype._prepare=function(){this._effectiveTarget=this._getEffectiveTarget(this._effectiveTarget,this.propertyPath),this._property=this._getProperty(this.propertyPath),"number"!=typeof this._effectiveTarget[this._property]&&$.Warn("Warning: IncrementValueAction can only be used with number values")},t.prototype.execute=function(){this._effectiveTarget[this._property]+=this.value,this._target.markAsDirty&&this._target.markAsDirty(this._property)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"IncrementValueAction",properties:[k._GetTargetProperty(this._target),{name:"propertyPath",value:this.propertyPath},{name:"value",value:k._SerializeValueAsString(this.value)}]},t)},t}(k),ne=function(e){function t(t,i,r,n,o,a){var s=e.call(this,t,a)||this;return s.from=r,s.to=n,s.loop=o,s._target=i,s}return W(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){this._actionManager.getScene().beginAnimation(this._target,this.from,this.to,this.loop)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"PlayAnimationAction",properties:[k._GetTargetProperty(this._target),{name:"from",value:String(this.from)},{name:"to",value:String(this.to)},{name:"loop",value:k._SerializeValueAsString(this.loop)||!1}]},t)},t}(k),oe=function(e){function t(t,i,r){var n=e.call(this,t,r)||this;return n._target=i,n}return W(t,e),t.prototype._prepare=function(){},t.prototype.execute=function(){this._actionManager.getScene().stopAnimation(this._target)},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"StopAnimationAction",properties:[k._GetTargetProperty(this._target)]},t)},t}(k),ae=function(e){function t(t,i){return void 0===t&&(t=a.ACTION_NothingTrigger),e.call(this,t,i)||this}return W(t,e),t.prototype.execute=function(){},t.prototype.serialize=function(t){return e.prototype._serialize.call(this,{name:"DoNothingAction",properties:[]},t)},t}(k),se=function(e){function t(t,i,r,n){void 0===n&&(n=!0);var o=e.call(this,t,r)||this;return o.children=i,o.enableChildrenConditions=n,o}return W(t,e),t.prototype._prepare=function(){for(var e=0;e0)if("object"==typeof l[0])for(var u=0;u-1&&this._scene.actionManagers.splice(i,1);for(var o=0,a=this._scene.meshes.filter((function(t){return t.actionManager===e}));o-1)return!0}return!1},t.prototype.hasSpecificTriggers2=function(e,t){for(var i=0;i=t.OnPickTrigger&&i.trigger<=t.OnPointerOutTrigger)return!0}return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPickTriggers",{get:function(){for(var e=0;e=t.OnPickTrigger&&i.trigger<=t.OnPickUpTrigger)return!0}return!1},enumerable:!1,configurable:!0}),t.prototype.registerAction=function(e){return e.trigger===t.OnEveryFrameTrigger&&this.getScene().actionManager!==this?($.Warn("OnEveryFrameTrigger can only be used with scene.actionManager"),null):(this.actions.push(e),this.getScene()._registeredActions++,t.Triggers[e.trigger]?t.Triggers[e.trigger]++:t.Triggers[e.trigger]=1,e._actionManager=this,e._prepare(),e)},t.prototype.unregisterAction=function(e){var i=this.actions.indexOf(e);return-1!==i&&(this.actions.splice(i,1),t.Triggers[e.trigger]-=1,0===t.Triggers[e.trigger]&&delete t.Triggers[e.trigger],e._actionManager=null,this.getScene()._registeredActions--,!0)},t.prototype.processTrigger=function(e,i){for(var r=0;r0;if(2===e.type?u.push(n):u.push(i),p){for(var f=new Array,_=0;_0){var u=c.properties[0].value,h=null===c.properties[0].targetType?u:r.getMeshByName(u);h._meshId&&(h.mesh=r.getMeshById(h._meshId)),l={trigger:t[c.name],parameter:h}}else l=t[c.name];for(var d=0;d1)for(var l=0;l0||e.CustomRequestModifiers.length>0},enumerable:!1,configurable:!0}),e.prototype._injectCustomRequestHeaders=function(){if(!this._shouldSkipRequestModifications(this._requestURL))for(var t in e.CustomRequestHeaders){var i=e.CustomRequestHeaders[t];i&&this._xhr.setRequestHeader(t,i)}},e.prototype._shouldSkipRequestModifications=function(t){return e.SkipRequestModificationForBabylonCDN&&(t.includes("preview.babylonjs.com")||t.includes("cdn.babylonjs.com"))},Object.defineProperty(e.prototype,"onprogress",{get:function(){return this._xhr.onprogress},set:function(e){this._xhr.onprogress=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._xhr.readyState},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this._xhr.status},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"statusText",{get:function(){return this._xhr.statusText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"response",{get:function(){return this._xhr.response},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseURL",{get:function(){return this._xhr.responseURL},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseText",{get:function(){return this._xhr.responseText},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"responseType",{get:function(){return this._xhr.responseType},set:function(e){this._xhr.responseType=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeout",{get:function(){return this._xhr.timeout},set:function(e){this._xhr.timeout=e},enumerable:!1,configurable:!0}),e.prototype.addEventListener=function(e,t,i){this._xhr.addEventListener(e,t,i)},e.prototype.removeEventListener=function(e,t,i){this._xhr.removeEventListener(e,t,i)},e.prototype.abort=function(){this._xhr.abort()},e.prototype.send=function(t){e.CustomRequestHeaders&&this._injectCustomRequestHeaders(),this._xhr.send(t)},e.prototype.open=function(t,i){for(var r=0,n=e.CustomRequestModifiers;r=0?l.referenceFrame:0,h=0,d=c._keys[0],p=c._keys.length-1,f=c._keys[p],_={referenceValue:d.value,referencePosition:O.Vector3[0],referenceQuaternion:O.Quaternion[0],referenceScaling:O.Vector3[1],keyPosition:O.Vector3[2],keyQuaternion:O.Quaternion[1],keyScaling:O.Vector3[3]},m=d.frame,g=f.frame;if(l.range){var v=c.getRange(l.range);v&&(m=v.from,g=v.to)}else m=null!==(a=l.fromFrame)&&void 0!==a?a:m,g=null!==(s=l.toFrame)&&void 0!==s?s:g;if(m!==d.frame&&(h=c.createKeyForFrame(m)),g!==f.frame&&(p=c.createKeyForFrame(g)),1===c._keys.length){var y=c._getKeyValue(c._keys[0]);_.referenceValue=y.clone?y.clone():y}else u<=d.frame?(y=c._getKeyValue(d.value),_.referenceValue=y.clone?y.clone():y):u>=f.frame?(y=c._getKeyValue(f.value),_.referenceValue=y.clone?y.clone():y):(je.key=0,y=c._interpolate(u,je),_.referenceValue=y.clone?y.clone():y);c.dataType===e.ANIMATIONTYPE_QUATERNION?_.referenceValue.normalize().conjugateInPlace():c.dataType===e.ANIMATIONTYPE_MATRIX&&(_.referenceValue.decompose(_.referenceScaling,_.referenceQuaternion,_.referencePosition),_.referenceQuaternion.normalize().conjugateInPlace());for(var b=Number.MAX_VALUE,T=l.clipKeys?[]:null,E=h;E<=p;E++){var S=c._keys[E];if(T&&(S={frame:S.frame,value:S.value.clone?S.value.clone():S.value,inTangent:S.inTangent,outTangent:S.outTangent,interpolation:S.interpolation,lockedTangent:S.lockedTangent},b===Number.MAX_VALUE&&(b=S.frame),S.frame-=b,T.push(S)),!E||c.dataType===e.ANIMATIONTYPE_FLOAT||S.value!==d.value)switch(c.dataType){case e.ANIMATIONTYPE_MATRIX:S.value.decompose(_.keyScaling,_.keyQuaternion,_.keyPosition),_.keyPosition.subtractInPlace(_.referencePosition),_.keyScaling.divideInPlace(_.referenceScaling),_.referenceQuaternion.multiplyToRef(_.keyQuaternion,_.keyQuaternion),I.ComposeToRef(_.keyScaling,_.keyQuaternion,_.keyPosition,S.value);break;case e.ANIMATIONTYPE_QUATERNION:_.referenceValue.multiplyToRef(S.value,S.value);break;case e.ANIMATIONTYPE_VECTOR2:case e.ANIMATIONTYPE_VECTOR3:case e.ANIMATIONTYPE_COLOR3:case e.ANIMATIONTYPE_COLOR4:S.value.subtractToRef(_.referenceValue,S.value);break;case e.ANIMATIONTYPE_SIZE:S.value.width-=_.referenceValue.width,S.value.height-=_.referenceValue.height;break;default:S.value-=_.referenceValue}}return T&&c.setKeys(T,!0),c},e.TransitionTo=function(e,t,i,r,n,o,a,s){if(void 0===s&&(s=null),a<=0)return i[e]=t,s&&s(),null;var l=n*(a/1e3);o.setKeys([{frame:0,value:i[e].clone?i[e].clone():i[e]},{frame:l,value:t}]),i.animations||(i.animations=[]),i.animations.push(o);var c=r.beginAnimation(i,0,l,!1);return c.onAnimationEnd=s,c},Object.defineProperty(e.prototype,"runtimeAnimations",{get:function(){return this._runtimeAnimations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasRunningRuntimeAnimations",{get:function(){for(var e=0,t=this._runtimeAnimations;e=0;o--)this._keys[o].frame>=r&&this._keys[o].frame<=n&&this._keys.splice(o,1);this._ranges[e]=null}},e.prototype.getRange=function(e){return this._ranges[e]},e.prototype.getKeys=function(){return this._keys},e.prototype.getHighestFrame=function(){for(var e=0,t=0,i=this._keys.length;t0)return i.highLimitValue.clone?i.highLimitValue.clone():i.highLimitValue;for(var n=this._keys,o=n.length,a=i.key;a>=0&&t=n[a+1].frame;)++a;if(i.key=a,a<0)return r?void 0:this._getKeyValue(n[0].value);if(a+1>o-1)return r?void 0:this._getKeyValue(n[o-1].value);var s=n[a],l=n[a+1];if(!r||t!==s.frame&&t!==l.frame){var c=this._getKeyValue(s.value),u=this._getKeyValue(l.value);if(s.interpolation===Be.STEP)return l.frame>t?c:u;var h=void 0!==s.outTangent&&void 0!==l.inTangent,d=l.frame-s.frame,p=(t-s.frame)/d,f=this.getEasingFunction();switch(null!==f&&(p=f.ease(p)),this.dataType){case e.ANIMATIONTYPE_FLOAT:var _=h?this.floatInterpolateFunctionWithTangents(c,s.outTangent*d,u,l.inTangent*d,p):this.floatInterpolateFunction(c,u,p);switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:case e.ANIMATIONLOOPMODE_YOYO:return _;case e.ANIMATIONLOOPMODE_RELATIVE:return i.offsetValue*i.repeatCount+_}break;case e.ANIMATIONTYPE_QUATERNION:var m=h?this.quaternionInterpolateFunctionWithTangents(c,s.outTangent.scale(d),u,l.inTangent.scale(d),p):this.quaternionInterpolateFunction(c,u,p);switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:case e.ANIMATIONLOOPMODE_YOYO:return m;case e.ANIMATIONLOOPMODE_RELATIVE:return m.addInPlace(i.offsetValue.scale(i.repeatCount))}return m;case e.ANIMATIONTYPE_VECTOR3:var g=h?this.vector3InterpolateFunctionWithTangents(c,s.outTangent.scale(d),u,l.inTangent.scale(d),p):this.vector3InterpolateFunction(c,u,p);switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:case e.ANIMATIONLOOPMODE_YOYO:return g;case e.ANIMATIONLOOPMODE_RELATIVE:return g.add(i.offsetValue.scale(i.repeatCount))}break;case e.ANIMATIONTYPE_VECTOR2:var v=h?this.vector2InterpolateFunctionWithTangents(c,s.outTangent.scale(d),u,l.inTangent.scale(d),p):this.vector2InterpolateFunction(c,u,p);switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:case e.ANIMATIONLOOPMODE_YOYO:return v;case e.ANIMATIONLOOPMODE_RELATIVE:return v.add(i.offsetValue.scale(i.repeatCount))}break;case e.ANIMATIONTYPE_SIZE:switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:case e.ANIMATIONLOOPMODE_YOYO:return this.sizeInterpolateFunction(c,u,p);case e.ANIMATIONLOOPMODE_RELATIVE:return this.sizeInterpolateFunction(c,u,p).add(i.offsetValue.scale(i.repeatCount))}break;case e.ANIMATIONTYPE_COLOR3:var y=h?this.color3InterpolateFunctionWithTangents(c,s.outTangent.scale(d),u,l.inTangent.scale(d),p):this.color3InterpolateFunction(c,u,p);switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:case e.ANIMATIONLOOPMODE_YOYO:return y;case e.ANIMATIONLOOPMODE_RELATIVE:return y.add(i.offsetValue.scale(i.repeatCount))}break;case e.ANIMATIONTYPE_COLOR4:var b=h?this.color4InterpolateFunctionWithTangents(c,s.outTangent.scale(d),u,l.inTangent.scale(d),p):this.color4InterpolateFunction(c,u,p);switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:case e.ANIMATIONLOOPMODE_YOYO:return b;case e.ANIMATIONLOOPMODE_RELATIVE:return b.add(i.offsetValue.scale(i.repeatCount))}break;case e.ANIMATIONTYPE_MATRIX:switch(i.loopMode){case e.ANIMATIONLOOPMODE_CYCLE:case e.ANIMATIONLOOPMODE_CONSTANT:case e.ANIMATIONLOOPMODE_YOYO:return e.AllowMatricesInterpolation?this.matrixInterpolateFunction(c,u,p,i.workValue):c;case e.ANIMATIONLOOPMODE_RELATIVE:return c}}return 0}},e.prototype.matrixInterpolateFunction=function(t,i,r,n){return e.AllowMatrixDecomposeForInterpolation?n?(I.DecomposeLerpToRef(t,i,r,n),n):I.DecomposeLerp(t,i,r):n?(I.LerpToRef(t,i,r,n),n):I.Lerp(t,i,r)},e.prototype.clone=function(){var t=new e(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed,this._keys&&t.setKeys(this._keys),this._ranges)for(var i in t._ranges={},this._ranges){var r=this._ranges[i];r&&(t._ranges[i]=r.clone())}return t},e.prototype.setKeys=function(e,t){void 0===t&&(t=!1),this._keys=t?e:e.slice(0)},e.prototype.createKeyForFrame=function(e){je.key=0;var t=this._interpolate(e,je,!0);if(!t)return je.key===e?je.key:je.key+1;var i={frame:e,value:t.clone?t.clone():t};return this._keys.splice(je.key+1,0,i),je.key+1},e.prototype.serialize=function(){var t={};t.name=this.name,t.property=this.targetProperty,t.framePerSecond=this.framePerSecond,t.dataType=this.dataType,t.loopBehavior=this.loopMode,t.enableBlending=this.enableBlending,t.blendingSpeed=this.blendingSpeed;var i=this.dataType;t.keys=[];for(var r=this.getKeys(),n=0;n=2&&(l=s.values[1]),s.values.length>=3&&(c=s.values[2]),s.values.length>=4&&(u=s.values[3]);break;case e.ANIMATIONTYPE_QUATERNION:if(i=P.FromArray(s.values),s.values.length>=8){var h=P.FromArray(s.values.slice(4,8));h.equals(P.Zero())||(l=h)}if(s.values.length>=12){var d=P.FromArray(s.values.slice(8,12));d.equals(P.Zero())||(c=d)}s.values.length>=13&&(u=s.values[12]);break;case e.ANIMATIONTYPE_MATRIX:i=I.FromArray(s.values),s.values.length>=17&&(u=s.values[16]);break;case e.ANIMATIONTYPE_COLOR3:i=B.FromArray(s.values),s.values[3]&&(l=B.FromArray(s.values[3])),s.values[4]&&(c=B.FromArray(s.values[4])),s.values[5]&&(u=s.values[5]);break;case e.ANIMATIONTYPE_COLOR4:i=U.FromArray(s.values),s.values[4]&&(l=U.FromArray(s.values[4])),s.values[5]&&(c=U.FromArray(s.values[5])),s.values[6]&&(u=U.FromArray(s.values[6]));break;case e.ANIMATIONTYPE_VECTOR3:default:i=R.FromArray(s.values),s.values[3]&&(l=R.FromArray(s.values[3])),s.values[4]&&(c=R.FromArray(s.values[4])),s.values[5]&&(u=s.values[5])}var p={};p.frame=s.frame,p.value=i,null!=l&&(p.inTangent=l),null!=c&&(p.outTangent=c),null!=u&&(p.interpolation=u),a.push(p)}if(n.setKeys(a),t.ranges)for(r=0;r0&&u.forEach((function(e){n._events.push(e._clone())})),this._enableBlending=e&&e.animationPropertiesOverride?e.animationPropertiesOverride.enableBlending:this._animation.enableBlending}return Object.defineProperty(e.prototype,"currentFrame",{get:function(){return this._currentFrame},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"weight",{get:function(){return this._weight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetPath",{get:function(){return this._targetPath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._currentActiveTarget},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAdditive",{get:function(){return this._host&&this._host.isAdditive},enumerable:!1,configurable:!0}),e.prototype._preparePath=function(e,t){void 0===t&&(t=0);var i=this._animation.targetPropertyPath;if(i.length>1){for(var r=e[i[0]],n=1;n-1&&this._animation.runtimeAnimations.splice(e,1)},e.prototype.setValue=function(e,t){if(this._targetIsArray)for(var i=0;it[t.length-1].frame&&(e=t[t.length-1].frame);var i=this._events;if(i.length)for(var r=0;rthis._maxFrame)&&(t=this._minFrame),(ithis._maxFrame)&&(i=this._maxFrame);var c,u,h=i-t,d=e*(a.framePerSecond*n)/1e3+this._absoluteFrameOffset,p=0;if(r&&this._animationState.loopMode===Ye.ANIMATIONLOOPMODE_YOYO){var f=(d-t)/h;d=Math.abs(Math.sin(f*Math.PI))*h+t}if(this._previousElapsedTime=e,this._previousAbsoluteFrame=d,!r&&i>=t&&d>=h)l=!1,p=a._getKeyValue(this._maxValue);else if(!r&&t>=i&&d<=h)l=!1,p=a._getKeyValue(this._minValue);else if(this._animationState.loopMode!==Ye.ANIMATIONLOOPMODE_CYCLE){var _=i.toString()+t.toString();if(!this._offsetsCache[_]){this._animationState.repeatCount=0,this._animationState.loopMode=Ye.ANIMATIONLOOPMODE_CYCLE;var m=a._interpolate(t,this._animationState),g=a._interpolate(i,this._animationState);switch(this._animationState.loopMode=this._getCorrectLoopMode(),a.dataType){case Ye.ANIMATIONTYPE_FLOAT:this._offsetsCache[_]=g-m;break;case Ye.ANIMATIONTYPE_QUATERNION:case Ye.ANIMATIONTYPE_VECTOR3:case Ye.ANIMATIONTYPE_VECTOR2:case Ye.ANIMATIONTYPE_SIZE:case Ye.ANIMATIONTYPE_COLOR3:this._offsetsCache[_]=g.subtract(m)}this._highLimitsCache[_]=g}p=this._highLimitsCache[_],c=this._offsetsCache[_]}if(void 0===c)switch(a.dataType){case Ye.ANIMATIONTYPE_FLOAT:c=0;break;case Ye.ANIMATIONTYPE_QUATERNION:c=Qe;break;case Ye.ANIMATIONTYPE_VECTOR3:c=qe;break;case Ye.ANIMATIONTYPE_VECTOR2:c=Ze;break;case Ye.ANIMATIONTYPE_SIZE:c=Je;break;case Ye.ANIMATIONTYPE_COLOR3:c=$e}if(this._host&&this._host.syncRoot){var v=this._host.syncRoot;u=t+h*((v.masterFrame-v.fromFrame)/(v.toFrame-v.fromFrame))}else u=d>0&&t>i||d<0&&t0&&this.currentFrame>u||n<0&&this.currentFrame0?0:a.getKeys().length-1}this._currentFrame=u,this._animationState.repeatCount=0===h?0:d/h>>0,this._animationState.highLimitValue=p,this._animationState.offsetValue=c;var T=a._interpolate(u,this._animationState);if(this.setValue(T,o),y.length)for(b=0;b0&&u>=y[b].frame&&y[b].frame>=t||h<0&&u<=y[b].frame&&y[b].frame<=t){var E=y[b];E.isDone||(E.onlyOnce&&(y.splice(b,1),b--),E.isDone=!0,E.action(u))}return l||(this._stopped=!0),l},e}();function tt(){return"undefined"!=typeof window}function it(){return"undefined"!=typeof navigator}function rt(){return"undefined"!=typeof document}function nt(e){for(var t="",i=e.firstChild;i;)3===i.nodeType&&(t+=i.textContent),i=i.nextSibling;return t}var ot,at={IsWindowObjectExist:tt,IsNavigatorAvailable:it,IsDocumentAvailable:rt,GetDOMTextContent:nt},st=function(){function e(){}return Object.defineProperty(e,"Now",{get:function(){return tt()&&window.performance&&window.performance.now?window.performance.now():Date.now()},enumerable:!1,configurable:!0}),e}(),lt=function(){function e(){}return e.FilesToLoad={},e}(),ct=function(){function e(){}return e.ExponentialBackoff=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=500),function(i,r,n){return 0!==r.status||n>=e||-1!==i.indexOf("file:")?-1:Math.pow(2,n)*t}},e}(),ut=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return W(t,e),t._setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t}(Error),ht={MeshInvalidPositionsError:0,UnsupportedTextureError:1e3,GLTFLoaderUnexpectedMagicError:2e3,SceneLoaderError:3e3,LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002},dt=function(e){function t(i,r,n){var o=e.call(this,i)||this;return o.errorCode=r,o.innerError=n,o.name="RuntimeError",ut._setPrototypeOf(o,t.prototype),o}return W(t,e),t}(ut),pt=function(e,t){return e.endsWith(t)},ft=function(e,t){return!!e&&e.startsWith(t)},_t=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",i=0;i>2,o=(3&t)<<4|(i=u>4,a=(15&i)<<2|(r=u>6,s=63&r,isNaN(i)?a=s=64:isNaN(r)&&(s=64),c+=l.charAt(n)+l.charAt(o)+l.charAt(a)+l.charAt(s);return c},gt=function(e){return atob(e)},vt=function(e){for(var t=gt(e),i=t.length,r=new Uint8Array(new ArrayBuffer(i)),n=0;n1&&this._lines.push(n);else for(var a=r.split(";"),s=0;s1){for(o();-1!==n&&e._OperatorPriority[s()]>=e._OperatorPriority[d];)r.push(l());a(d),c++}else u+=h;c++}for(o();-1!==n;)"("===s()?l():r.push(l());return e._InfixToPostfixCache.size>=e.InfixToPostfixCacheLimitSize&&e.ClearCache(),e._InfixToPostfixCache.set(t,{result:r,accessTime:Date.now()}),r},e.ClearCache=function(){for(var t=Array.from(e._InfixToPostfixCache.entries()).sort((function(e,t){return e[1].accessTime-t[1].accessTime})),i=0;i":i=r>n;break;case"<":i=r=":i=r>=n;break;case"==":i=r===n;break;case"!=":i=r!==n}return i},t}(At);!function(e){e[e.GLSL=0]="GLSL",e[e.WGSL=1]="WGSL"}(ot||(ot={}));var Mt,Ot=/defined\s*?\((.+?)\)/g,Dt=/defined\s*?\[(.+?)\]/g,Nt=/#include\s?<(.+)>(\((.*)\))*(\[(.*)\])*/g,Ft=/__decl__/,Lt=/light\{X\}.(\w*)/g,wt=/\{X\}/g,Bt=[],Ut=function(){function e(){}return e.Initialize=function(e){e.processor&&e.processor.initializeShaders&&e.processor.initializeShaders(e.processingContext)},e.Process=function(e,t,i,r){var n,o=this;(null===(n=t.processor)||void 0===n?void 0:n.preProcessShaderCode)&&(e=t.processor.preProcessShaderCode(e,t.isFragment)),this._ProcessIncludes(e,t,(function(e){t.processCodeAfterIncludes&&(e=t.processCodeAfterIncludes(t.isFragment?"fragment":"vertex",e));var n=o._ProcessShaderConversion(e,t,r);i(n,e)}))},e.PreProcess=function(e,t,i,r){var n,o=this;(null===(n=t.processor)||void 0===n?void 0:n.preProcessShaderCode)&&(e=t.processor.preProcessShaderCode(e,t.isFragment)),this._ProcessIncludes(e,t,(function(e){t.processCodeAfterIncludes&&(e=t.processCodeAfterIncludes(t.isFragment?"fragment":"vertex",e));var n=o._ApplyPreProcessing(e,t,r);i(n,e)}))},e.Finalize=function(e,t,i){return i.processor&&i.processor.finalizeShaders?i.processor.finalizeShaders(e,t,i.processingContext):{vertexCode:e,fragmentCode:t}},e._ProcessPrecision=function(e,t){var i;if(null===(i=t.processor)||void 0===i?void 0:i.noPrecision)return e;var r=t.shouldUseHighPrecisionShader;return-1===e.indexOf("precision highp float")?e=r?"precision highp float;\n"+e:"precision mediump float;\n"+e:r||(e=e.replace("precision highp float","precision mediump float")),e},e._ExtractOperation=function(e){var t=/defined\((.+)\)/.exec(e);if(t&&t.length)return new Rt(t[1].trim(),"!"===e[0]);for(var i="",r=0,n=0,o=["==","!=",">=","<=","<",">"];n-1));n++);if(-1===r)return new Rt(e);var a=e.substring(0,r).trim(),s=e.substring(r+i.length).trim();return new It(a,i,s)},e._BuildSubExpression=function(e){e=e.replace(Ot,"defined[$1]");for(var t=[],i=0,r=At.infixToPostfix(e);i=2){var o=t[t.length-1],a=t[t.length-2];t.length-=2;var s="&&"==n?new Pt:new Ct;"string"==typeof o&&(o=o.replace(Dt,"defined($1)")),"string"==typeof a&&(a=a.replace(Dt,"defined($1)")),s.leftOperand="string"==typeof a?this._ExtractOperation(a):a,s.rightOperand="string"==typeof o?this._ExtractOperation(o):o,t.push(s)}}var l=t[t.length-1];return"string"==typeof l&&(l=l.replace(Dt,"defined($1)")),"string"==typeof l?this._ExtractOperation(l):l},e._BuildExpression=function(e,t){var i=new xt,r=e.substring(0,t),n=e.substring(t);return n=n.substring(0,(n.indexOf("//")+1||n.length+1)-1).trim(),i.testExpression="#ifdef"===r?new Rt(n):"#ifndef"===r?new Rt(n,!0):this._BuildSubExpression(n),i},e._MoveCursorWithinIf=function(e,t,i){for(var r=e.currentLine;this._MoveCursor(e,i);){var n=(r=e.currentLine).substring(0,5).toLowerCase();if("#else"===n){var o=new Tt;return t.children.push(o),void this._MoveCursor(e,o)}if("#elif"===n){var a=this._BuildExpression(r,5);t.children.push(a),i=a}}},e._MoveCursor=function(t,i){for(;t.canRead;){t.lineIndex++;var r=t.currentLine;if(r.indexOf("#")>=0){var n=e._MoveCursorRegex.exec(r);if(n&&n.length){switch(n[0]){case"#ifdef":var o=new St;i.children.push(o);var a=this._BuildExpression(r,6);o.children.push(a),this._MoveCursorWithinIf(t,o,a);break;case"#else":case"#elif":return!0;case"#endif":return!1;case"#ifndef":o=new St,i.children.push(o),a=this._BuildExpression(r,7),o.children.push(a),this._MoveCursorWithinIf(t,o,a);break;case"#if":o=new St,a=this._BuildExpression(r,3),i.children.push(o),o.children.push(a),this._MoveCursorWithinIf(t,o,a)}continue}}var s=new Tt;if(s.line=r,i.children.push(s),"#"===r[0]&&"d"===r[1]){var l=r.replace(";","").split(" ");s.additionalDefineKey=l[1],3===l.length&&(s.additionalDefineValue=l[2])}}return!1},e._EvaluatePreProcessors=function(e,t,i){var r=new Tt,n=new Et;return n.lineIndex=-1,n.lines=e.split("\n"),this._MoveCursor(n,r),r.process(t,i)},e._PreparePreProcessors=function(e,t){for(var i,r={},n=0,o=e.defines;n1?a[1]:""}return(null===(i=e.processor)||void 0===i?void 0:i.shaderLanguage)===ot.GLSL&&(r.GL_ES="true"),r.__VERSION__=e.version,r[e.platformName]="true",t._getGlobalDefines(r),r},e._ProcessShaderConversion=function(e,t,i){var r=this._ProcessPrecision(e,t);if(!t.processor)return r;if(t.processor.shaderLanguage===ot.GLSL&&-1!==r.indexOf("#version 3")&&(r=r.replace("#version 300 es",""),!t.processor.parseGLES3))return r;var n=t.defines,o=this._PreparePreProcessors(t,i);return t.processor.preProcessor&&(r=t.processor.preProcessor(r,n,t.isFragment,t.processingContext)),r=this._EvaluatePreProcessors(r,o,t),t.processor.postProcessor&&(r=t.processor.postProcessor(r,n,t.isFragment,t.processingContext,i)),i._features.needShaderCodeInlining&&(r=i.inlineShaderCode(r)),r},e._ApplyPreProcessing=function(e,t,i){var r,n,o=e,a=t.defines,s=this._PreparePreProcessors(t,i);return(null===(r=t.processor)||void 0===r?void 0:r.preProcessor)&&(o=t.processor.preProcessor(o,a,t.isFragment,t.processingContext)),o=this._EvaluatePreProcessors(o,s,t),(null===(n=t.processor)||void 0===n?void 0:n.postProcessor)&&(o=t.processor.postProcessor(o,a,t.isFragment,t.processingContext,i)),i._features.needShaderCodeInlining&&(o=i.inlineShaderCode(o)),o},e._ProcessIncludes=function(t,i,r){var n,o=this;for(Bt.length=0;null!==(n=Nt.exec(t));)Bt.push(n);for(var a=String(t),s=[t],l=!1,c=function(t){var n=t[1];if(-1!==n.indexOf("__decl__")&&(n=n.replace(Ft,""),i.supportsUniformBuffers&&(n=n.replace("Vertex","Ubo").replace("Fragment","Ubo")),n+="Declaration"),!i.includesShadersStore[n]){var a=i.shadersRepository+"ShadersInclude/"+n+".fx";return e._FileToolsLoadFile(a,(function(e){i.includesShadersStore[n]=e,o._ProcessIncludes(s.join(""),i,r)})),{value:void 0}}var c=i.includesShadersStore[n];if(t[2])for(var u=t[3].split(","),h=0;h=0||c.indexOf("#include <")>=0},u=0,h=Bt;u-1?e:Vt.GetShadersRepository(this._shaderLanguage)+e,this._engine._loadFile(n+"."+t.toLowerCase()+".fx",r))}else r(window.atob(e.substr(7)));else r(e.substr(7))},Object.defineProperty(e.prototype,"vertexSourceCode",{get:function(){var e,t;return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._vertexSourceCodeOverride:null!==(t=null===(e=this._pipelineContext)||void 0===e?void 0:e._getVertexShaderCode())&&void 0!==t?t:this._vertexSourceCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fragmentSourceCode",{get:function(){var e,t;return this._vertexSourceCodeOverride&&this._fragmentSourceCodeOverride?this._fragmentSourceCodeOverride:null!==(t=null===(e=this._pipelineContext)||void 0===e?void 0:e._getFragmentShaderCode())&&void 0!==t?t:this._fragmentSourceCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"vertexSourceCodeBeforeMigration",{get:function(){return this._vertexSourceCodeBeforeMigration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fragmentSourceCodeBeforeMigration",{get:function(){return this._fragmentSourceCodeBeforeMigration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rawVertexSourceCode",{get:function(){return this._rawVertexSourceCode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rawFragmentSourceCode",{get:function(){return this._rawFragmentSourceCode},enumerable:!1,configurable:!0}),e.prototype._rebuildProgram=function(e,t,i,r){var n=this;this._isReady=!1,this._vertexSourceCodeOverride=e,this._fragmentSourceCodeOverride=t,this.onError=function(e,t){r&&r(t)},this.onCompiled=function(){var e=n.getEngine().scenes;if(e)for(var t=0;t=a&&(n="Offending line [".concat(a,"] in ").concat(i?"fragment":"vertex"," code: ").concat(s[a-1]))}}return[e,n]},e.prototype._processCompilationErrors=function(t,i){var r,n,o,a,s,l=this;void 0===i&&(i=null),this._compilationError=t.message;var c=this._attributesNames,u=this._fallbacks;if($.Error("Unable to compile effect:"),$.Error("Uniforms: "+this._uniformsNames.map((function(e){return" "+e}))),$.Error("Attributes: "+c.map((function(e){return" "+e}))),$.Error("Defines:\n"+this.defines),e.LogShaderCodeOnCompilationError){var h=null,d=null,p=null;(null===(o=this._pipelineContext)||void 0===o?void 0:o._getVertexShaderCode())&&(p=(r=this._getShaderCodeAndErrorLine(this._pipelineContext._getVertexShaderCode(),this._compilationError,!1))[0],h=r[1],p&&($.Error("Vertex code:"),$.Error(p))),(null===(a=this._pipelineContext)||void 0===a?void 0:a._getFragmentShaderCode())&&(p=(n=this._getShaderCodeAndErrorLine(null===(s=this._pipelineContext)||void 0===s?void 0:s._getFragmentShaderCode(),this._compilationError,!0))[0],d=n[1],p&&($.Error("Fragment code:"),$.Error(p))),h&&$.Error(h),d&&$.Error(d)}$.Error("Error: "+this._compilationError);var f=function(){l.onError&&l.onError(l,l._compilationError),l.onErrorObservable.notifyObservers(l)};i&&(this._pipelineContext=i,this._isReady=!0,f()),u?(this._pipelineContext=null,u.hasMoreFallbacks?(this._allFallbacksProcessed=!1,$.Error("Trying next fallback."),this.defines=u.reduce(this.defines,this),this._prepareEffect()):(this._allFallbacksProcessed=!0,f(),this.onErrorObservable.clear(),this._fallbacks&&this._fallbacks.unBindMesh())):(this._allFallbacksProcessed=!0,i||f())},Object.defineProperty(e.prototype,"isSupported",{get:function(){return""===this._compilationError},enumerable:!1,configurable:!0}),e.prototype._bindTexture=function(e,t){this._engine._bindTexture(this._samplers[e],t,e)},e.prototype.setTexture=function(e,t){this._engine.setTexture(this._samplers[e],this._uniforms[e],t,e)},e.prototype.setDepthStencilTexture=function(e,t){this._engine.setDepthStencilTexture(this._samplers[e],this._uniforms[e],t,e)},e.prototype.setTextureArray=function(e,t){var i=e+"Ex";if(-1===this._samplerList.indexOf(i+"0")){for(var r=this._samplerList.indexOf(e),n=1;n0&&parseInt(O[O.length-1])>=M)continue}for(var D=0,N=P;D1?new Kt:new jt,this._badOS=/iPad/i.test(navigator.userAgent)||/iPhone/i.test(navigator.userAgent);var w="Babylon.js v".concat(e.Version);console.log(w+" - ".concat(this.description)),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",w)}}return Object.defineProperty(e,"NpmPackage",{get:function(){return"babylonjs@6.23.0"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"Version",{get:function(){return"6.23.0"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"description",{get:function(){var e=this.name+this.webGLVersion;return this._caps.parallelShaderCompile&&(e+=" - Parallel shader compilation"),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(e){this._name=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._webGLVersion},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),Object.defineProperty(e,"ShadersRepository",{get:function(){return kt.ShadersRepository},set:function(e){kt.ShadersRepository=e},enumerable:!1,configurable:!0}),e.prototype._getShaderProcessor=function(e){return this._shaderProcessor},Object.defineProperty(e.prototype,"useReverseDepthBuffer",{get:function(){return this._useReverseDepthBuffer},set:function(e){e!==this._useReverseDepthBuffer&&(this._useReverseDepthBuffer=e,this._depthCullingState.depthFunc=e?a.GEQUAL:a.LEQUAL)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frameId",{get:function(){return this._frameId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"supportsUniformBuffers",{get:function(){return this.webGLVersion>1&&!this.disableUniformBuffers},enumerable:!1,configurable:!0}),e.prototype.getCreationOptions=function(){return this._creationOptions},Object.defineProperty(e.prototype,"_shouldUseHighPrecisionShader",{get:function(){return!(!this._caps.highPrecisionShaderSupported||!this._highPrecisionShadersAllowed)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"needPOTTextures",{get:function(){return this._webGLVersion<2||this.forcePOTTextures},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeRenderLoops",{get:function(){return this._activeRenderLoops},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"doNotHandleContextLost",{get:function(){return this._doNotHandleContextLost},set:function(e){this._doNotHandleContextLost=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_supportsHardwareTextureRescaling",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"framebufferDimensionsObject",{set:function(e){this._framebufferDimensionsObject=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentViewport",{get:function(){return this._cachedViewport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture",{get:function(){return this._emptyTexture||(this._emptyTexture=this.createRawTexture(new Uint8Array(4),1,1,a.TEXTUREFORMAT_RGBA,!1,!1,a.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture3D",{get:function(){return this._emptyTexture3D||(this._emptyTexture3D=this.createRawTexture3D(new Uint8Array(4),1,1,1,a.TEXTUREFORMAT_RGBA,!1,!1,a.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture3D},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyTexture2DArray",{get:function(){return this._emptyTexture2DArray||(this._emptyTexture2DArray=this.createRawTexture2DArray(new Uint8Array(4),1,1,1,a.TEXTUREFORMAT_RGBA,!1,!1,a.TEXTURE_NEAREST_SAMPLINGMODE)),this._emptyTexture2DArray},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emptyCubeTexture",{get:function(){if(!this._emptyCubeTexture){var e=new Uint8Array(4),t=[e,e,e,e,e,e];this._emptyCubeTexture=this.createRawCubeTexture(t,1,a.TEXTUREFORMAT_RGBA,a.TEXTURETYPE_UNSIGNED_INT,!1,!1,a.TEXTURE_NEAREST_SAMPLINGMODE)}return this._emptyCubeTexture},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isWebGPU",{get:function(){return this._isWebGPU},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shaderPlatformName",{get:function(){return this._shaderPlatformName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"snapshotRendering",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"snapshotRenderingMode",{get:function(){return this._snapshotRenderingMode},set:function(e){this._snapshotRenderingMode=e},enumerable:!1,configurable:!0}),e.prototype.snapshotRenderingReset=function(){this.snapshotRendering=!1},e._CreateCanvas=function(e,t){if("undefined"==typeof document)return new OffscreenCanvas(e,t);var i=document.createElement("canvas");return i.width=e,i.height=t,i},e.prototype.createCanvas=function(t,i){return e._CreateCanvas(t,i)},e.prototype.createCanvasImage=function(){return document.createElement("img")},e.prototype._setupMobileChecks=function(){var e=this;navigator&&navigator.userAgent&&(this._checkForMobile=function(){var t=navigator.userAgent;e.hostInformation.isMobile=-1!==t.indexOf("Mobile")||-1!==t.indexOf("Mac")&&rt()&&"ontouchend"in document},this._checkForMobile(),tt()&&window.addEventListener("resize",this._checkForMobile))},e.prototype._restoreEngineAfterContextLost=function(e){var t=this;setTimeout((function(){return j(t,void 0,void 0,(function(){var t,i,r,n,o;return Y(this,(function(a){switch(a.label){case 0:return this._dummyFramebuffer=null,t=this._depthCullingState.depthTest,i=this._depthCullingState.depthFunc,r=this._depthCullingState.depthMask,n=this._stencilState.stencilTest,[4,e()];case 1:return a.sent(),this.wipeCaches(!0),this._rebuildEffects(),null===(o=this._rebuildComputeEffects)||void 0===o||o.call(this),this._rebuildBuffers(),this._rebuildInternalTextures(),this._rebuildRenderTargetWrappers(),this.wipeCaches(!0),this._depthCullingState.depthTest=t,this._depthCullingState.depthFunc=i,this._depthCullingState.depthMask=r,this._stencilState.stencilTest=n,$.Warn(this.name+" context successfully restored."),this.onContextRestoredObservable.notifyObservers(this),this._contextWasLost=!1,[2]}}))}))}),0)},e.prototype._sharedInit=function(e){this._renderingCanvas=e},e.prototype._getShaderProcessingContext=function(e){return null},e.prototype._rebuildInternalTextures=function(){for(var e=0,t=this._internalTexturesCache.slice();e1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||null!==this._gl.getExtension("OES_standard_derivatives"),maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),fragmentDepthSupported:this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:1!==this._webGLVersion,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1},this._glVersion=this._gl.getParameter(this._gl.VERSION);var t=this._gl.getExtension("WEBGL_debug_renderer_info");if(null!=t&&(this._glRenderer=this._gl.getParameter(t.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(t.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),36193!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=36193),34842!==this._gl.RGBA16F&&(this._gl.RGBA16F=34842),34836!==this._gl.RGBA32F&&(this._gl.RGBA32F=34836),35056!==this._gl.DEPTH24_STENCIL8&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=(null!==(e=this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT))&&void 0!==e?e:0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!(!this._caps.textureFloat||!this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!(!this._caps.textureFloat||!this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&5131!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=null!==this._maxMSAASamplesOverride?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES);else{var i=this._gl.getExtension("WEBGL_draw_buffers");if(null!==i){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=i.drawBuffersWEBGL.bind(i),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(var r=0;r<16;r++)this._gl["COLOR_ATTACHMENT"+r+"_WEBGL"]=i["COLOR_ATTACHMENT"+r+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{var n=this._gl.getExtension("WEBGL_depth_texture");null!=n&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=n.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{var o=this._gl.getExtension("OES_vertex_array_object");null!=o&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=o.createVertexArrayOES.bind(o),this._gl.bindVertexArray=o.bindVertexArrayOES.bind(o),this._gl.deleteVertexArray=o.deleteVertexArrayOES.bind(o))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{var a=this._gl.getExtension("ANGLE_instanced_arrays");null!=a?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=a.drawArraysInstancedANGLE.bind(a),this._gl.drawElementsInstanced=a.drawElementsInstancedANGLE.bind(a),this._gl.vertexAttribDivisor=a.vertexAttribDivisorANGLE.bind(a)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){var s=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),l=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);s&&l&&(this._caps.highPrecisionShaderSupported=0!==s.precision&&0!==l.precision)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{var c=this._gl.getExtension("EXT_blend_minmax");null!=c&&(this._caps.blendMinMax=!0,this._gl.MAX=c.MAX_EXT,this._gl.MIN=c.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{var u=this._gl.getExtension("EXT_sRGB");null!=u&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:u.SRGB_EXT,SRGB8:u.SRGB_ALPHA_EXT,SRGB8_ALPHA8:u.SRGB_ALPHA_EXT})}this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&!(!this._creationOptions||!this._creationOptions.forceSRGBBufferSupportState)}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(var h=0;h=0&&(this._activeRenderLoops.splice(t,1),0==this._activeRenderLoops.length&&this._cancelFrame())},e.prototype._cancelFrame=function(){if(this._renderingQueueLaunched&&this._frameHandler){if(this._renderingQueueLaunched=!1,tt()){var e=(this.getHostWindow()||window).cancelAnimationFrame;if("function"==typeof e)return e(this._frameHandler)}else if("function"==typeof cancelAnimationFrame)return cancelAnimationFrame(this._frameHandler);return clearTimeout(this._frameHandler)}},e.prototype._renderLoop=function(){if(!this._contextWasLost){var e=!0;if((this._isDisposed||!this.renderEvenInBackground&&this._windowIsBackground)&&(e=!1),e){this.beginFrame();for(var t=0;t0?this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow()):this._renderingQueueLaunched=!1},e.prototype.getRenderingCanvas=function(){return this._renderingCanvas},e.prototype.getAudioContext=function(){return this._audioContext},e.prototype.getAudioDestination=function(){return this._audioDestination},e.prototype.getHostWindow=function(){return tt()?this._renderingCanvas&&this._renderingCanvas.ownerDocument&&this._renderingCanvas.ownerDocument.defaultView?this._renderingCanvas.ownerDocument.defaultView:window:null},e.prototype.getRenderWidth=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth},e.prototype.getRenderHeight=function(e){return void 0===e&&(e=!1),!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight},e.prototype._queueNewFrame=function(t,i){return e.QueueNewFrame(t,i)},e.prototype.runRenderLoop=function(e){-1===this._activeRenderLoops.indexOf(e)&&(this._activeRenderLoops.push(e),this._renderingQueueLaunched||(this._renderingQueueLaunched=!0,this._boundRenderFunction=this._renderLoop.bind(this),this._frameHandler=this._queueNewFrame(this._boundRenderFunction,this.getHostWindow())))},e.prototype.clear=function(t,i,r,n){var o,s;void 0===n&&(n=!1);var l=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=l;var c=0;if(i&&t){var u=!0;if(this._currentRenderTarget){var h=null===(o=this._currentRenderTarget.texture)||void 0===o?void 0:o.format;if(h===a.TEXTUREFORMAT_RED_INTEGER||h===a.TEXTUREFORMAT_RG_INTEGER||h===a.TEXTUREFORMAT_RGB_INTEGER||h===a.TEXTUREFORMAT_RGBA_INTEGER){var d=null===(s=this._currentRenderTarget.texture)||void 0===s?void 0:s.type;d===a.TEXTURETYPE_UNSIGNED_INTEGER||d===a.TEXTURETYPE_UNSIGNED_SHORT?(e._TempClearColorUint32[0]=255*t.r,e._TempClearColorUint32[1]=255*t.g,e._TempClearColorUint32[2]=255*t.b,e._TempClearColorUint32[3]=255*t.a,this._gl.clearBufferuiv(this._gl.COLOR,0,e._TempClearColorUint32),u=!1):(e._TempClearColorInt32[0]=255*t.r,e._TempClearColorInt32[1]=255*t.g,e._TempClearColorInt32[2]=255*t.b,e._TempClearColorInt32[3]=255*t.a,this._gl.clearBufferiv(this._gl.COLOR,0,e._TempClearColorInt32),u=!1)}}u&&(this._gl.clearColor(t.r,t.g,t.b,void 0!==t.a?t.a:1),c|=this._gl.COLOR_BUFFER_BIT)}r&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),c|=this._gl.DEPTH_BUFFER_BIT),n&&(this._gl.clearStencil(0),c|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(c)},e.prototype._viewport=function(e,t,i,r){e===this._viewportCached.x&&t===this._viewportCached.y&&i===this._viewportCached.z&&r===this._viewportCached.w||(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=i,this._viewportCached.w=r,this._gl.viewport(e,t,i,r))},e.prototype.setViewport=function(e,t,i){var r=t||this.getRenderWidth(),n=i||this.getRenderHeight(),o=e.x||0,a=e.y||0;this._cachedViewport=e,this._viewport(o*r,a*n,r*e.width,n*e.height)},e.prototype.beginFrame=function(){},e.prototype.endFrame=function(){this._badOS&&this.flushFramebuffer(),this._frameId++},e.prototype.resize=function(e){var t,i;if(void 0===e&&(e=!1),this.adaptToDeviceRatio){var r=tt()&&window.devicePixelRatio||1,n=this._lastDevicePixelRatio/r;this._lastDevicePixelRatio=r,this._hardwareScalingLevel*=n}if(tt()&&rt())if(this._renderingCanvas){var o=this._renderingCanvas.getBoundingClientRect?this._renderingCanvas.getBoundingClientRect():{width:this._renderingCanvas.width*this._hardwareScalingLevel,height:this._renderingCanvas.height*this._hardwareScalingLevel};t=this._renderingCanvas.clientWidth||o.width||this._renderingCanvas.width||100,i=this._renderingCanvas.clientHeight||o.height||this._renderingCanvas.height||100}else t=window.innerWidth,i=window.innerHeight;else t=this._renderingCanvas?this._renderingCanvas.width:100,i=this._renderingCanvas?this._renderingCanvas.height:100;this.setSize(t/this._hardwareScalingLevel,i/this._hardwareScalingLevel,e)},e.prototype.setSize=function(e,t,i){return void 0===i&&(i=!1),!(!this._renderingCanvas||(e|=0,t|=0,!i&&this._renderingCanvas.width===e&&this._renderingCanvas.height===t||(this._renderingCanvas.width=e,this._renderingCanvas.height=t,0)))},e.prototype.bindFramebuffer=function(e,t,i,r,n,o,a){var s,l,c,u,h;void 0===t&&(t=0),void 0===o&&(o=0),void 0===a&&(a=0);var d=e;this._currentRenderTarget&&this.unBindFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(d._MSAAFramebuffer?d._MSAAFramebuffer:d._framebuffer);var p=this._gl;e.isMulti||(e.is2DArray?p.framebufferTextureLayer(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,null===(s=e.texture._hardwareTexture)||void 0===s?void 0:s.underlyingResource,o,a):e.isCube&&p.framebufferTexture2D(p.FRAMEBUFFER,p.COLOR_ATTACHMENT0,p.TEXTURE_CUBE_MAP_POSITIVE_X+t,null===(l=e.texture._hardwareTexture)||void 0===l?void 0:l.underlyingResource,o));var f=e._depthStencilTexture;if(f){var _=e._depthStencilTextureWithStencil?p.DEPTH_STENCIL_ATTACHMENT:p.DEPTH_ATTACHMENT;e.is2DArray?p.framebufferTextureLayer(p.FRAMEBUFFER,_,null===(c=f._hardwareTexture)||void 0===c?void 0:c.underlyingResource,o,a):e.isCube?p.framebufferTexture2D(p.FRAMEBUFFER,_,p.TEXTURE_CUBE_MAP_POSITIVE_X+t,null===(u=f._hardwareTexture)||void 0===u?void 0:u.underlyingResource,o):p.framebufferTexture2D(p.FRAMEBUFFER,_,p.TEXTURE_2D,null===(h=f._hardwareTexture)||void 0===h?void 0:h.underlyingResource,o)}this._cachedViewport&&!n?this.setViewport(this._cachedViewport,i,r):(i||(i=e.width,o&&(i/=Math.pow(2,o))),r||(r=e.height,o&&(r/=Math.pow(2,o))),this._viewport(0,0,i,r)),this.wipeCaches()},e.prototype.setState=function(e,t,i,r,n,o,a){var s,l;void 0===t&&(t=0),void 0===r&&(r=!1),void 0===a&&(a=0),(this._depthCullingState.cull!==e||i)&&(this._depthCullingState.cull=e);var c=null===(l=null!==(s=this.cullBackFaces)&&void 0!==s?s:n)||void 0===l||l?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==c||i)&&(this._depthCullingState.cullFace=c),this.setZOffset(t),this.setZOffsetUnits(a);var u=r?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==u||i)&&(this._depthCullingState.frontFace=u),this._stencilStateComposer.stencilMaterial=o},e.prototype.getDepthBuffer=function(){return this._depthCullingState.depthTest},e.prototype.setDepthBuffer=function(e){this._depthCullingState.depthTest=e},e.prototype.setZOffset=function(e){this._depthCullingState.zOffset=this.useReverseDepthBuffer?-e:e},e.prototype.getZOffset=function(){var e=this._depthCullingState.zOffset;return this.useReverseDepthBuffer?-e:e},e.prototype.setZOffsetUnits=function(e){this._depthCullingState.zOffsetUnits=this.useReverseDepthBuffer?-e:e},e.prototype.getZOffsetUnits=function(){var e=this._depthCullingState.zOffsetUnits;return this.useReverseDepthBuffer?-e:e},e.prototype._bindUnboundFramebuffer=function(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)},e.prototype._currentFrameBufferIsDefaultFrameBuffer=function(){return null===this._currentFramebuffer},e.prototype.generateMipmaps=function(e){this._bindTextureDirectly(this._gl.TEXTURE_2D,e,!0),this._gl.generateMipmap(this._gl.TEXTURE_2D),this._bindTextureDirectly(this._gl.TEXTURE_2D,null)},e.prototype.unBindFramebuffer=function(e,t,i){var r;void 0===t&&(t=!1);var n=e;this._currentRenderTarget=null;var o=this._gl;if(n._MSAAFramebuffer){if(e.isMulti)return void this.unBindMultiColorAttachmentFramebuffer(e,t,i);o.bindFramebuffer(o.READ_FRAMEBUFFER,n._MSAAFramebuffer),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,n._framebuffer),o.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,o.COLOR_BUFFER_BIT,o.NEAREST)}!(null===(r=e.texture)||void 0===r?void 0:r.generateMipMaps)||t||e.isCube||this.generateMipmaps(e.texture),i&&(n._MSAAFramebuffer&&this._bindUnboundFramebuffer(n._framebuffer),i()),this._bindUnboundFramebuffer(null)},e.prototype.flushFramebuffer=function(){this._gl.flush()},e.prototype.restoreDefaultFramebuffer=function(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()},e.prototype._resetVertexBufferBinding=function(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null},e.prototype.createVertexBuffer=function(e){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)},e.prototype._createVertexBuffer=function(e,t){var i=this._gl.createBuffer();if(!i)throw new Error("Unable to create vertex buffer");var r=new qt(i);return this.bindArrayBuffer(r),e instanceof Array?this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t):this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),this._resetVertexBufferBinding(),r.references=1,r},e.prototype.createDynamicVertexBuffer=function(e){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)},e.prototype._resetIndexBufferBinding=function(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null},e.prototype.createIndexBuffer=function(e,t){var i=this._gl.createBuffer(),r=new qt(i);if(!i)throw new Error("Unable to create index buffer");this.bindIndexBuffer(r);var n=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,n,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),r.references=1,r.is32Bits=4===n.BYTES_PER_ELEMENT,r},e.prototype._normalizeIndexData=function(e){if(2===e.BYTES_PER_ELEMENT)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;for(var t=0;t=65535)return new Uint32Array(e);return new Uint16Array(e)}return new Uint16Array(e)},e.prototype.bindArrayBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)},e.prototype.bindUniformBlock=function(e,t,i){var r=e.program,n=this._gl.getUniformBlockIndex(r,t);this._gl.uniformBlockBinding(r,n,i)},e.prototype.bindIndexBuffer=function(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)},e.prototype._bindBuffer=function(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)},e.prototype.updateArrayBuffer=function(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)},e.prototype._vertexAttribPointer=function(e,t,i,r,n,o,a){var s=this._currentBufferPointers[t];if(s){var l=!1;s.active?(s.buffer!==e&&(s.buffer=e,l=!0),s.size!==i&&(s.size=i,l=!0),s.type!==r&&(s.type=r,l=!0),s.normalized!==n&&(s.normalized=n,l=!0),s.stride!==o&&(s.stride=o,l=!0),s.offset!==a&&(s.offset=a,l=!0)):(l=!0,s.active=!0,s.index=t,s.size=i,s.type=r,s.normalized=n,s.stride=o,s.offset=a,s.buffer=e),(l||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),r===this._gl.UNSIGNED_INT||r===this._gl.INT?this._gl.vertexAttribIPointer(t,i,r,o,a):this._gl.vertexAttribPointer(t,i,r,n,o,a))}},e.prototype._bindIndexBufferWithCache=function(e){null!=e&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)},e.prototype._bindVertexBuffersAttributes=function(e,t,i){var r=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(var n=0;n=0){var a=r[n],s=null;if(i&&(s=i[a]),s||(s=e[a]),!s)continue;this._gl.enableVertexAttribArray(o),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[o]=!0);var l=s.getBuffer();l&&(this._vertexAttribPointer(l,o,s.getSize(),s.type,s.normalized,s.byteStride,s.byteOffset),s.getIsInstanced()&&(this._gl.vertexAttribDivisor(o,s.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(o),this._currentInstanceBuffers.push(l))))}}},e.prototype.recordVertexArrayObject=function(e,t,i,r){var n=this._gl.createVertexArray();if(!n)throw new Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(n),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,i,r),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),n},e.prototype.bindVertexArrayObject=function(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=null!=t&&t.is32Bits,this._mustWipeVertexAttributes=!0)},e.prototype.bindBuffersDirectly=function(e,t,i,r,n){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==n){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=n;var o=n.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();for(var a=0,s=0;s=0&&(this._gl.enableVertexAttribArray(l),this._vertexAttribArraysEnabled[l]=!0,this._vertexAttribPointer(e,l,i[s],this._gl.FLOAT,!1,r,a)),a+=4*i[s]}}this._bindIndexBufferWithCache(t)},e.prototype._unbindVertexArrayObject=function(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))},e.prototype.bindBuffers=function(e,t,i,r){this._cachedVertexBuffers===e&&this._cachedEffectForVertexBuffers===i||(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=i,this._bindVertexBuffersAttributes(e,i,r)),this._bindIndexBufferWithCache(t)},e.prototype.unbindInstanceAttributes=function(){for(var e,t=0,i=this._currentInstanceLocations.length;t1?"#version 300 es\n#define WEBGL2 \n":"",s=this._compileShader(t,"vertex",r,a),l=this._compileShader(i,"fragment",r,a);return this._createShaderProgram(e,s,l,n,o)},e.prototype.inlineShaderCode=function(e){return e},e.prototype.createPipelineContext=function(e){var t=new Zt;return t.engine=this,this._caps.parallelShaderCompile&&(t.isParallelCompiled=!0),t},e.prototype.createMaterialContext=function(){},e.prototype.createDrawContext=function(){},e.prototype._createShaderProgram=function(e,t,i,r,n){void 0===n&&(n=null);var o=r.createProgram();if(e.program=o,!o)throw new Error("Unable to create program");return r.attachShader(o,t),r.attachShader(o,i),r.linkProgram(o),e.context=r,e.vertexShader=t,e.fragmentShader=i,e.isParallelCompiled||this._finalizePipelineContext(e),o},e.prototype._finalizePipelineContext=function(e){var t=e.context,i=e.vertexShader,r=e.fragmentShader,n=e.program;if(!t.getProgramParameter(n,t.LINK_STATUS)){var o,a;if(!this._gl.getShaderParameter(i,this._gl.COMPILE_STATUS)&&(o=this._gl.getShaderInfoLog(i)))throw e.vertexCompilationError=o,new Error("VERTEX SHADER "+o);if(!this._gl.getShaderParameter(r,this._gl.COMPILE_STATUS)&&(o=this._gl.getShaderInfoLog(r)))throw e.fragmentCompilationError=o,new Error("FRAGMENT SHADER "+o);if(a=t.getProgramInfoLog(n))throw e.programLinkError=a,new Error(a)}if(this.validateShaderPrograms&&(t.validateProgram(n),!t.getProgramParameter(n,t.VALIDATE_STATUS)&&(a=t.getProgramInfoLog(n))))throw e.programValidationError=a,new Error(a);t.deleteShader(i),t.deleteShader(r),e.vertexShader=void 0,e.fragmentShader=void 0,e.onCompiled&&(e.onCompiled(),e.onCompiled=void 0)},e.prototype._preparePipelineContext=function(e,t,i,r,n,o,a,s,l,c){var u=e;u.program=r?this.createRawShaderProgram(u,t,i,void 0,l):this.createShaderProgram(u,t,i,s,void 0,l),u.program.__SPECTOR_rebuildProgram=a},e.prototype._isRenderingStateCompiled=function(e){var t=e;return!(this._isDisposed||t._isDisposed||!this._gl.getProgramParameter(t.program,this._caps.parallelShaderCompile.COMPLETION_STATUS_KHR)||(this._finalizePipelineContext(t),0))},e.prototype._executeWhenRenderingStateIsCompiled=function(e,t){var i=e;if(i.isParallelCompiled){var r=i.onCompiled;i.onCompiled=r?function(){r(),t()}:t}else t()},e.prototype.getUniforms=function(e,t){for(var i=new Array,r=e,n=0;n1||this.isWebGPU)),(l!==a.TEXTURETYPE_FLOAT||this._caps.textureFloatLinearFiltering)&&(l!==a.TEXTURETYPE_HALF_FLOAT||this._caps.textureHalfFloatLinearFiltering)||(c=a.TEXTURE_NEAREST_SAMPLINGMODE),l!==a.TEXTURETYPE_FLOAT||this._caps.textureFloat||(l=a.TEXTURETYPE_UNSIGNED_INT,$.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));var p=this._gl,f=new Xt(this,r),_=e.width||e,m=e.height||e,g=e.layers||0,v=this._getSamplingParameters(c,s),y=0!==g?p.TEXTURE_2D_ARRAY:p.TEXTURE_2D,b=this._getRGBABufferInternalSizedFormat(l,u,h),T=this._getInternalFormat(u),E=this._getWebGLTextureType(l);return this._bindTextureDirectly(y,f),0!==g?(f.is2DArray=!0,p.texImage3D(y,0,b,_,m,g,0,T,E,null)):p.texImage2D(y,0,b,_,m,0,T,E,null),p.texParameteri(y,p.TEXTURE_MAG_FILTER,v.mag),p.texParameteri(y,p.TEXTURE_MIN_FILTER,v.min),p.texParameteri(y,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(y,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),s&&this._gl.generateMipmap(y),this._bindTextureDirectly(y,null),f._useSRGBBuffer=h,f.baseWidth=_,f.baseHeight=m,f.width=_,f.height=m,f.depth=g,f.isReady=!0,f.samples=d,f.generateMipMaps=s,f.samplingMode=c,f.type=l,f.format=u,f.label=o,this._internalTexturesCache.push(f),f},e.prototype._getUseSRGBBuffer=function(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU||t)},e.prototype._createTextureBase=function(t,i,r,n,o,s,l,c,u,h,d,p,f,_,m,g){var v=this;void 0===o&&(o=a.TEXTURE_TRILINEAR_SAMPLINGMODE),void 0===s&&(s=null),void 0===l&&(l=null),void 0===h&&(h=null),void 0===d&&(d=null),void 0===p&&(p=null),void 0===f&&(f=null);var y="data:"===(t=t||"").substr(0,5),b="blob:"===t.substr(0,5),T=y&&-1!==t.indexOf(";base64,"),E=d||new Xt(this,Mt.Url);E!==d&&(E.label=t.substring(0,60));var x=t;!this._transformTextureUrl||T||d||h||(t=this._transformTextureUrl(t)),x!==t&&(E._originalUrl=x);var A=t.lastIndexOf("."),R=f||(A>-1?t.substring(A).toLowerCase():""),C=null;R.indexOf("?")>-1&&(R=R.split("?")[0]);for(var P=0,I=e._TextureLoaders;Pd||i.height>d||!m._supportsHardwareTextureRescaling)return m._prepareWorkingCanvas(),!(!m._workingCanvas||!m._workingContext||(m._workingCanvas.width=e,m._workingCanvas.height=t,m._workingContext.drawImage(i,0,0,i.width,i.height,0,0,e,t),s.texImage2D(s.TEXTURE_2D,0,c,h,s.UNSIGNED_BYTE,m._workingCanvas),o.width=e,o.height=t,1));var p=new Xt(m,Mt.Temp);return m._bindTextureDirectly(s.TEXTURE_2D,p,!0),s.texImage2D(s.TEXTURE_2D,0,c,h,s.UNSIGNED_BYTE,i),m._rescaleTexture(p,o,r,c,(function(){m._releaseTexture(p),m._bindTextureDirectly(s.TEXTURE_2D,o,!0),a()})),!0}),l,c,u,h,d,p,_)},e._FileToolsLoadImage=function(e,t,i,r,n,o){throw ge("FileTools")},e.prototype._rescaleTexture=function(e,t,i,r,n){},e.prototype.createRawTexture=function(e,t,i,r,n,o,s,l,c,u,h){throw void 0===l&&(l=null),void 0===c&&(c=a.TEXTURETYPE_UNSIGNED_INT),void 0===u&&(u=0),void 0===h&&(h=!1),ge("Engine.RawTexture")},e.prototype.createRawCubeTexture=function(e,t,i,r,n,o,a,s){throw void 0===s&&(s=null),ge("Engine.RawTexture")},e.prototype.createRawTexture3D=function(e,t,i,r,n,o,s,l,c,u){throw void 0===c&&(c=null),void 0===u&&(u=a.TEXTURETYPE_UNSIGNED_INT),ge("Engine.RawTexture")},e.prototype.createRawTexture2DArray=function(e,t,i,r,n,o,s,l,c,u){throw void 0===c&&(c=null),void 0===u&&(u=a.TEXTURETYPE_UNSIGNED_INT),ge("Engine.RawTexture")},e.prototype._unpackFlipY=function(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,e?1:0),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))},e.prototype._getUnpackAlignement=function(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)},e.prototype._getTextureTarget=function(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D},e.prototype.updateTextureSamplingMode=function(e,t,i){void 0===i&&(i=!1);var r=this._getTextureTarget(t),n=this._getSamplingParameters(e,t.useMipMaps||i);this._setTextureParameterInteger(r,this._gl.TEXTURE_MAG_FILTER,n.mag,t),this._setTextureParameterInteger(r,this._gl.TEXTURE_MIN_FILTER,n.min),i&&(t.generateMipMaps=!0,this._gl.generateMipmap(r)),this._bindTextureDirectly(r,null),t.samplingMode=e},e.prototype.updateTextureDimensions=function(e,t,i,r){void 0===r&&(r=1)},e.prototype.updateTextureWrappingMode=function(e,t,i,r){void 0===i&&(i=null),void 0===r&&(r=null);var n=this._getTextureTarget(e);null!==t&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),null!==i&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(i),e),e._cachedWrapV=i),(e.is2DArray||e.is3D)&&null!==r&&(this._setTextureParameterInteger(n,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(r),e),e._cachedWrapR=r),this._bindTextureDirectly(n,null)},e.prototype._setupDepthStencilTexture=function(e,t,i,r,n,o){void 0===o&&(o=1);var s=t.width||t,l=t.height||t,c=t.layers||0;e.baseWidth=s,e.baseHeight=l,e.width=s,e.height=l,e.is2DArray=c>0,e.depth=c,e.isReady=!0,e.samples=o,e.generateMipMaps=!1,e.samplingMode=r?a.TEXTURE_BILINEAR_SAMPLINGMODE:a.TEXTURE_NEAREST_SAMPLINGMODE,e.type=a.TEXTURETYPE_UNSIGNED_INT,e._comparisonFunction=n;var u=this._gl,h=this._getTextureTarget(e),d=this._getSamplingParameters(e.samplingMode,!1);u.texParameteri(h,u.TEXTURE_MAG_FILTER,d.mag),u.texParameteri(h,u.TEXTURE_MIN_FILTER,d.min),u.texParameteri(h,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(h,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),this.webGLVersion>1&&(0===n?(u.texParameteri(h,u.TEXTURE_COMPARE_FUNC,a.LEQUAL),u.texParameteri(h,u.TEXTURE_COMPARE_MODE,u.NONE)):(u.texParameteri(h,u.TEXTURE_COMPARE_FUNC,n),u.texParameteri(h,u.TEXTURE_COMPARE_MODE,u.COMPARE_REF_TO_TEXTURE)))},e.prototype._uploadCompressedDataToTextureDirectly=function(e,t,i,r,n,o,s){void 0===o&&(o=0),void 0===s&&(s=0);var l=this._gl,c=l.TEXTURE_2D;if(e.isCube&&(c=l.TEXTURE_CUBE_MAP_POSITIVE_X+o),e._useSRGBBuffer)switch(t){case a.TEXTUREFORMAT_COMPRESSED_RGB8_ETC2:case a.TEXTUREFORMAT_COMPRESSED_RGB_ETC1_WEBGL:this._caps.etc2?t=l.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case a.TEXTUREFORMAT_COMPRESSED_RGBA8_ETC2_EAC:this._caps.etc2?t=l.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case a.TEXTUREFORMAT_COMPRESSED_RGBA_BPTC_UNORM:t=l.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case a.TEXTUREFORMAT_COMPRESSED_RGBA_ASTC_4x4:t=l.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case a.TEXTUREFORMAT_COMPRESSED_RGB_S3TC_DXT1:this._caps.s3tc_srgb?t=l.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case a.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT1:this._caps.s3tc_srgb?t=l.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case a.TEXTUREFORMAT_COMPRESSED_RGBA_S3TC_DXT5:this._caps.s3tc_srgb?t=l.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1}this._gl.compressedTexImage2D(c,s,t,i,r,0,n)},e.prototype._uploadDataToTextureDirectly=function(e,t,i,r,n,o){void 0===i&&(i=0),void 0===r&&(r=0),void 0===o&&(o=!1);var a=this._gl,s=this._getWebGLTextureType(e.type),l=this._getInternalFormat(e.format),c=void 0===n?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(n,e._useSRGBBuffer);this._unpackFlipY(e.invertY);var u=a.TEXTURE_2D;e.isCube&&(u=a.TEXTURE_CUBE_MAP_POSITIVE_X+i);var h=Math.round(Math.log(e.width)*Math.LOG2E),d=Math.round(Math.log(e.height)*Math.LOG2E),p=o?e.width:Math.pow(2,Math.max(h-r,0)),f=o?e.height:Math.pow(2,Math.max(d-r,0));a.texImage2D(u,r,c,p,f,0,l,s,t)},e.prototype.updateTextureData=function(e,t,i,r,n,o,a,s,l){void 0===a&&(a=0),void 0===s&&(s=0),void 0===l&&(l=!1);var c=this._gl,u=this._getWebGLTextureType(e.type),h=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);var d=c.TEXTURE_2D,p=c.TEXTURE_2D;e.isCube&&(p=c.TEXTURE_CUBE_MAP_POSITIVE_X+a,d=c.TEXTURE_CUBE_MAP),this._bindTextureDirectly(d,e,!0),c.texSubImage2D(p,s,i,r,n,o,h,u,t),l&&this._gl.generateMipmap(p),this._bindTextureDirectly(d,null)},e.prototype._uploadArrayBufferViewToTexture=function(e,t,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var n=this._gl,o=e.isCube?n.TEXTURE_CUBE_MAP:n.TEXTURE_2D;this._bindTextureDirectly(o,e,!0),this._uploadDataToTextureDirectly(e,t,i,r),this._bindTextureDirectly(o,null,!0)},e.prototype._prepareWebGLTextureContinuation=function(e,t,i,r,n){var o=this._gl;if(o){var a=this._getSamplingParameters(n,!i);o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,a.mag),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,a.min),i||r||o.generateMipmap(o.TEXTURE_2D),this._bindTextureDirectly(o.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}},e.prototype._prepareWebGLTexture=function(t,i,r,n,o,s,l,c,u){var h=this;void 0===u&&(u=a.TEXTURE_TRILINEAR_SAMPLINGMODE);var d=this.getCaps().maxTextureSize,p=Math.min(d,this.needPOTTextures?e.GetExponentOfTwo(n.width,d):n.width),f=Math.min(d,this.needPOTTextures?e.GetExponentOfTwo(n.height,d):n.height),_=this._gl;_&&(t._hardwareTexture?(this._bindTextureDirectly(_.TEXTURE_2D,t,!0),this._unpackFlipY(void 0===o||!!o),t.baseWidth=n.width,t.baseHeight=n.height,t.width=p,t.height=f,t.isReady=!0,t.type=-1!==t.type?t.type:a.TEXTURETYPE_UNSIGNED_BYTE,t.format=-1!==t.format?t.format:".jpg"!==i||t._useSRGBBuffer?a.TEXTUREFORMAT_RGBA:a.TEXTUREFORMAT_RGB,c(p,f,n,i,t,(function(){h._prepareWebGLTextureContinuation(t,r,s,l,u)}))||this._prepareWebGLTextureContinuation(t,r,s,l,u)):r&&r.removePendingData(t))},e.prototype._setupFramebufferDepthAttachments=function(e,t,i,r,n){void 0===n&&(n=1);var o=this._gl;if(e&&t)return this._createRenderBuffer(i,r,n,o.DEPTH_STENCIL,o.DEPTH24_STENCIL8,o.DEPTH_STENCIL_ATTACHMENT);if(t){var a=o.DEPTH_COMPONENT16;return this._webGLVersion>1&&(a=o.DEPTH_COMPONENT32F),this._createRenderBuffer(i,r,n,a,a,o.DEPTH_ATTACHMENT)}return e?this._createRenderBuffer(i,r,n,o.STENCIL_INDEX8,o.STENCIL_INDEX8,o.STENCIL_ATTACHMENT):null},e.prototype._createRenderBuffer=function(e,t,i,r,n,o,a){void 0===a&&(a=!0);var s=this._gl.createRenderbuffer();return this._updateRenderBuffer(s,e,t,i,r,n,o,a)},e.prototype._updateRenderBuffer=function(e,t,i,r,n,o,a,s){void 0===s&&(s=!0);var l=this._gl;return l.bindRenderbuffer(l.RENDERBUFFER,e),r>1&&l.renderbufferStorageMultisample?l.renderbufferStorageMultisample(l.RENDERBUFFER,r,o,t,i):l.renderbufferStorage(l.RENDERBUFFER,n,t,i),l.framebufferRenderbuffer(l.FRAMEBUFFER,a,l.RENDERBUFFER,e),s&&l.bindRenderbuffer(l.RENDERBUFFER,null),e},e.prototype._releaseTexture=function(e){var t;this._deleteTexture(null===(t=e._hardwareTexture)||void 0===t?void 0:t.underlyingResource),this.unbindAllTextures();var i=this._internalTexturesCache.indexOf(e);-1!==i&&this._internalTexturesCache.splice(i,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()},e.prototype._releaseRenderTargetWrapper=function(e){var t=this._renderTargetWrapperCache.indexOf(e);-1!==t&&this._renderTargetWrapperCache.splice(t,1)},e.prototype._deleteTexture=function(e){e&&this._gl.deleteTexture(e)},e.prototype._setProgram=function(e){this._currentProgram!==e&&(this._gl.useProgram(e),this._currentProgram=e)},e.prototype.bindSamplers=function(e){var t=e.getPipelineContext();this._setProgram(t.program);for(var i=e.getSamplers(),r=0;r-1;if(i&&s&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||r){if(this._activateCurrentTexture(),t&&t.isMultiview)throw console.error(e,t),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,null!==(o=null===(n=null==t?void 0:t._hardwareTexture)||void 0===n?void 0:n.underlyingResource)&&void 0!==o?o:null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else i&&(a=!0,this._activateCurrentTexture());return s&&!i&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),a},e.prototype._bindTexture=function(e,t,i){if(void 0!==e){t&&(t._associatedChannel=e),this._activeChannel=e;var r=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(r,t)}},e.prototype.unbindAllTextures=function(){for(var e=0;e1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))},e.prototype.setTexture=function(e,t,i,r){void 0!==e&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,i))},e.prototype._bindSamplerUniformToChannel=function(e,t){var i=this._boundUniforms[e];i&&i._currentState!==t&&(this._gl.uniform1i(i,t),i._currentState=t)},e.prototype._getTextureWrapMode=function(e){switch(e){case a.TEXTURE_WRAP_ADDRESSMODE:return this._gl.REPEAT;case a.TEXTURE_CLAMP_ADDRESSMODE:return this._gl.CLAMP_TO_EDGE;case a.TEXTURE_MIRROR_ADDRESSMODE:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT},e.prototype._setTexture=function(e,t,i,r,n){if(void 0===i&&(i=!1),void 0===r&&(r=!1),void 0===n&&(n=""),!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video){this._activeChannel=e;var o=t.getInternalTexture();o&&(o._associatedChannel=e),t.update()}else if(t.delayLoadState===a.DELAYLOADSTATE_NOTLOADED)return t.delayLoad(),!1;var s;s=r?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,!i&&s&&(s._associatedChannel=e);var l=!0;this._boundTexturesCache[e]===s&&(i||this._bindSamplerUniformToChannel(s._associatedChannel,e),l=!1),this._activeChannel=e;var c=this._getTextureTarget(s);if(l&&this._bindTextureDirectly(c,s,i),s&&!s.isMultiview){if(s.isCube&&s._cachedCoordinatesMode!==t.coordinatesMode){s._cachedCoordinatesMode=t.coordinatesMode;var u=t.coordinatesMode!==a.TEXTURE_CUBIC_MODE&&t.coordinatesMode!==a.TEXTURE_SKYBOX_MODE?a.TEXTURE_WRAP_ADDRESSMODE:a.TEXTURE_CLAMP_ADDRESSMODE;t.wrapU=u,t.wrapV=u}s._cachedWrapU!==t.wrapU&&(s._cachedWrapU=t.wrapU,this._setTextureParameterInteger(c,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),s)),s._cachedWrapV!==t.wrapV&&(s._cachedWrapV=t.wrapV,this._setTextureParameterInteger(c,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),s)),s.is3D&&s._cachedWrapR!==t.wrapR&&(s._cachedWrapR=t.wrapR,this._setTextureParameterInteger(c,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),s)),this._setAnisotropicLevel(c,s,t.anisotropicFilteringLevel)}return!0},e.prototype.setTextureArray=function(e,t,i,r){if(void 0!==e&&t){this._textureUnits&&this._textureUnits.length===i.length||(this._textureUnits=new Int32Array(i.length));for(var n=0;n