@uptimizr/dashboard 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +76 -0
  3. package/out/404.html +1 -0
  4. package/out/__next.__PAGE__.txt +9 -0
  5. package/out/__next._full.txt +20 -0
  6. package/out/__next._head.txt +6 -0
  7. package/out/__next._index.txt +5 -0
  8. package/out/__next._tree.txt +4 -0
  9. package/out/_next/static/93W3szqylNKDg-afLRmVW/_buildManifest.js +11 -0
  10. package/out/_next/static/93W3szqylNKDg-afLRmVW/_clientMiddlewareManifest.js +1 -0
  11. package/out/_next/static/93W3szqylNKDg-afLRmVW/_ssgManifest.js +1 -0
  12. package/out/_next/static/chunks/0-2y-_oomza2l.js +87 -0
  13. package/out/_next/static/chunks/00k_j_r7bv_eb.js +266 -0
  14. package/out/_next/static/chunks/00zdau6mcqeae.js +1 -0
  15. package/out/_next/static/chunks/023axeoslq39i.js +1 -0
  16. package/out/_next/static/chunks/068j6934u8j16.js +1 -0
  17. package/out/_next/static/chunks/0_rf76jneiwal.js +176 -0
  18. package/out/_next/static/chunks/0aznt7717miff.js +1 -0
  19. package/out/_next/static/chunks/0cu-q5q3a7uf3.js +1 -0
  20. package/out/_next/static/chunks/0cz1d0mv5g_q7.js +1 -0
  21. package/out/_next/static/chunks/0dm32-jq30tg8.js +1 -0
  22. package/out/_next/static/chunks/0dn0yx0rn6mpf.js +1 -0
  23. package/out/_next/static/chunks/0flc7nppbmsl1.js +3 -0
  24. package/out/_next/static/chunks/0fskcfh9vbhtv.js +1 -0
  25. package/out/_next/static/chunks/0gv7mblzv3dl3.js +87 -0
  26. package/out/_next/static/chunks/0impkpmxx3ttp.js +1 -0
  27. package/out/_next/static/chunks/0jmn7u31w95ly.js +91 -0
  28. package/out/_next/static/chunks/0n8n481szj90g.js +1 -0
  29. package/out/_next/static/chunks/0o6ayai0s01js.js +1 -0
  30. package/out/_next/static/chunks/0rys92_73hdb0.js +22 -0
  31. package/out/_next/static/chunks/0tl_moiyi2txt.js +1 -0
  32. package/out/_next/static/chunks/0tx1j_ghpz7rc.css +3 -0
  33. package/out/_next/static/chunks/0ufbyo1x3qkmo.js +1 -0
  34. package/out/_next/static/chunks/0v82oqyoy9zol.js +1 -0
  35. package/out/_next/static/chunks/0wrm9jr-9bw0e.js +1893 -0
  36. package/out/_next/static/chunks/0wwcfw8i3j_zx.js +1 -0
  37. package/out/_next/static/chunks/0ys9-ozuluawt.js +1 -0
  38. package/out/_next/static/chunks/1-61zh4waha61.js +1 -0
  39. package/out/_next/static/chunks/10r_824wzt8hj.js +1 -0
  40. package/out/_next/static/chunks/112hws17nz665.js +7 -0
  41. package/out/_next/static/chunks/123xxske5c9na.js +1 -0
  42. package/out/_next/static/chunks/13isnf0--pmx1.js +1 -0
  43. package/out/_next/static/chunks/157d9euci08yu.js +1 -0
  44. package/out/_next/static/chunks/15s7425ffrec9.js +3 -0
  45. package/out/_next/static/chunks/163fa70v4mgxj.js +1 -0
  46. package/out/_next/static/chunks/17q0c2h5ui10r.js +4 -0
  47. package/out/_next/static/chunks/18u58lorfahxi.js +4 -0
  48. package/out/_next/static/chunks/1_aahautsz2v_.js +1 -0
  49. package/out/_next/static/chunks/1a9l89j7e6mqu.js +23 -0
  50. package/out/_next/static/chunks/1dsy2ngmfflis.js +123 -0
  51. package/out/_next/static/chunks/1flb8adpj6_2o.js +62 -0
  52. package/out/_next/static/chunks/1lsg-22yob8dx.js +1 -0
  53. package/out/_next/static/chunks/1nj82er7msdto.js +2 -0
  54. package/out/_next/static/chunks/1o1d0p-v1z8ty.js +1 -0
  55. package/out/_next/static/chunks/1pdep2_c530sg.js +1 -0
  56. package/out/_next/static/chunks/1thjncpj7u6pq.js +1 -0
  57. package/out/_next/static/chunks/1vdjn0pkoyypn.js +1 -0
  58. package/out/_next/static/chunks/1yehxf-fmeicg.js +1 -0
  59. package/out/_next/static/chunks/1zvc1tv--w8nn.js +1 -0
  60. package/out/_next/static/chunks/1zx2q-r32thv1.js +4 -0
  61. package/out/_next/static/chunks/2-sjjedfr0kfq.js +1 -0
  62. package/out/_next/static/chunks/21o42k82w4llc.js +1 -0
  63. package/out/_next/static/chunks/25b9x-li-tvk2.js +1 -0
  64. package/out/_next/static/chunks/2712627rfsmwn.js +1 -0
  65. package/out/_next/static/chunks/296w2ke-v5tbm.js +9 -0
  66. package/out/_next/static/chunks/29tfeb6amdkjb.js +23 -0
  67. package/out/_next/static/chunks/2a3spdq-m8drh.js +3 -0
  68. package/out/_next/static/chunks/2aelw3far6rii.js +1 -0
  69. package/out/_next/static/chunks/2aor7m-wbis85.js +1 -0
  70. package/out/_next/static/chunks/2cbmf9m7lqv6k.js +4 -0
  71. package/out/_next/static/chunks/2d09v5u7dfq0q.js +1 -0
  72. package/out/_next/static/chunks/2feca0xcipcyt.js +850 -0
  73. package/out/_next/static/chunks/2fh-_9b6tqhvb.js +1 -0
  74. package/out/_next/static/chunks/2g5gecypj0rqe.js +1 -0
  75. package/out/_next/static/chunks/2kazjq29jeamx.js +1109 -0
  76. package/out/_next/static/chunks/2p2vv6cc9i-3q.js +255 -0
  77. package/out/_next/static/chunks/2szdcpl41-kzv.js +1 -0
  78. package/out/_next/static/chunks/2tws5udjdcmh3.js +1 -0
  79. package/out/_next/static/chunks/2u6shh3oeycm-.js +1 -0
  80. package/out/_next/static/chunks/2unhhuv0arlcv.js +1 -0
  81. package/out/_next/static/chunks/2xwy0-qfho1iz.js +91 -0
  82. package/out/_next/static/chunks/2ycvtdd68gub7.js +1 -0
  83. package/out/_next/static/chunks/2yiy_l8bwiw2_.js +3 -0
  84. package/out/_next/static/chunks/2yph6f7khgqii.js +1 -0
  85. package/out/_next/static/chunks/3-shckrcpvbxu.js +1681 -0
  86. package/out/_next/static/chunks/30fq_t9e2_fv-.js +1 -0
  87. package/out/_next/static/chunks/30yzu213bqtq0.js +5 -0
  88. package/out/_next/static/chunks/310uz81hnnzsu.js +1 -0
  89. package/out/_next/static/chunks/3218lp8l0a5g_.js +1 -0
  90. package/out/_next/static/chunks/35h5n42wxwgzk.js +123 -0
  91. package/out/_next/static/chunks/37vzwr3ciejf1.js +1 -0
  92. package/out/_next/static/chunks/38fhw7fatsyvd.js +3 -0
  93. package/out/_next/static/chunks/3be6s4_kn9q-o.js +1 -0
  94. package/out/_next/static/chunks/3i3gbhccmhu7j.js +210 -0
  95. package/out/_next/static/chunks/3l1dr_qm_x5kp.js +1 -0
  96. package/out/_next/static/chunks/3mqy-84_ul3t2.js +1 -0
  97. package/out/_next/static/chunks/3nz-dh9d7cehk.js +1 -0
  98. package/out/_next/static/chunks/3pufs8g4ui943.js +1 -0
  99. package/out/_next/static/chunks/3sjq_xoi4rbyg.js +31 -0
  100. package/out/_next/static/chunks/3t06schbtqonl.js +1 -0
  101. package/out/_next/static/chunks/3v3-7fio3nw_t.js +1 -0
  102. package/out/_next/static/chunks/3v5ha25nxo43j.js +1 -0
  103. package/out/_next/static/chunks/3yfrsm8lfi6ls.js +22 -0
  104. package/out/_next/static/chunks/3zskk1hxu3-_o.js +1 -0
  105. package/out/_next/static/chunks/turbopack-2ropzf0axp1x9.js +1 -0
  106. package/out/_next/static/media/0c89a48fa5027cee-s.p.2cyn07wtgehh0.woff2 +0 -0
  107. package/out/_next/static/media/13bf9871fe164e7f-s.2f7nqdagzwx2-.woff2 +0 -0
  108. package/out/_next/static/media/28868e710e86be81-s.2eksvhm1z0jwa.woff2 +0 -0
  109. package/out/_next/static/media/32687112bd2dd8db-s.1gepa_7fcx9fm.woff2 +0 -0
  110. package/out/_next/static/media/3fe682a82f50d426-s.0vfdmo25voy_0.woff2 +0 -0
  111. package/out/_next/static/media/70bc3e132a0a741e-s.p.3t6q91iet4nsy.woff2 +0 -0
  112. package/out/_next/static/media/71b036adf157cdcf-s.0bp8oijd_gu96.woff2 +0 -0
  113. package/out/_next/static/media/89b21bb081cb7469-s.1fby2rem9ngyr.woff2 +0 -0
  114. package/out/_next/static/media/cc545e633e20c56d-s.176arc174-8zp.woff2 +0 -0
  115. package/out/_next/static/media/icon.08h29dad3pcxg.svg +4 -0
  116. package/out/_not-found/__next._full.txt +16 -0
  117. package/out/_not-found/__next._head.txt +6 -0
  118. package/out/_not-found/__next._index.txt +5 -0
  119. package/out/_not-found/__next._not-found.__PAGE__.txt +5 -0
  120. package/out/_not-found/__next._not-found.txt +5 -0
  121. package/out/_not-found/__next._tree.txt +2 -0
  122. package/out/_not-found.html +1 -0
  123. package/out/_not-found.txt +16 -0
  124. package/out/api/projects +1 -0
  125. package/out/icon.svg +4 -0
  126. package/out/index.html +1 -0
  127. package/out/index.txt +20 -0
  128. package/out/logo.svg +46 -0
  129. package/package.json +67 -0
  130. package/server/standalone.mjs +182 -0
@@ -0,0 +1,4 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,32550,e=>{"use strict";var t,i,r=e.i(10272),s=e.i(37143),a=e.i(45707),n=e.i(66749),o=e.i(70653),l=e.i(35407);class u{constructor(){this.previousWorldMatrices={},this.previousBones={}}static AddUniforms(e){e.push("previousWorld","previousViewProjection","mPreviousBones")}static AddSamplers(e){}bindForSubMesh(e,t,i,r,s){if(t.prePassRenderer&&t.prePassRenderer.enabled&&t.prePassRenderer.currentRTisSceneRT&&(-1!==t.prePassRenderer.getIndex(2)||-1!==t.prePassRenderer.getIndex(11))){this.previousWorldMatrices[i.uniqueId]||(this.previousWorldMatrices[i.uniqueId]=r.clone()),this.previousViewProjection||(this.previousViewProjection=t.getTransformMatrix().clone(),this.currentViewProjection=t.getTransformMatrix().clone());let s=t.getEngine();this.currentViewProjection.updateFlag!==t.getTransformMatrix().updateFlag?(this._lastUpdateFrameId=s.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection),this.currentViewProjection.copyFrom(t.getTransformMatrix())):this._lastUpdateFrameId!==s.frameId&&(this._lastUpdateFrameId=s.frameId,this.previousViewProjection.copyFrom(this.currentViewProjection)),e.setMatrix("previousWorld",this.previousWorldMatrices[i.uniqueId]),e.setMatrix("previousViewProjection",this.previousViewProjection),this.previousWorldMatrices[i.uniqueId]=r.clone()}}}class h{constructor(e){if(this.VERTEXOUTPUT_INVARIANT=!1,this._keys=[],this._isDirty=!0,this._areLightsDirty=!0,this._areLightsDisposed=!1,this._areAttributesDirty=!0,this._areTexturesDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._normals=!1,this._uvs=!1,this._needNormals=!1,this._needUVs=!1,this._externalProperties=e,e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this._setDefaultValue(t)}get isDirty(){return this._isDirty}markAsProcessed(){this._isDirty=!1,this._areAttributesDirty=!1,this._areTexturesDirty=!1,this._areFresnelDirty=!1,this._areLightsDirty=!1,this._areLightsDisposed=!1,this._areMiscDirty=!1,this._arePrePassDirty=!1,this._areImageProcessingDirty=!1}markAsUnprocessed(){this._isDirty=!0}markAllAsDirty(){this._areTexturesDirty=!0,this._areAttributesDirty=!0,this._areLightsDirty=!0,this._areFresnelDirty=!0,this._areMiscDirty=!0,this._arePrePassDirty=!0,this._areImageProcessingDirty=!0,this._isDirty=!0}markAsImageProcessingDirty(){this._areImageProcessingDirty=!0,this._isDirty=!0}markAsLightDirty(e=!1){this._areLightsDirty=!0,this._areLightsDisposed=this._areLightsDisposed||e,this._isDirty=!0}markAsAttributesDirty(){this._areAttributesDirty=!0,this._isDirty=!0}markAsTexturesDirty(){this._areTexturesDirty=!0,this._isDirty=!0}markAsFresnelDirty(){this._areFresnelDirty=!0,this._isDirty=!0}markAsMiscDirty(){this._areMiscDirty=!0,this._isDirty=!0}markAsPrePassDirty(){this._arePrePassDirty=!0,this._isDirty=!0}rebuild(){for(let e of(this._keys.length=0,Object.keys(this)))"_"!==e[0]&&this._keys.push(e);if(this._externalProperties)for(let e in this._externalProperties)-1===this._keys.indexOf(e)&&this._keys.push(e)}isEqual(e){if(this._keys.length!==e._keys.length)return!1;for(let t=0;t<this._keys.length;t++){let i=this._keys[t];if(this[i]!==e[i])return!1}return!0}cloneTo(e){this._keys.length!==e._keys.length&&(e._keys=this._keys.slice(0));for(let t=0;t<this._keys.length;t++){let i=this._keys[t];e[i]=this[i]}}reset(){for(let e of this._keys)this._setDefaultValue(e)}_setDefaultValue(e){let t=this._externalProperties?.[e]?.type??typeof this[e],i=this._externalProperties?.[e]?.default;switch(t){case"number":this[e]=i??0;break;case"string":this[e]=i??"";break;default:this[e]=i??!1}}toString(){let e="";for(let t=0;t<this._keys.length;t++){let i=this._keys[t],r=this[i];switch(typeof r){case"number":case"string":e+="#define "+i+" "+r+"\n";break;default:r&&(e+="#define "+i+"\n")}}return e}}function d(e){return class extends e{constructor(){super(...arguments),this.IMAGEPROCESSING=!1,this.VIGNETTE=!1,this.VIGNETTEBLENDMODEMULTIPLY=!1,this.VIGNETTEBLENDMODEOPAQUE=!1,this.TONEMAPPING=0,this.CONTRAST=!1,this.COLORCURVES=!1,this.COLORGRADING=!1,this.COLORGRADING3D=!1,this.SAMPLER3DGREENDEPTH=!1,this.SAMPLER3DBGRMAP=!1,this.DITHER=!1,this.IMAGEPROCESSINGPOSTPROCESS=!1,this.SKIPFINALCOLORCLAMP=!1,this.EXPOSURE=!1}}}var _=e.i(46862),p=e.i(23507),c=e.i(22369),f=e.i(33457),T=e.i(31278),m=e.i(74596),E=e.i(12423);let g=RegExp("^([gimus]+)!");class P{constructor(e){this._plugins=[],this._activePlugins=[],this._activePluginsForExtraEvents=[],this._material=e,this._scene=e.getScene(),this._engine=this._scene.getEngine()}_addPlugin(e){for(let t=0;t<this._plugins.length;++t)if(this._plugins[t].name===e.name)return!1;if(this._material._uniformBufferLayoutBuilt&&(this._material.resetDrawCache(),this._material._createUniformBuffer()),!e.isCompatible(this._material.shaderLanguage))throw`The plugin "${e.name}" can't be added to the material "${this._material.name}" because the plugin is not compatible with the shader language of the material.`;let t=e.getClassName();P._MaterialPluginClassToMainDefine[t]||(P._MaterialPluginClassToMainDefine[t]="MATERIALPLUGIN_"+ ++P._MaterialPluginCounter),this._material._callbackPluginEventGeneric=(e,t)=>this._handlePluginEvent(e,t),this._plugins.push(e),this._plugins.sort((e,t)=>e.priority-t.priority),this._codeInjectionPoints={};let i={};for(let e of(i[P._MaterialPluginClassToMainDefine[t]]={type:"boolean",default:!0},this._plugins))e.collectDefines(i),this._collectPointNames("vertex",e.getCustomCode("vertex",this._material.shaderLanguage)),this._collectPointNames("fragment",e.getCustomCode("fragment",this._material.shaderLanguage));return this._defineNamesFromPlugins=i,!0}_activatePlugin(e){-1===this._activePlugins.indexOf(e)&&(this._activePlugins.push(e),this._activePlugins.sort((e,t)=>e.priority-t.priority),this._material._callbackPluginEventIsReadyForSubMesh=this._handlePluginEventIsReadyForSubMesh.bind(this),this._material._callbackPluginEventPrepareDefinesBeforeAttributes=this._handlePluginEventPrepareDefinesBeforeAttributes.bind(this),this._material._callbackPluginEventPrepareDefines=this._handlePluginEventPrepareDefines.bind(this),this._material._callbackPluginEventBindForSubMesh=this._handlePluginEventBindForSubMesh.bind(this),e.registerForExtraEvents&&(this._activePluginsForExtraEvents.push(e),this._activePluginsForExtraEvents.sort((e,t)=>e.priority-t.priority),this._material._callbackPluginEventHasRenderTargetTextures=this._handlePluginEventHasRenderTargetTextures.bind(this),this._material._callbackPluginEventFillRenderTargetTextures=this._handlePluginEventFillRenderTargetTextures.bind(this),this._material._callbackPluginEventHardBindForSubMesh=this._handlePluginEventHardBindForSubMesh.bind(this)))}getPlugin(e){for(let t=0;t<this._plugins.length;++t)if(this._plugins[t].name===e)return this._plugins[t];return null}_handlePluginEventIsReadyForSubMesh(e){let t=!0;for(let i of this._activePlugins)t=t&&i.isReadyForSubMesh(e.defines,this._scene,this._engine,e.subMesh);e.isReadyForSubMesh=t}_handlePluginEventPrepareDefinesBeforeAttributes(e){for(let t of this._activePlugins)t.prepareDefinesBeforeAttributes(e.defines,this._scene,e.mesh)}_handlePluginEventPrepareDefines(e){for(let t of this._activePlugins)t.prepareDefines(e.defines,this._scene,e.mesh)}_handlePluginEventHardBindForSubMesh(e){for(let t of this._activePluginsForExtraEvents)t.hardBindForSubMesh(this._material._uniformBuffer,this._scene,this._engine,e.subMesh)}_handlePluginEventBindForSubMesh(e){for(let t of this._activePlugins)t.bindForSubMesh(this._material._uniformBuffer,this._scene,this._engine,e.subMesh)}_handlePluginEventHasRenderTargetTextures(e){let t=!1;for(let e of this._activePluginsForExtraEvents)if(t=e.hasRenderTargetTextures())break;e.hasRenderTargetTextures=t}_handlePluginEventFillRenderTargetTextures(e){for(let t of this._activePluginsForExtraEvents)t.fillRenderTargetTextures(e.renderTargets)}_handlePluginEvent(e,t){switch(e){case 512:for(let e of this._activePlugins)e.getActiveTextures(t.activeTextures);break;case 256:for(let e of this._activePlugins)e.getAnimatables(t.animatables);break;case 1024:{let e=!1;for(let i of this._activePlugins)if(e=i.hasTexture(t.texture))break;t.hasTexture=e;break}case 2:for(let e of this._plugins)e.dispose(t.forceDisposeTextures);break;case 4:t.defineNames=this._defineNamesFromPlugins;break;case 128:for(let e of this._activePlugins)t.fallbackRank=e.addFallbacks(t.defines,t.fallbacks,t.fallbackRank),e.getAttributes(t.attributes,this._scene,t.mesh);this._uniformList.length>0&&t.uniforms.push(...this._uniformList),this._samplerList.length>0&&t.samplers.push(...this._samplerList),this._uboList.length>0&&t.uniformBuffersNames.push(...this._uboList),t.customCode=this._injectCustomCode(t,t.customCode);break;case 8:{this._uboDeclaration="",this._vertexDeclaration="",this._fragmentDeclaration="",this._uniformList=[],this._samplerList=[],this._uboList=[];let e=1===this._material.shaderLanguage;for(let i of this._plugins){let r=i.getUniforms(this._material.shaderLanguage);if(r){if(r.ubo)for(let i of r.ubo){if(i.size&&i.type){let r=i.arraySize??0;if(t.ubo.addUniform(i.name,i.size,r),e){let e;switch(i.type){case"mat4":e="mat4x4f";break;case"float":e="f32";break;default:e=`${i.type}f`}r>0?this._uboDeclaration+=`uniform ${i.name}: array<${e}, ${r}>;
2
+ `:this._uboDeclaration+=`uniform ${i.name}: ${e};
3
+ `}else this._uboDeclaration+=`${i.type} ${i.name}${r>0?`[${r}]`:""};
4
+ `}this._uniformList.push(i.name)}r.vertex&&(this._vertexDeclaration+=r.vertex+"\n"),r.fragment&&(this._fragmentDeclaration+=r.fragment+"\n"),r.externalUniforms&&this._uniformList.push(...r.externalUniforms)}i.getSamplers(this._samplerList),i.getUniformBuffersNames(this._uboList)}}}}_collectPointNames(e,t){if(t)for(let i in t)this._codeInjectionPoints[e]||(this._codeInjectionPoints[e]={}),this._codeInjectionPoints[e][i]=!0}_injectCustomCode(e,t){return(i,r)=>{t&&(r=t(i,r)),this._uboDeclaration&&(r=r.replace("#define ADDITIONAL_UBO_DECLARATION",this._uboDeclaration)),this._vertexDeclaration&&(r=r.replace("#define ADDITIONAL_VERTEX_DECLARATION",this._vertexDeclaration)),this._fragmentDeclaration&&(r=r.replace("#define ADDITIONAL_FRAGMENT_DECLARATION",this._fragmentDeclaration));let s=this._codeInjectionPoints?.[i];if(!s)return r;let a=null;for(let t in s){let s="";for(let r of this._activePlugins){let n=this._material.shaderLanguage,o=r.getCustomCode(i,n)?.[t];o&&(r.resolveIncludes&&(null===a&&(a={defines:[],indexParameters:e.indexParameters,isFragment:!1,shouldUseHighPrecisionShader:this._engine._shouldUseHighPrecisionShader,processor:void 0,supportsUniformBuffers:this._engine.supportsUniformBuffers,shadersRepository:E.ShaderStore.GetShadersRepository(n),includesShadersStore:E.ShaderStore.GetIncludesShadersStore(n),version:void 0,platformName:this._engine.shaderPlatformName,processingContext:void 0,isNDCHalfZRange:this._engine.isNDCHalfZRange,useReverseDepthBuffer:this._engine.useReverseDepthBuffer,processCodeAfterIncludes:void 0}),a.isFragment="fragment"===i,(0,m.ProcessIncludes)(o,a,e=>o=e)),s+=o+"\n")}if(s.length>0)if("!"===t.charAt(0)){t=t.substring(1);let e="g";if("!"===t.charAt(0))e="",t=t.substring(1);else{let i=g.exec(t);i&&i.length>=2&&(e=i[1],t=t.substring(e.length+1))}0>e.indexOf("g")&&(e+="g");let i=r,a=new RegExp(t,e),n=a.exec(i);for(;null!==n;){let e=s;for(let t=0;t<n.length;++t)e=e.replace("$"+t,n[t]);r=r.replace(n[0],e),n=a.exec(i)}}else{let e="#define "+t;r=r.replace(e,"\n"+s+"\n"+e)}}return r}}}P._MaterialPluginClassToMainDefine={},P._MaterialPluginCounter=0;var A=e.i(80871);class x{isCompatible(e){return 0===e}_enable(e){e&&this._pluginManager._activatePlugin(this)}constructor(e,t,i,r,s=!0,a=!1,n=!1){this.priority=500,this.resolveIncludes=!1,this.registerForExtraEvents=!1,this.doNotSerialize=!1,this._material=e,this.name=t,this.priority=i,this.resolveIncludes=n,e.pluginManager||(e.pluginManager=new P(e),e.onDisposeObservable.add(()=>{e.pluginManager=void 0})),this._pluginDefineNames=r,this._pluginManager=e.pluginManager,s&&this._pluginManager._addPlugin(this),a&&this._enable(!0),this.markAllDefinesAsDirty=e._dirtyCallbacks[127]}getClassName(){return"MaterialPluginBase"}isReadyForSubMesh(e,t,i,r){return!0}hardBindForSubMesh(e,t,i,r){}bindForSubMesh(e,t,i,r){}dispose(e){}getCustomCode(e,t=0){return null}collectDefines(e){if(this._pluginDefineNames)for(let t of Object.keys(this._pluginDefineNames)){if("_"===t[0])continue;let i=typeof this._pluginDefineNames[t];e[t]={type:"number"===i?"number":"string"===i?"string":"boolean"===i?"boolean":"object",default:this._pluginDefineNames[t]}}}prepareDefinesBeforeAttributes(e,t,i){}prepareDefines(e,t,i){}hasTexture(e){return!1}hasRenderTargetTextures(){return!1}fillRenderTargetTextures(e){}getActiveTextures(e){}getAnimatables(e){}addFallbacks(e,t,i){return i}getSamplers(e){}getAttributes(e,t,i){}getUniformBuffersNames(e){}getUniforms(e=0){return{}}copyTo(e){A.SerializationHelper.Clone(()=>e,this)}serialize(){return A.SerializationHelper.Serialize(this)}parse(e,t,i){A.SerializationHelper.Parse(()=>this,e,t,i)}}(0,r.__decorate)([(0,s.serialize)()],x.prototype,"name",void 0),(0,r.__decorate)([(0,s.serialize)()],x.prototype,"priority",void 0),(0,r.__decorate)([(0,s.serialize)()],x.prototype,"resolveIncludes",void 0),(0,r.__decorate)([(0,s.serialize)()],x.prototype,"registerForExtraEvents",void 0);var S=e.i(97001);class R extends h{constructor(){super(...arguments),this.DETAIL=!1,this.DETAILDIRECTUV=0,this.DETAIL_NORMALBLENDMETHOD=0}}class I extends x{_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"DetailMap",140,new R,t),this._texture=null,this.diffuseBlendLevel=1,this.roughnessBlendLevel=1,this.bumpLevel=1,this._normalBlendMethod=p.Material.MATERIAL_NORMALBLENDMETHOD_WHITEOUT,this._isEnabled=!1,this.isEnabled=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t,i){return!this._isEnabled||!e._areTexturesDirty||!t.texturesEnabled||!i.getCaps().standardDerivatives||!this._texture||!f.MaterialFlags.DetailTextureEnabled||!!this._texture.isReady()}prepareDefines(e,t){if(this._isEnabled){e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod;let i=t.getEngine();e._areTexturesDirty&&(i.getCaps().standardDerivatives&&this._texture&&f.MaterialFlags.DetailTextureEnabled&&this._isEnabled?((0,S.PrepareDefinesForMergedUV)(this._texture,e,"DETAIL"),e.DETAIL_NORMALBLENDMETHOD=this._normalBlendMethod):e.DETAIL=!1)}else e.DETAIL=!1}bindForSubMesh(e,t){if(!this._isEnabled)return;let i=this._material.isFrozen;e.useUbo&&i&&e.isSync||!this._texture||!f.MaterialFlags.DetailTextureEnabled||(e.updateFloat4("vDetailInfos",this._texture.coordinatesIndex,this.diffuseBlendLevel,this.bumpLevel,this.roughnessBlendLevel),(0,S.BindTextureMatrix)(this._texture,e,"detail")),t.texturesEnabled&&this._texture&&f.MaterialFlags.DetailTextureEnabled&&e.setTexture("detailSampler",this._texture)}hasTexture(e){return this._texture===e}getActiveTextures(e){this._texture&&e.push(this._texture)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)}dispose(e){e&&this._texture?.dispose()}getClassName(){return"DetailMapConfiguration"}getSamplers(e){e.push("detailSampler")}getUniforms(){return{ubo:[{name:"vDetailInfos",size:4,type:"vec4"},{name:"detailMatrix",size:16,type:"mat4"}]}}}(0,r.__decorate)([(0,s.serializeAsTexture)("detailTexture"),(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],I.prototype,"texture",void 0),(0,r.__decorate)([(0,s.serialize)()],I.prototype,"diffuseBlendLevel",void 0),(0,r.__decorate)([(0,s.serialize)()],I.prototype,"roughnessBlendLevel",void 0),(0,r.__decorate)([(0,s.serialize)()],I.prototype,"bumpLevel",void 0),(0,r.__decorate)([(0,s.serialize)(),(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],I.prototype,"normalBlendMethod",void 0),(0,r.__decorate)([(0,s.serialize)(),(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],I.prototype,"isEnabled",void 0);var b=e.i(92040),v=e.i(12033),C=e.i(96265);(t=i||(i={}))[t.Zero=0]="Zero",t[t.One=1]="One",t[t.MaxViewZ=2]="MaxViewZ",t[t.NoClear=3]="NoClear";class M{static CreateConfiguration(e){return M._Configurations[e]={defines:{},previousWorldMatrices:{},previousViewProjection:C.Matrix.Zero(),currentViewProjection:C.Matrix.Zero(),previousBones:{},lastUpdateFrameId:-1,excludedSkinnedMesh:[],reverseCulling:!1},M._Configurations[e]}static DeleteConfiguration(e){delete M._Configurations[e]}static GetConfiguration(e){return M._Configurations[e]}static AddUniformsAndSamplers(e,t){e.push("previousWorld","previousViewProjection","mPreviousBones")}static MarkAsDirty(e,t){for(let i of t)if(i.subMeshes)for(let t of i.subMeshes)t._removeDrawWrapper(e)}static PrepareDefines(e,t,i){if(!i._arePrePassDirty)return;let r=M._Configurations[e];if(!r)return;i.PREPASS=!0;let s=0;for(let e=0;e<M.GeometryTextureDescriptions.length;e++){let t=M.GeometryTextureDescriptions[e],a=t.define,n=t.defineIndex,o=r.defines[n];void 0!==o?(i[a]=!0,i[n]=o,s++):(i[a]=!1,delete i[n])}i.SCENE_MRT_COUNT=s,i.BONES_VELOCITY_ENABLED=t.useBones&&t.computeBonesUsingShaders&&t.skeleton&&!t.skeleton.isUsingTextureForMatrices&&-1===r.excludedSkinnedMesh.indexOf(t)}static Bind(e,t,i,r,s){let a=M._Configurations[e];if(!a)return;let n=i.getScene(),o=n.getEngine();if(a.reverseCulling&&o.setStateCullFaceType(n._mirroredCameraPosition?s.cullBackFaces:!s.cullBackFaces),(void 0!==a.defines.PREPASS_VELOCITY_INDEX||void 0!==a.defines.PREPASS_VELOCITY_LINEAR_INDEX)&&(a.previousWorldMatrices[i.uniqueId]||(a.previousWorldMatrices[i.uniqueId]=r.clone()),a.previousViewProjection||(a.previousViewProjection=n.getTransformMatrix().clone(),a.currentViewProjection=n.getTransformMatrix().clone()),a.currentViewProjection.updateFlag!==n.getTransformMatrix().updateFlag?(a.lastUpdateFrameId=o.frameId,a.previousViewProjection.copyFrom(a.currentViewProjection),a.currentViewProjection.copyFrom(n.getTransformMatrix())):a.lastUpdateFrameId!==o.frameId&&(a.lastUpdateFrameId=o.frameId,a.previousViewProjection.copyFrom(a.currentViewProjection)),t.setMatrix("previousWorld",a.previousWorldMatrices[i.uniqueId]),t.setMatrix("previousViewProjection",a.previousViewProjection),a.previousWorldMatrices[i.uniqueId]=r.clone(),i.useBones&&i.computeBonesUsingShaders&&i.skeleton)){let e=i.skeleton;if(!e.isUsingTextureForMatrices||-1===t.getUniformIndex("boneTextureInfo")){let r=e.getTransformMatrices(i);r&&(a.previousBones[i.uniqueId]||(a.previousBones[i.uniqueId]=r.slice()),t.setMatrices("mPreviousBones",a.previousBones[i.uniqueId]),a.previousBones[i.uniqueId].set(r))}}}}function L(e){return class extends e{constructor(){super(...arguments),this.MAINUV1=!1,this.MAINUV2=!1,this.MAINUV3=!1,this.MAINUV4=!1,this.MAINUV5=!1,this.MAINUV6=!1,this.UV1=!1,this.UV2=!1,this.UV3=!1,this.UV4=!1,this.UV5=!1,this.UV6=!1}}}function y(e){return class extends e{constructor(){super(...arguments),this.PREPASS=!1,this.PREPASS_COLOR=!1,this.PREPASS_COLOR_INDEX=-1,this.PREPASS_IRRADIANCE_LEGACY=!1,this.PREPASS_IRRADIANCE_LEGACY_INDEX=-1,this.PREPASS_IRRADIANCE=!1,this.PREPASS_IRRADIANCE_INDEX=-1,this.PREPASS_ALBEDO=!1,this.PREPASS_ALBEDO_INDEX=-1,this.PREPASS_ALBEDO_SQRT=!1,this.PREPASS_ALBEDO_SQRT_INDEX=-1,this.PREPASS_DEPTH=!1,this.PREPASS_DEPTH_INDEX=-1,this.PREPASS_SCREENSPACE_DEPTH=!1,this.PREPASS_SCREENSPACE_DEPTH_INDEX=-1,this.PREPASS_NORMALIZED_VIEW_DEPTH=!1,this.PREPASS_NORMALIZED_VIEW_DEPTH_INDEX=-1,this.PREPASS_NORMAL=!1,this.PREPASS_NORMAL_INDEX=-1,this.PREPASS_NORMAL_WORLDSPACE=!1,this.PREPASS_WORLD_NORMAL=!1,this.PREPASS_WORLD_NORMAL_INDEX=-1,this.PREPASS_POSITION=!1,this.PREPASS_POSITION_INDEX=-1,this.PREPASS_LOCAL_POSITION=!1,this.PREPASS_LOCAL_POSITION_INDEX=-1,this.PREPASS_VELOCITY=!1,this.PREPASS_VELOCITY_INDEX=-1,this.PREPASS_VELOCITY_LINEAR=!1,this.PREPASS_VELOCITY_LINEAR_INDEX=-1,this.PREPASS_REFLECTIVITY=!1,this.PREPASS_REFLECTIVITY_INDEX=-1,this.SCENE_MRT_COUNT=0}}}function D(e){return class extends e{constructor(...e){super(...e),(0,s.serializeAsImageProcessingConfiguration)()(this,"_imageProcessingConfiguration")}get imageProcessingConfiguration(){return this._imageProcessingConfiguration}set imageProcessingConfiguration(e){this._attachImageProcessingConfiguration(e),this._markAllSubMeshesAsImageProcessingDirty&&this._markAllSubMeshesAsImageProcessingDirty()}_attachImageProcessingConfiguration(e){e!==this._imageProcessingConfiguration&&(this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),!e&&this.getScene?this._imageProcessingConfiguration=this.getScene().imageProcessingConfiguration:e&&(this._imageProcessingConfiguration=e),this._imageProcessingConfiguration&&(this._imageProcessingObserver=this._imageProcessingConfiguration.onUpdateParameters.add(()=>{this._markAllSubMeshesAsImageProcessingDirty&&this._markAllSubMeshesAsImageProcessingDirty()})))}get cameraColorCurvesEnabled(){return this.imageProcessingConfiguration.colorCurvesEnabled}set cameraColorCurvesEnabled(e){this.imageProcessingConfiguration.colorCurvesEnabled=e}get cameraColorGradingEnabled(){return this.imageProcessingConfiguration.colorGradingEnabled}set cameraColorGradingEnabled(e){this.imageProcessingConfiguration.colorGradingEnabled=e}get cameraToneMappingEnabled(){return this._imageProcessingConfiguration.toneMappingEnabled}set cameraToneMappingEnabled(e){this._imageProcessingConfiguration.toneMappingEnabled=e}get cameraExposure(){return this._imageProcessingConfiguration.exposure}set cameraExposure(e){this._imageProcessingConfiguration.exposure=e}get cameraContrast(){return this._imageProcessingConfiguration.contrast}set cameraContrast(e){this._imageProcessingConfiguration.contrast=e}get cameraColorGradingTexture(){return this._imageProcessingConfiguration.colorGradingTexture}set cameraColorGradingTexture(e){this._imageProcessingConfiguration.colorGradingTexture=e}get cameraColorCurves(){return this._imageProcessingConfiguration.colorCurves}set cameraColorCurves(e){this._imageProcessingConfiguration.colorCurves=e}}}M.GeometryTextureDescriptions=[{type:0,name:"IrradianceLegacy",clearType:0,define:"PREPASS_IRRADIANCE_LEGACY",defineIndex:"PREPASS_IRRADIANCE_LEGACY_INDEX"},{type:1,name:"WorldPosition",clearType:0,define:"PREPASS_POSITION",defineIndex:"PREPASS_POSITION_INDEX"},{type:2,name:"Velocity",clearType:0,define:"PREPASS_VELOCITY",defineIndex:"PREPASS_VELOCITY_INDEX"},{type:3,name:"Reflectivity",clearType:0,define:"PREPASS_REFLECTIVITY",defineIndex:"PREPASS_REFLECTIVITY_INDEX"},{type:5,name:"ViewDepth",clearType:2,define:"PREPASS_DEPTH",defineIndex:"PREPASS_DEPTH_INDEX"},{type:6,name:"ViewNormal",clearType:0,define:"PREPASS_NORMAL",defineIndex:"PREPASS_NORMAL_INDEX"},{type:7,name:"AlbedoSqrt",clearType:0,define:"PREPASS_ALBEDO_SQRT",defineIndex:"PREPASS_ALBEDO_SQRT_INDEX"},{type:8,name:"WorldNormal",clearType:0,define:"PREPASS_WORLD_NORMAL",defineIndex:"PREPASS_WORLD_NORMAL_INDEX"},{type:9,name:"LocalPosition",clearType:0,define:"PREPASS_LOCAL_POSITION",defineIndex:"PREPASS_LOCAL_POSITION_INDEX"},{type:10,name:"ScreenDepth",clearType:1,define:"PREPASS_SCREENSPACE_DEPTH",defineIndex:"PREPASS_SCREENSPACE_DEPTH_INDEX"},{type:11,name:"LinearVelocity",clearType:0,define:"PREPASS_VELOCITY_LINEAR",defineIndex:"PREPASS_VELOCITY_LINEAR_INDEX"},{type:12,name:"Albedo",clearType:0,define:"PREPASS_ALBEDO",defineIndex:"PREPASS_ALBEDO_INDEX"},{type:13,name:"NormalizedViewDepth",clearType:1,define:"PREPASS_NORMALIZED_VIEW_DEPTH",defineIndex:"PREPASS_NORMALIZED_VIEW_DEPTH_INDEX"},{type:4,name:"Color",clearType:3,define:"PREPASS_COLOR",defineIndex:"PREPASS_COLOR_INDEX"},{type:14,name:"Irradiance",clearType:0,define:"PREPASS_IRRADIANCE",defineIndex:"PREPASS_IRRADIANCE_INDEX"}],M._Configurations={};var F=e.i(77052),N=e.i(75405);let O={effect:null,subMesh:null};class U extends y(L(h)){}class B extends d(U){constructor(e){super(e),this.DIFFUSE=!1,this.DIFFUSEDIRECTUV=0,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.AMBIENT=!1,this.AMBIENTDIRECTUV=0,this.OPACITY=!1,this.OPACITYDIRECTUV=0,this.OPACITYRGB=!1,this.REFLECTION=!1,this.EMISSIVE=!1,this.EMISSIVEDIRECTUV=0,this.SPECULAR=!1,this.SPECULARDIRECTUV=0,this.BUMP=!1,this.BUMPDIRECTUV=0,this.PARALLAX=!1,this.PARALLAX_RHS=!1,this.PARALLAXOCCLUSION=!1,this.SPECULAROVERALPHA=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHAFROMDIFFUSE=!1,this.POINTSIZE=!1,this.FOG=!1,this.SPECULARTERM=!1,this.DIFFUSEFRESNEL=!1,this.OPACITYFRESNEL=!1,this.REFLECTIONFRESNEL=!1,this.REFRACTIONFRESNEL=!1,this.EMISSIVEFRESNEL=!1,this.FRESNEL=!1,this.NORMAL=!1,this.TANGENT=!1,this.VERTEXCOLOR=!1,this.VERTEXALPHA=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.GLOSSINESS=!1,this.ROUGHNESS=!1,this.EMISSIVEASILLUMINATION=!1,this.LINKEMISSIVEWITHDIFFUSE=!1,this.REFLECTIONFRESNELFROMSPECULAR=!1,this.LIGHTMAP=!1,this.LIGHTMAPDIRECTUV=0,this.OBJECTSPACE_NORMALMAP=!1,this.USELIGHTMAPASSHADOWMAP=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFRACTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.INVERTCUBICMAP=!1,this.LOGARITHMICDEPTH=!1,this.REFRACTION=!1,this.REFRACTIONMAP_3D=!1,this.REFLECTIONOVERALPHA=!1,this.TWOSIDEDLIGHTING=!1,this.SHADOWFLOAT=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.NONUNIFORMSCALING=!1,this.PREMULTIPLYALPHA=!1,this.ALPHATEST_AFTERALLALPHACOMPUTATIONS=!1,this.ALPHABLEND=!0,this.RGBDLIGHTMAP=!1,this.RGBDREFLECTION=!1,this.RGBDREFRACTION=!1,this.MULTIVIEW=!1,this.ORDER_INDEPENDENT_TRANSPARENCY=!1,this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.USE_VERTEX_PULLING=!1,this.VERTEX_PULLING_USE_INDEX_BUFFER=!1,this.VERTEX_PULLING_INDEX_BUFFER_32BITS=!1,this.RIGHT_HANDED=!1,this.CLUSTLIGHT_SLICES=0,this.CLUSTLIGHT_BATCH=0,this.IS_REFLECTION_LINEAR=!1,this.IS_REFRACTION_LINEAR=!1,this.DECAL_AFTER_DETAIL=!1,this.TEXTURE_REPETITION_MODE=0,this.rebuild()}}class k extends D(c.PushMaterial){}class V extends k{get isPrePassCapable(){return!this.disableDepthWrite}get canRenderToMRT(){return!0}constructor(e,t,i=!1){super(e,t,void 0,i||V.ForceGLSL),this._diffuseTexture=null,this._ambientTexture=null,this._opacityTexture=null,this._reflectionTexture=null,this._emissiveTexture=null,this._specularTexture=null,this._bumpTexture=null,this._lightmapTexture=null,this._refractionTexture=null,this.ambientColor=new o.Color3(0,0,0),this.diffuseColor=new o.Color3(1,1,1),this.specularColor=new o.Color3(1,1,1),this.emissiveColor=new o.Color3(0,0,0),this.specularPower=64,this._useAlphaFromDiffuseTexture=!1,this._useEmissiveAsIllumination=!1,this._linkEmissiveWithDiffuse=!1,this._useSpecularOverAlpha=!1,this._useReflectionOverAlpha=!1,this._disableLighting=!1,this._useObjectSpaceNormalMap=!1,this._useParallax=!1,this._useParallaxOcclusion=!1,this.parallaxScaleBias=.05,this._roughness=0,this.indexOfRefraction=.98,this.invertRefractionY=!0,this.alphaCutOff=.4,this._useLightmapAsShadowmap=!1,this._useReflectionFresnelFromSpecular=!1,this._useGlossinessFromSpecularMapAlpha=!1,this._maxSimultaneousLights=4,this._invertNormalMapX=!1,this._invertNormalMapY=!1,this._twoSidedLighting=!1,this._applyDecalMapAfterDetailMap=!1,this._shadersLoaded=!1,this._vertexPullingMetadata=null,this._renderTargets=new a.SmartArray(16),this._globalAmbientColor=new o.Color3(0,0,0),this._cacheHasRenderTargetTextures=!1,this.detailMap=new I(this),this._attachImageProcessingConfiguration(null),this.prePassConfiguration=new u,this.getRenderTargetTextures=()=>(this._renderTargets.reset(),V.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),V.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&this._renderTargets.push(this._refractionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets)}get hasRenderTargetTextures(){return!!V.ReflectionTextureEnabled&&!!this._reflectionTexture&&!!this._reflectionTexture.isRenderTarget||!!V.RefractionTextureEnabled&&!!this._refractionTexture&&!!this._refractionTexture.isRenderTarget||this._cacheHasRenderTargetTextures}getClassName(){return"StandardMaterial"}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:!this._disableAlphaBlending&&(this.alpha<1||null!=this._opacityTexture||this._shouldUseAlphaFromDiffuseTexture()||this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled)}needAlphaTesting(){return this._hasTransparencyMode?this._transparencyModeIsTest:this._hasAlphaChannel()&&(null==this._transparencyMode||this._transparencyMode===p.Material.MATERIAL_ALPHATEST)}_shouldUseAlphaFromDiffuseTexture(){return null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha&&this._useAlphaFromDiffuseTexture&&this._transparencyMode!==p.Material.MATERIAL_OPAQUE}_hasAlphaChannel(){return null!=this._diffuseTexture&&this._diffuseTexture.hasAlpha||null!=this._opacityTexture}getAlphaTestTexture(){return this._diffuseTexture}isReadyForSubMesh(t,i,r=!1){this._uniformBufferLayoutBuilt||this.buildUniformLayout();let s=i._drawWrapper;if(s.effect&&this.isFrozen&&s._wasPreviouslyReady&&s._wasPreviouslyUsingInstances===r)return!0;i.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),i.materialDefines=new B(this._eventInfo.defineNames));let a=this.getScene(),n=i.materialDefines;if(this._isReadyForSubMesh(i))return!0;let o=a.getEngine();if(n._needNormals=(0,S.PrepareDefinesForLights)(a,t,n,!0,this._maxSimultaneousLights,this._disableLighting),!(0,S.AreLightsTexturesReady)(a,t,this._maxSimultaneousLights,this._disableLighting))return!1;(0,S.PrepareDefinesForMultiview)(a,n);let h=this.needAlphaBlendingForMesh(t)&&this.getScene().useOrderIndependentTransparency;if((0,S.PrepareDefinesForPrePass)(a,n,this.canRenderToMRT&&!h),(0,S.PrepareDefinesForOIT)(a,n,h),M.PrepareDefines(o.currentRenderPassId,t,n),n._areTexturesDirty){this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,n._needUVs=!1;for(let e=1;e<=6;++e)n["MAINUV"+e]=!1;if(a.texturesEnabled){if(n.DIFFUSEDIRECTUV=0,n.BUMPDIRECTUV=0,n.AMBIENTDIRECTUV=0,n.OPACITYDIRECTUV=0,n.EMISSIVEDIRECTUV=0,n.SPECULARDIRECTUV=0,n.LIGHTMAPDIRECTUV=0,this._diffuseTexture&&V.DiffuseTextureEnabled)if(!this._diffuseTexture.isReadyOrNotBlocking())return!1;else(0,S.PrepareDefinesForMergedUV)(this._diffuseTexture,n,"DIFFUSE");else n.DIFFUSE=!1;if(this._ambientTexture&&V.AmbientTextureEnabled)if(!this._ambientTexture.isReadyOrNotBlocking())return!1;else(0,S.PrepareDefinesForMergedUV)(this._ambientTexture,n,"AMBIENT");else n.AMBIENT=!1;if(this._opacityTexture&&V.OpacityTextureEnabled)if(!this._opacityTexture.isReadyOrNotBlocking())return!1;else(0,S.PrepareDefinesForMergedUV)(this._opacityTexture,n,"OPACITY"),n.OPACITYRGB=this._opacityTexture.getAlphaFromRGB;else n.OPACITY=!1;if(this._reflectionTexture&&V.ReflectionTextureEnabled?(n.ROUGHNESS=this._roughness>0,n.REFLECTIONOVERALPHA=this._useReflectionOverAlpha):(n.ROUGHNESS=!1,n.REFLECTIONOVERALPHA=!1),!(0,S.PrepareDefinesForIBL)(a,this._reflectionTexture,n))return!1;if(this._emissiveTexture&&V.EmissiveTextureEnabled)if(!this._emissiveTexture.isReadyOrNotBlocking())return!1;else(0,S.PrepareDefinesForMergedUV)(this._emissiveTexture,n,"EMISSIVE");else n.EMISSIVE=!1;if(this._lightmapTexture&&V.LightmapTextureEnabled)if(!this._lightmapTexture.isReadyOrNotBlocking())return!1;else(0,S.PrepareDefinesForMergedUV)(this._lightmapTexture,n,"LIGHTMAP"),n.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,n.RGBDLIGHTMAP=this._lightmapTexture.isRGBD;else n.LIGHTMAP=!1;if(this._specularTexture&&V.SpecularTextureEnabled)if(!this._specularTexture.isReadyOrNotBlocking())return!1;else(0,S.PrepareDefinesForMergedUV)(this._specularTexture,n,"SPECULAR"),n.GLOSSINESS=this._useGlossinessFromSpecularMapAlpha;else n.SPECULAR=!1;if(a.getEngine().getCaps().standardDerivatives&&this._bumpTexture&&V.BumpTextureEnabled){if(!this._bumpTexture.isReady())return!1;(0,S.PrepareDefinesForMergedUV)(this._bumpTexture,n,"BUMP"),n.PARALLAX=this._useParallax,n.PARALLAX_RHS=a.useRightHandedSystem,n.PARALLAXOCCLUSION=this._useParallaxOcclusion,n.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap}else n.BUMP=!1,n.PARALLAX=!1,n.PARALLAX_RHS=!1,n.PARALLAXOCCLUSION=!1;if(this._refractionTexture&&V.RefractionTextureEnabled)if(!this._refractionTexture.isReadyOrNotBlocking())return!1;else n._needUVs=!0,n.REFRACTION=!0,n.REFRACTIONMAP_3D=this._refractionTexture.isCube,n.RGBDREFRACTION=this._refractionTexture.isRGBD,n.USE_LOCAL_REFRACTIONMAP_CUBIC=!!this._refractionTexture.boundingBoxSize;else n.REFRACTION=!1;n.TWOSIDEDLIGHTING=!this._backFaceCulling&&this._twoSidedLighting}else n.DIFFUSE=!1,n.AMBIENT=!1,n.OPACITY=!1,n.REFLECTION=!1,n.EMISSIVE=!1,n.LIGHTMAP=!1,n.BUMP=!1,n.REFRACTION=!1;n.ALPHAFROMDIFFUSE=this._shouldUseAlphaFromDiffuseTexture(),n.EMISSIVEASILLUMINATION=this._useEmissiveAsIllumination,n.LINKEMISSIVEWITHDIFFUSE=this._linkEmissiveWithDiffuse,n.SPECULAROVERALPHA=this._useSpecularOverAlpha,n.PREMULTIPLYALPHA=7===this.alphaMode||8===this.alphaMode,n.ALPHATEST_AFTERALLALPHACOMPUTATIONS=null!==this.transparencyMode,n.ALPHABLEND=null===this.transparencyMode||this.needAlphaBlendingForMesh(t),n.TEXTURE_REPETITION_MODE=o.version>1||o.isWebGPU?this.textureRepetitionMode:0}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=n,this._eventInfo.subMesh=i,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh)return!1;if(n._areImageProcessingDirty&&this._imageProcessingConfiguration){if(!this._imageProcessingConfiguration.isReady())return!1;this._imageProcessingConfiguration.prepareDefines(n),n.IS_REFLECTION_LINEAR=null!=this.reflectionTexture&&!this.reflectionTexture.gammaSpace,n.IS_REFRACTION_LINEAR=null!=this.refractionTexture&&!this.refractionTexture.gammaSpace}if(n._areFresnelDirty&&(V.FresnelEnabled?(this._diffuseFresnelParameters||this._opacityFresnelParameters||this._emissiveFresnelParameters||this._refractionFresnelParameters||this._reflectionFresnelParameters)&&(n.DIFFUSEFRESNEL=this._diffuseFresnelParameters&&this._diffuseFresnelParameters.isEnabled,n.OPACITYFRESNEL=this._opacityFresnelParameters&&this._opacityFresnelParameters.isEnabled,n.REFLECTIONFRESNEL=this._reflectionFresnelParameters&&this._reflectionFresnelParameters.isEnabled,n.REFLECTIONFRESNELFROMSPECULAR=this._useReflectionFresnelFromSpecular,n.REFRACTIONFRESNEL=this._refractionFresnelParameters&&this._refractionFresnelParameters.isEnabled,n.EMISSIVEFRESNEL=this._emissiveFresnelParameters&&this._emissiveFresnelParameters.isEnabled,n._needNormals=!0,n.FRESNEL=!0):n.FRESNEL=!1),n.AREALIGHTUSED||n.CLUSTLIGHT_BATCH){for(let e=0;e<t.lightSources.length;e++)if(!t.lightSources[e]._isReady())return!1}(0,S.PrepareDefinesForMisc)(t,a,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(t),n,this._applyDecalMapAfterDetailMap,this._useVertexPulling,i.getRenderingMesh(),this._isVertexOutputInvariant),(0,S.PrepareDefinesForFrameBoundValues)(a,o,this,n,r,null,i.getRenderingMesh().hasThinInstances),this._eventInfo.defines=n,this._eventInfo.mesh=t,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),(0,S.PrepareDefinesForAttributes)(t,n,!0,!0,!0),this._callbackPluginEventPrepareDefines(this._eventInfo);let d=!1;if(n.isDirty){let r=n._areLightsDisposed;n.markAsProcessed();let s=new T.EffectFallbacks;n.REFLECTION&&s.addFallback(0,"REFLECTION"),n.SPECULAR&&s.addFallback(0,"SPECULAR"),n.BUMP&&s.addFallback(0,"BUMP"),n.PARALLAX&&s.addFallback(1,"PARALLAX"),n.PARALLAX_RHS&&s.addFallback(1,"PARALLAX_RHS"),n.PARALLAXOCCLUSION&&s.addFallback(0,"PARALLAXOCCLUSION"),n.SPECULAROVERALPHA&&s.addFallback(0,"SPECULAROVERALPHA"),n.FOG&&s.addFallback(1,"FOG"),n.POINTSIZE&&s.addFallback(0,"POINTSIZE"),n.LOGARITHMICDEPTH&&s.addFallback(0,"LOGARITHMICDEPTH"),(0,S.HandleFallbacksForShadows)(n,s,this._maxSimultaneousLights),n.SPECULARTERM&&s.addFallback(0,"SPECULARTERM"),n.DIFFUSEFRESNEL&&s.addFallback(1,"DIFFUSEFRESNEL"),n.OPACITYFRESNEL&&s.addFallback(2,"OPACITYFRESNEL"),n.REFLECTIONFRESNEL&&s.addFallback(3,"REFLECTIONFRESNEL"),n.EMISSIVEFRESNEL&&s.addFallback(4,"EMISSIVEFRESNEL"),n.FRESNEL&&s.addFallback(4,"FRESNEL"),n.MULTIVIEW&&s.addFallback(0,"MULTIVIEW");let h=[l.VertexBuffer.PositionKind];n.NORMAL&&h.push(l.VertexBuffer.NormalKind),n.TANGENT&&h.push(l.VertexBuffer.TangentKind);for(let e=1;e<=6;++e)n["UV"+e]&&h.push(`uv${1===e?"":e}`);n.VERTEXCOLOR&&h.push(l.VertexBuffer.ColorKind),(0,S.PrepareAttributesForBones)(h,t,n,s),(0,S.PrepareAttributesForInstances)(h,n),(0,S.PrepareAttributesForMorphTargets)(h,t,n),(0,S.PrepareAttributesForBakedVertexAnimation)(h,t,n);let p="default",c=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vDiffuseColor","vSpecularColor","vEmissiveColor","visibility","vFogInfos","vFogColor","pointSize","vDiffuseInfos","vAmbientInfos","vOpacityInfos","vEmissiveInfos","vSpecularInfos","vBumpInfos","vLightmapInfos","vRefractionInfos","mBones","diffuseMatrix","ambientMatrix","opacityMatrix","emissiveMatrix","specularMatrix","bumpMatrix","normalMatrix","lightmapMatrix","refractionMatrix","diffuseLeftColor","diffuseRightColor","opacityParts","reflectionLeftColor","reflectionRightColor","emissiveLeftColor","emissiveRightColor","refractionLeftColor","refractionRightColor","vRefractionPosition","vRefractionSize","logarithmicDepthConstant","vTangentSpaceParams","alphaCutOff","boneTextureInfo","morphTargetTextureInfo","morphTargetTextureIndices","cameraInfo","vTextureRepetitionHexTilingParams"],f=["diffuseSampler","ambientSampler","opacitySampler","reflectionCubeSampler","reflection2DSampler","emissiveSampler","specularSampler","bumpSampler","lightmapSampler","refractionCubeSampler","refraction2DSampler","boneSampler","morphTargets","oitDepthSampler","oitFrontColorSampler","areaLightsLTC1Sampler","areaLightsLTC2Sampler"];(0,S.PrepareUniformsAndSamplersForIBL)(c,f,!1);let m=["Material","Scene","Mesh"],E={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:n.NUM_MORPH_INFLUENCERS};if(this._eventInfo.fallbacks=s,this._eventInfo.fallbackRank=0,this._eventInfo.defines=n,this._eventInfo.uniforms=c,this._eventInfo.attributes=h,this._eventInfo.samplers=f,this._eventInfo.uniformBuffersNames=m,this._eventInfo.customCode=void 0,this._eventInfo.mesh=t,this._eventInfo.indexParameters=E,this._callbackPluginEventGeneric(128,this._eventInfo),M.AddUniformsAndSamplers(c,f),u.AddUniforms(c),u.AddSamplers(f),_.ImageProcessingConfiguration&&(_.ImageProcessingConfiguration.PrepareUniforms(c,n),_.ImageProcessingConfiguration.PrepareSamplers(f,n)),(0,S.PrepareUniformsAndSamplersList)({uniformsNames:c,uniformBuffersNames:m,samplers:f,defines:n,maxSimultaneousLights:this._maxSimultaneousLights,shaderLanguage:this._shaderLanguage}),(0,b.AddClipPlaneUniforms)(c),this._useVertexPulling){let e=i.getRenderingMesh(),t=e?.geometry;t&&(this._vertexPullingMetadata=(0,v.PrepareVertexPullingUniforms)(t),this._vertexPullingMetadata&&this._vertexPullingMetadata.forEach((e,t)=>{c.push(`vp_${t}_info`)}))}else this._vertexPullingMetadata=null;let g={};this.customShaderNameResolve&&(p=this.customShaderNameResolve(p,c,m,f,n,h,g));let P=n.toString(),A=i.effect,x=a.getEngine().createEffect(p,{attributes:h,uniformsNames:c,uniformBuffersNames:m,samplers:f,defines:P,fallbacks:s,onCompiled:this.onCompiled,onError:this.onError,indexParameters:E,processFinalCode:g.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:n.PREPASS,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:async()=>{1===this._shaderLanguage?await Promise.all([e.A(22649),e.A(39487)]):await Promise.all([e.A(60020),e.A(66183)]),this._shadersLoaded=!0}},o);if(this._eventInfo.customCode=void 0,x)if(this._onEffectCreatedObservable&&(O.effect=x,O.subMesh=i,this._onEffectCreatedObservable.notifyObservers(O)),this.allowShaderHotSwapping&&A&&!x.isReady()){if(n.markAsUnprocessed(),d=this.isFrozen,r)return n._areLightsDisposed=!0,!1}else a.resetCachedMaterial(),i.setEffect(x,n,this._materialContext)}return!!i.effect&&!!i.effect.isReady()&&(n._renderId=a.getRenderId(),s._wasPreviouslyReady=!d,s._wasPreviouslyUsingInstances=r,this._checkScenePerformancePriority(),!0)}buildUniformLayout(){let e=this._uniformBuffer;e.addUniform("diffuseLeftColor",4),e.addUniform("diffuseRightColor",4),e.addUniform("opacityParts",4),e.addUniform("reflectionLeftColor",4),e.addUniform("reflectionRightColor",4),e.addUniform("refractionLeftColor",4),e.addUniform("refractionRightColor",4),e.addUniform("emissiveLeftColor",4),e.addUniform("emissiveRightColor",4),e.addUniform("vDiffuseInfos",2),e.addUniform("vAmbientInfos",2),e.addUniform("vOpacityInfos",2),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vSpecularInfos",2),e.addUniform("vBumpInfos",3),e.addUniform("diffuseMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("specularMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("pointSize",1),e.addUniform("alphaCutOff",1),e.addUniform("refractionMatrix",16),e.addUniform("vRefractionInfos",4),e.addUniform("vRefractionPosition",3),e.addUniform("vRefractionSize",3),e.addUniform("vSpecularColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("vDiffuseColor",4),e.addUniform("vAmbientColor",3),e.addUniform("cameraInfo",4),e.addUniform("vTextureRepetitionHexTilingParams",4),(0,S.PrepareUniformLayoutForIBL)(e,!1,!0),super.buildUniformLayout()}bindForSubMesh(e,t,i){let r=this.getScene(),s=i.materialDefines;if(!s)return;let a=i.effect;if(!a)return;this._activeEffect=a,t.getMeshUniformBuffer().bindToEffect(a,"Mesh"),t.transferToEffect(e),this._uniformBuffer.bindToEffect(a,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,r,t,e,this.isFrozen),M.Bind(r.getEngine().currentRenderPassId,this._activeEffect,t,e,this);let l=r.activeCamera;l?this._uniformBuffer.updateFloat4("cameraInfo",l.minZ,l.maxZ,0,0):this._uniformBuffer.updateFloat4("cameraInfo",0,0,0,0);let u=this.textureRepetitionHexTilingParams;this._uniformBuffer.updateFloat4("vTextureRepetitionHexTilingParams",u[0],u[1],u[2],u[3]),this._eventInfo.subMesh=i,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),s.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));let h=this._mustRebind(r,a,i,t.visibility),d=r.getEngine()._features.needToAlwaysBindUniformBuffers;(0,S.BindBonesParameters)(t,a),this._vertexPullingMetadata&&(0,v.BindVertexPullingUniforms)(a,this._vertexPullingMetadata);let _=this._uniformBuffer;if(h){if(this.bindViewProjection(a),!_.useUbo||!this.isFrozen||!_.isSync||i._drawWrapper._forceRebindOnNextCall){if(V.FresnelEnabled&&s.FRESNEL){if(this.diffuseFresnelParameters&&this.diffuseFresnelParameters.isEnabled&&(_.updateColor4("diffuseLeftColor",this.diffuseFresnelParameters.leftColor,this.diffuseFresnelParameters.power),_.updateColor4("diffuseRightColor",this.diffuseFresnelParameters.rightColor,this.diffuseFresnelParameters.bias)),this.opacityFresnelParameters&&this.opacityFresnelParameters.isEnabled){let e=o.TmpColors.Color3[0];e.set(this.opacityFresnelParameters.leftColor.toLuminance(),this.opacityFresnelParameters.rightColor.toLuminance(),this.opacityFresnelParameters.bias),_.updateColor4("opacityParts",e,this.opacityFresnelParameters.power)}this.reflectionFresnelParameters&&this.reflectionFresnelParameters.isEnabled&&(_.updateColor4("reflectionLeftColor",this.reflectionFresnelParameters.leftColor,this.reflectionFresnelParameters.power),_.updateColor4("reflectionRightColor",this.reflectionFresnelParameters.rightColor,this.reflectionFresnelParameters.bias)),this.refractionFresnelParameters&&this.refractionFresnelParameters.isEnabled&&(_.updateColor4("refractionLeftColor",this.refractionFresnelParameters.leftColor,this.refractionFresnelParameters.power),_.updateColor4("refractionRightColor",this.refractionFresnelParameters.rightColor,this.refractionFresnelParameters.bias)),this.emissiveFresnelParameters&&this.emissiveFresnelParameters.isEnabled&&(_.updateColor4("emissiveLeftColor",this.emissiveFresnelParameters.leftColor,this.emissiveFresnelParameters.power),_.updateColor4("emissiveRightColor",this.emissiveFresnelParameters.rightColor,this.emissiveFresnelParameters.bias))}if(r.texturesEnabled&&(this._diffuseTexture&&V.DiffuseTextureEnabled&&(_.updateFloat2("vDiffuseInfos",this._diffuseTexture.coordinatesIndex,this._diffuseTexture.level),(0,S.BindTextureMatrix)(this._diffuseTexture,_,"diffuse")),this._ambientTexture&&V.AmbientTextureEnabled&&(_.updateFloat2("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level),(0,S.BindTextureMatrix)(this._ambientTexture,_,"ambient")),this._opacityTexture&&V.OpacityTextureEnabled&&(_.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),(0,S.BindTextureMatrix)(this._opacityTexture,_,"opacity")),this._hasAlphaChannel()&&_.updateFloat("alphaCutOff",this.alphaCutOff),(0,S.BindIBLParameters)(r,s,_,o.Color3.White(),this._reflectionTexture,!1,!1,!0,!1,!1,!1,this.roughness),this._reflectionTexture&&V.ReflectionTextureEnabled||_.updateFloat2("vReflectionInfos",0,this.roughness),this._emissiveTexture&&V.EmissiveTextureEnabled&&(_.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),(0,S.BindTextureMatrix)(this._emissiveTexture,_,"emissive")),this._lightmapTexture&&V.LightmapTextureEnabled&&(_.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),(0,S.BindTextureMatrix)(this._lightmapTexture,_,"lightmap")),this._specularTexture&&V.SpecularTextureEnabled&&(_.updateFloat2("vSpecularInfos",this._specularTexture.coordinatesIndex,this._specularTexture.level),(0,S.BindTextureMatrix)(this._specularTexture,_,"specular")),this._bumpTexture&&r.getEngine().getCaps().standardDerivatives&&V.BumpTextureEnabled&&(_.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,1/this._bumpTexture.level,this.parallaxScaleBias),(0,S.BindTextureMatrix)(this._bumpTexture,_,"bump"),r._mirroredCameraPosition?_.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):_.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),this._refractionTexture&&V.RefractionTextureEnabled)){let e=1;if(!this._refractionTexture.isCube&&(_.updateMatrix("refractionMatrix",this._refractionTexture.getReflectionTextureMatrix()),this._refractionTexture.depth&&(e=this._refractionTexture.depth)),_.updateFloat4("vRefractionInfos",this._refractionTexture.level,this.indexOfRefraction,e,this.invertRefractionY?-1:1),this._refractionTexture.boundingBoxSize){let e=this._refractionTexture;_.updateVector3("vRefractionPosition",e.boundingBoxPosition),_.updateVector3("vRefractionSize",e.boundingBoxSize)}}this.pointsCloud&&_.updateFloat("pointSize",this.pointSize),_.updateColor4("vSpecularColor",this.specularColor,this.specularPower),_.updateColor3("vEmissiveColor",V.EmissiveTextureEnabled?this.emissiveColor:o.Color3.BlackReadOnly),_.updateColor4("vDiffuseColor",this.diffuseColor,this.alpha),r.ambientColor.multiplyToRef(this.ambientColor,this._globalAmbientColor),_.updateColor3("vAmbientColor",this._globalAmbientColor)}r.texturesEnabled&&(this._diffuseTexture&&V.DiffuseTextureEnabled&&a.setTexture("diffuseSampler",this._diffuseTexture),this._ambientTexture&&V.AmbientTextureEnabled&&a.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&V.OpacityTextureEnabled&&a.setTexture("opacitySampler",this._opacityTexture),this._reflectionTexture&&V.ReflectionTextureEnabled&&(this._reflectionTexture.isCube?a.setTexture("reflectionCubeSampler",this._reflectionTexture):a.setTexture("reflection2DSampler",this._reflectionTexture)),this._emissiveTexture&&V.EmissiveTextureEnabled&&a.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&V.LightmapTextureEnabled&&a.setTexture("lightmapSampler",this._lightmapTexture),this._specularTexture&&V.SpecularTextureEnabled&&a.setTexture("specularSampler",this._specularTexture),this._bumpTexture&&r.getEngine().getCaps().standardDerivatives&&V.BumpTextureEnabled&&a.setTexture("bumpSampler",this._bumpTexture),this._refractionTexture&&V.RefractionTextureEnabled&&(this._refractionTexture.isCube?a.setTexture("refractionCubeSampler",this._refractionTexture):a.setTexture("refraction2DSampler",this._refractionTexture))),this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(t)&&this.getScene().depthPeelingRenderer.bind(a),this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),(0,b.BindClipPlane)(a,this,r),this.bindEyePosition(a)}else d&&(this._needToBindSceneUbo=!0);(h||!this.isFrozen||d)&&r.lightsEnabled&&!this._disableLighting&&(0,S.BindLights)(r,t,a,s,this._maxSimultaneousLights),(h||!this.isFrozen)&&((r.fogEnabled&&t.applyFog&&r.fogMode!==n.Scene.FOGMODE_NONE||this._reflectionTexture||this._refractionTexture||t.receiveShadows||s.PREPASS||s.CLUSTLIGHT_BATCH)&&this.bindView(a),(0,S.BindFogParameters)(r,t,a),s.NUM_MORPH_INFLUENCERS&&(0,S.BindMorphTargetParameters)(t,a),s.BAKED_VERTEX_ANIMATION_TEXTURE&&t.bakedVertexAnimationManager?.bind(a,s.INSTANCES),this.useLogarithmicDepth&&(0,S.BindLogDepth)(s,a,r),this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.applyByPostProcess&&this._imageProcessingConfiguration.bind(this._activeEffect)),this._afterBind(t,this._activeEffect,i),_.update()}getAnimatables(){let e=super.getAnimatables();return this._diffuseTexture&&this._diffuseTexture.animations&&this._diffuseTexture.animations.length>0&&e.push(this._diffuseTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._specularTexture&&this._specularTexture.animations&&this._specularTexture.animations.length>0&&e.push(this._specularTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),e}getActiveTextures(){let e=super.getActiveTextures();return this._diffuseTexture&&e.push(this._diffuseTexture),this._ambientTexture&&e.push(this._ambientTexture),this._opacityTexture&&e.push(this._opacityTexture),this._reflectionTexture&&e.push(this._reflectionTexture),this._emissiveTexture&&e.push(this._emissiveTexture),this._specularTexture&&e.push(this._specularTexture),this._bumpTexture&&e.push(this._bumpTexture),this._lightmapTexture&&e.push(this._lightmapTexture),this._refractionTexture&&e.push(this._refractionTexture),e}hasTexture(e){return!!super.hasTexture(e)||this._diffuseTexture===e||this._ambientTexture===e||this._opacityTexture===e||this._reflectionTexture===e||this._emissiveTexture===e||this._specularTexture===e||this._bumpTexture===e||this._lightmapTexture===e||this._refractionTexture===e||!1}dispose(e,t){t&&(this._diffuseTexture?.dispose(),this._ambientTexture?.dispose(),this._opacityTexture?.dispose(),this._reflectionTexture?.dispose(),this._emissiveTexture?.dispose(),this._specularTexture?.dispose(),this._bumpTexture?.dispose(),this._lightmapTexture?.dispose(),this._refractionTexture?.dispose()),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(e,t)}clone(e,t=!0,i=""){let r=A.SerializationHelper.Clone(()=>new V(e,this.getScene()),this,{cloneTexturesOnlyOnce:t});return r.name=e,r.id=e,this.stencil.copyTo(r.stencil),this._clonePlugins(r,i),r}static Parse(e,t,i){let r=A.SerializationHelper.Parse(()=>new V(e.name,t),e,t,i);return e.stencil&&r.stencil.parse(e.stencil,t,i),p.Material._ParsePlugins(e,r,t,i),r}static get DiffuseTextureEnabled(){return f.MaterialFlags.DiffuseTextureEnabled}static set DiffuseTextureEnabled(e){f.MaterialFlags.DiffuseTextureEnabled=e}static get DetailTextureEnabled(){return f.MaterialFlags.DetailTextureEnabled}static set DetailTextureEnabled(e){f.MaterialFlags.DetailTextureEnabled=e}static get AmbientTextureEnabled(){return f.MaterialFlags.AmbientTextureEnabled}static set AmbientTextureEnabled(e){f.MaterialFlags.AmbientTextureEnabled=e}static get OpacityTextureEnabled(){return f.MaterialFlags.OpacityTextureEnabled}static set OpacityTextureEnabled(e){f.MaterialFlags.OpacityTextureEnabled=e}static get ReflectionTextureEnabled(){return f.MaterialFlags.ReflectionTextureEnabled}static set ReflectionTextureEnabled(e){f.MaterialFlags.ReflectionTextureEnabled=e}static get EmissiveTextureEnabled(){return f.MaterialFlags.EmissiveTextureEnabled}static set EmissiveTextureEnabled(e){f.MaterialFlags.EmissiveTextureEnabled=e}static get SpecularTextureEnabled(){return f.MaterialFlags.SpecularTextureEnabled}static set SpecularTextureEnabled(e){f.MaterialFlags.SpecularTextureEnabled=e}static get BumpTextureEnabled(){return f.MaterialFlags.BumpTextureEnabled}static set BumpTextureEnabled(e){f.MaterialFlags.BumpTextureEnabled=e}static get LightmapTextureEnabled(){return f.MaterialFlags.LightmapTextureEnabled}static set LightmapTextureEnabled(e){f.MaterialFlags.LightmapTextureEnabled=e}static get RefractionTextureEnabled(){return f.MaterialFlags.RefractionTextureEnabled}static set RefractionTextureEnabled(e){f.MaterialFlags.RefractionTextureEnabled=e}static get ColorGradingTextureEnabled(){return f.MaterialFlags.ColorGradingTextureEnabled}static set ColorGradingTextureEnabled(e){f.MaterialFlags.ColorGradingTextureEnabled=e}static get FresnelEnabled(){return f.MaterialFlags.FresnelEnabled}static set FresnelEnabled(e){f.MaterialFlags.FresnelEnabled=e}}V.ForceGLSL=!1,(0,r.__decorate)([(0,s.serializeAsTexture)("diffuseTexture")],V.prototype,"_diffuseTexture",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],V.prototype,"diffuseTexture",void 0),(0,r.__decorate)([(0,s.serializeAsTexture)("ambientTexture")],V.prototype,"_ambientTexture",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"ambientTexture",void 0),(0,r.__decorate)([(0,s.serializeAsTexture)("opacityTexture")],V.prototype,"_opacityTexture",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],V.prototype,"opacityTexture",void 0),(0,r.__decorate)([(0,s.serializeAsTexture)("reflectionTexture")],V.prototype,"_reflectionTexture",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"reflectionTexture",void 0),(0,r.__decorate)([(0,s.serializeAsTexture)("emissiveTexture")],V.prototype,"_emissiveTexture",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"emissiveTexture",void 0),(0,r.__decorate)([(0,s.serializeAsTexture)("specularTexture")],V.prototype,"_specularTexture",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"specularTexture",void 0),(0,r.__decorate)([(0,s.serializeAsTexture)("bumpTexture")],V.prototype,"_bumpTexture",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"bumpTexture",void 0),(0,r.__decorate)([(0,s.serializeAsTexture)("lightmapTexture")],V.prototype,"_lightmapTexture",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"lightmapTexture",void 0),(0,r.__decorate)([(0,s.serializeAsTexture)("refractionTexture")],V.prototype,"_refractionTexture",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"refractionTexture",void 0),(0,r.__decorate)([(0,s.serializeAsColor3)("ambient")],V.prototype,"ambientColor",void 0),(0,r.__decorate)([(0,s.serializeAsColor3)("diffuse")],V.prototype,"diffuseColor",void 0),(0,r.__decorate)([(0,s.serializeAsColor3)("specular")],V.prototype,"specularColor",void 0),(0,r.__decorate)([(0,s.serializeAsColor3)("emissive")],V.prototype,"emissiveColor",void 0),(0,r.__decorate)([(0,s.serialize)()],V.prototype,"specularPower",void 0),(0,r.__decorate)([(0,s.serialize)("useAlphaFromDiffuseTexture")],V.prototype,"_useAlphaFromDiffuseTexture",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],V.prototype,"useAlphaFromDiffuseTexture",void 0),(0,r.__decorate)([(0,s.serialize)("useEmissiveAsIllumination")],V.prototype,"_useEmissiveAsIllumination",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useEmissiveAsIllumination",void 0),(0,r.__decorate)([(0,s.serialize)("linkEmissiveWithDiffuse")],V.prototype,"_linkEmissiveWithDiffuse",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"linkEmissiveWithDiffuse",void 0),(0,r.__decorate)([(0,s.serialize)("useSpecularOverAlpha")],V.prototype,"_useSpecularOverAlpha",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useSpecularOverAlpha",void 0),(0,r.__decorate)([(0,s.serialize)("useReflectionOverAlpha")],V.prototype,"_useReflectionOverAlpha",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useReflectionOverAlpha",void 0),(0,r.__decorate)([(0,s.serialize)("disableLighting")],V.prototype,"_disableLighting",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsLightsDirty")],V.prototype,"disableLighting",void 0),(0,r.__decorate)([(0,s.serialize)("useObjectSpaceNormalMap")],V.prototype,"_useObjectSpaceNormalMap",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useObjectSpaceNormalMap",void 0),(0,r.__decorate)([(0,s.serialize)("useParallax")],V.prototype,"_useParallax",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useParallax",void 0),(0,r.__decorate)([(0,s.serialize)("useParallaxOcclusion")],V.prototype,"_useParallaxOcclusion",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useParallaxOcclusion",void 0),(0,r.__decorate)([(0,s.serialize)()],V.prototype,"parallaxScaleBias",void 0),(0,r.__decorate)([(0,s.serialize)("roughness")],V.prototype,"_roughness",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"roughness",void 0),(0,r.__decorate)([(0,s.serialize)()],V.prototype,"indexOfRefraction",void 0),(0,r.__decorate)([(0,s.serialize)()],V.prototype,"invertRefractionY",void 0),(0,r.__decorate)([(0,s.serialize)()],V.prototype,"alphaCutOff",void 0),(0,r.__decorate)([(0,s.serialize)("useLightmapAsShadowmap")],V.prototype,"_useLightmapAsShadowmap",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useLightmapAsShadowmap",void 0),(0,r.__decorate)([(0,s.serializeAsFresnelParameters)("diffuseFresnelParameters")],V.prototype,"_diffuseFresnelParameters",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],V.prototype,"diffuseFresnelParameters",void 0),(0,r.__decorate)([(0,s.serializeAsFresnelParameters)("opacityFresnelParameters")],V.prototype,"_opacityFresnelParameters",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsFresnelAndMiscDirty")],V.prototype,"opacityFresnelParameters",void 0),(0,r.__decorate)([(0,s.serializeAsFresnelParameters)("reflectionFresnelParameters")],V.prototype,"_reflectionFresnelParameters",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],V.prototype,"reflectionFresnelParameters",void 0),(0,r.__decorate)([(0,s.serializeAsFresnelParameters)("refractionFresnelParameters")],V.prototype,"_refractionFresnelParameters",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],V.prototype,"refractionFresnelParameters",void 0),(0,r.__decorate)([(0,s.serializeAsFresnelParameters)("emissiveFresnelParameters")],V.prototype,"_emissiveFresnelParameters",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],V.prototype,"emissiveFresnelParameters",void 0),(0,r.__decorate)([(0,s.serialize)("useReflectionFresnelFromSpecular")],V.prototype,"_useReflectionFresnelFromSpecular",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsFresnelDirty")],V.prototype,"useReflectionFresnelFromSpecular",void 0),(0,r.__decorate)([(0,s.serialize)("useGlossinessFromSpecularMapAlpha")],V.prototype,"_useGlossinessFromSpecularMapAlpha",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useGlossinessFromSpecularMapAlpha",void 0),(0,r.__decorate)([(0,s.serialize)("maxSimultaneousLights")],V.prototype,"_maxSimultaneousLights",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsLightsDirty")],V.prototype,"maxSimultaneousLights",void 0),(0,r.__decorate)([(0,s.serialize)("invertNormalMapX")],V.prototype,"_invertNormalMapX",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"invertNormalMapX",void 0),(0,r.__decorate)([(0,s.serialize)("invertNormalMapY")],V.prototype,"_invertNormalMapY",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"invertNormalMapY",void 0),(0,r.__decorate)([(0,s.serialize)("twoSidedLighting")],V.prototype,"_twoSidedLighting",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"twoSidedLighting",void 0),(0,r.__decorate)([(0,s.serialize)("applyDecalMapAfterDetailMap")],V.prototype,"_applyDecalMapAfterDetailMap",void 0),(0,r.__decorate)([(0,s.expandToProperty)("_markAllSubMeshesAsMiscDirty")],V.prototype,"applyDecalMapAfterDetailMap",void 0);let H=!1;function G(){H||(H=!0,(0,F.RegisterClass)("BABYLON.StandardMaterial",V),n.Scene.DefaultMaterialFactory=e=>new V("default material",e))}Object.getOwnPropertyDescriptor(V.prototype,"decalMap")||Object.defineProperty(V.prototype,"decalMap",(0,N._MissingSideEffectProperty)("StandardMaterial","decalMap")),e.s(["RegisterStandardMaterial",0,G,"StandardMaterial",0,V,"StandardMaterialDefines",0,B],23015),G(),e.s([],9866),e.i(9866),e.i(23015),e.s(["RegisterStandardMaterial",0,G,"StandardMaterial",0,V,"StandardMaterialDefines",0,B],32550)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13379,e=>{"use strict";class t{static _CheckLimit(e,r){let a=t._LogLimitOutputs[e];return a?a.current++:(a={limit:r,current:1},t._LogLimitOutputs[e]=a),a.current<=a.limit}static _GenerateLimitMessage(e,r=1){let a=t._LogLimitOutputs[e];if(!a||!t.MessageLimitReached)return;let o=this._Levels[r];a.current===a.limit&&t[o.name](t.MessageLimitReached.replace(/%LIMIT%/g,""+a.limit).replace(/%TYPE%/g,o.name??""))}static _AddLogEntry(e){t._LogCache=e+t._LogCache,t.OnNewCacheEntry&&t.OnNewCacheEntry(e)}static _FormatMessage(e){let t=e=>e<10?"0"+e:""+e,r=new Date;return"["+t(r.getHours())+":"+t(r.getMinutes())+":"+t(r.getSeconds())+"]: "+e}static _LogDisabled(e,t){}static _LogEnabled(e=1,r,a){let o=Array.isArray(r)?r[0]:r;if(void 0!==a&&!t._CheckLimit(o,a))return;let s=t._FormatMessage(o),n=this._Levels[e],i=Array.isArray(r)?r.slice(1):[];n.logFunc&&n.logFunc("BJS - "+s,...i);let l=`<div style='color:${n.color}'>${s}</div><br>`;t._AddLogEntry(l),t._GenerateLimitMessage(o,e)}static get LogCache(){return t._LogCache}static ClearLogCache(){t._LogCache="",t._LogLimitOutputs={},t.errorsCount=0}static set LogLevels(e){for(let r of(t.Log=t._LogDisabled,t.Warn=t._LogDisabled,t.Error=t._LogDisabled,[t.MessageLogLevel,t.WarningLogLevel,t.ErrorLogLevel]))(e&r)===r&&(t[this._Levels[r].name]=t._LogEnabled.bind(t,r))}}t.NoneLogLevel=0,t.MessageLogLevel=1,t.WarningLogLevel=2,t.ErrorLogLevel=4,t.AllLogLevel=7,t.MessageLimitReached="Too many %TYPE%s (%LIMIT%), no more %TYPE%s will be reported for this message.",t._LogCache="",t._LogLimitOutputs={},t._Levels=[{},{color:"white",logFunc:console.log,name:"Log"},{color:"orange",logFunc:console.warn,name:"Warn"},{},{color:"red",logFunc:console.error,name:"Error"}],t.errorsCount=0,t.Log=t._LogEnabled.bind(t,t.MessageLogLevel),t.Warn=t._LogEnabled.bind(t,t.WarningLogLevel),t.Error=t._LogEnabled.bind(t,t.ErrorLogLevel),e.s(["Logger",0,t])},96704,e=>{"use strict";let t=null;function r(){if(t)return t;let e=new ArrayBuffer(4),r=new Float32Array(e),a=new Uint32Array(e),o=new Uint32Array(512),s=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-24?(o[e]=0,o[256|e]=32768,s[e]=24,s[256|e]=24):t<-14?(o[e]=1024>>-t-14,o[256|e]=1024>>-t-14|32768,s[e]=-t-1,s[256|e]=-t-1):t<=15?(o[e]=t+15<<10,o[256|e]=t+15<<10|32768,s[e]=13,s[256|e]=13):t<128?(o[e]=31744,o[256|e]=64512,s[e]=24,s[256|e]=24):(o[e]=31744,o[256|e]=64512,s[e]=13,s[256|e]=13)}let n=new Uint32Array(2048),i=new Uint32Array(64),l=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,r=0;for(;(8388608&t)==0;)t<<=1,r-=8388608;t&=-8388609,r+=0x38800000,n[e]=t|r}for(let e=1024;e<2048;++e)n[e]=0x38000000+(e-1024<<13);for(let e=1;e<31;++e)i[e]=e<<23;i[31]=0x47800000,i[32]=0x80000000;for(let e=33;e<63;++e)i[e]=0x80000000+(e-32<<23);i[63]=0xc7800000;for(let e=1;e<64;++e)32!==e&&(l[e]=1024);return t={floatView:r,uint32View:a,baseTable:o,shiftTable:s,mantissaTable:n,exponentTable:i,offsetTable:l}}e.s(["FromHalfFloat",0,function(e){let t=r();return t.uint32View[0]=t.mantissaTable[t.offsetTable[e>>10]+(1023&e)]+t.exponentTable[e>>10],t.floatView[0]},"MaxHalfFloat",0,65504,"ToHalfFloat",0,function(e){let t=r();t.floatView[0]=e;let a=t.uint32View[0],o=a>>23&511;return t.baseTable[o]+((8388607&a)>>t.shiftTable[o])}])},64545,e=>{"use strict";e.s(["GetDOMTextContent",0,function(e){let t="",r=e.firstChild;for(;r;)3===r.nodeType&&(t+=r.textContent),r=r.nextSibling;return t},"IsDocumentAvailable",0,function(){return"u">typeof document},"IsNavigatorAvailable",0,function(){return"u">typeof navigator},"IsWindowObjectExist",0,function(){return"u">typeof window}])},36395,e=>{"use strict";var t=e.i(64545);e.s(["PrecisionDate",0,class{static get Now(){return(0,t.IsWindowObjectExist)()&&window.performance&&window.performance.now?window.performance.now():Date.now()}}])},65295,e=>{"use strict";class t{constructor(){this._xhr="u">typeof _native&&_native.XMLHttpRequest?new _native.XMLHttpRequest:new XMLHttpRequest,this._requestURL=""}static get IsCustomRequestAvailable(){return Object.keys(t.CustomRequestHeaders).length>0||t.CustomRequestModifiers.length>0}static _CleanUrl(e){return e=(e=e.replace("file:http:","http:")).replace("file:https:","https:")}static _ShouldSkipRequestModifications(e){return t.SkipRequestModificationForBabylonCDN&&(e.includes("preview.babylonjs.com")||e.includes("cdn.babylonjs.com"))}static _CollectCustomizations(e,r={}){let a={...r};if(t._ShouldSkipRequestModifications(e))return{url:e,headers:a};for(let e in t.CustomRequestHeaders){let r=t.CustomRequestHeaders[e];r&&(a[e]=r)}let o={setRequestHeader:(e,t)=>{a[e]=t}};for(let r of t.CustomRequestModifiers){if(t._ShouldSkipRequestModifications(e))break;let a=r(o,e);"string"==typeof a&&(e=a)}return{url:e,headers:a}}static async FetchAsync(e,r={}){let a=r.method??"GET";if("u">typeof fetch){let{url:o,headers:s}=t._CollectCustomizations(t._CleanUrl(e),r.headers??{});return await fetch(o,{method:a,headers:s,body:r.body??void 0})}return await new Promise((o,s)=>{let n=new t;n.responseType="arraybuffer",n.addEventListener("readystatechange",()=>{if(4===n.readyState)if(n.status>=200&&n.status<300){let e="u">typeof Headers?new Headers:void 0,t=n.getResponseHeader("Content-Type");t&&e&&e.set("Content-Type",t),"u">typeof Response?o(new Response(n.response,{status:n.status,statusText:n.statusText,headers:e})):o({ok:!0,status:n.status,statusText:n.statusText,headers:{get:e=>n.getResponseHeader(e)},arrayBuffer:async()=>await Promise.resolve(n.response)})}else s(Error(`HTTP ${n.status} loading '${n.requestURL}': ${n.statusText}`))}),n.open(a,e,r.headers),n.send(r.body??null)})}get requestURL(){return this._requestURL}get onprogress(){return this._xhr.onprogress}set onprogress(e){this._xhr.onprogress=e}get readyState(){return this._xhr.readyState}get status(){return this._xhr.status}get statusText(){return this._xhr.statusText}get response(){return this._xhr.response}get responseURL(){return this._xhr.responseURL}get responseText(){return this._xhr.responseText}get responseType(){return this._xhr.responseType}set responseType(e){this._xhr.responseType=e}get timeout(){return this._xhr.timeout}set timeout(e){this._xhr.timeout=e}addEventListener(e,t,r){this._xhr.addEventListener(e,t,r)}removeEventListener(e,t,r){this._xhr.removeEventListener(e,t,r)}abort(){this._xhr.abort()}send(e){this._xhr.send(e)}open(e,r,a){let{url:o,headers:s}=t._CollectCustomizations(r,a);for(let r in this._requestURL=t._CleanUrl(o),this._xhr.open(e,this._requestURL,!0),s)this._xhr.setRequestHeader(r,s[r])}setRequestHeader(e,t){this._xhr.setRequestHeader(e,t)}getResponseHeader(e){return this._xhr.getResponseHeader(e)}}t.CustomRequestHeaders={},t.CustomRequestModifiers=[],t.SkipRequestModificationForBabylonCDN=!0,e.s(["WebRequest",0,t])},29822,6805,92605,49311,23240,e=>{"use strict";class t{}t.FilesToLoad={},e.s(["FilesInputStore",0,t],29822),e.s(["RetryStrategy",0,class{static ExponentialBackoff(e=3,t=500){return(r,a,o)=>0!==a.status||o>=e||-1!==r.indexOf("file:")?-1:Math.pow(2,o)*t}}],6805);class r extends Error{}r._setPrototypeOf=Object.setPrototypeOf||((e,t)=>(e.__proto__=t,e));class a extends r{constructor(e,t,o){super(e),this.errorCode=t,this.innerError=o,this.name="RuntimeError",r._setPrototypeOf(this,a.prototype)}}e.s(["BaseError",0,r,"ErrorCodes",0,{MeshInvalidPositionsError:0,UnsupportedTextureError:1e3,GLTFLoaderUnexpectedMagicError:2e3,SceneLoaderError:3e3,LoadFileError:4e3,RequestFileError:4001,ReadFileError:4002},"RuntimeError",0,a],92605);let o=e=>atob(e);e.s(["DecodeBase64ToBinary",0,e=>"function"==typeof Uint8Array.fromBase64?Uint8Array.fromBase64(e).buffer:function(e){let t=o(e),r=t.length,a=new Uint8Array(new ArrayBuffer(r));for(let e=0;e<r;e++)a[e]=t.charCodeAt(e);return a.buffer}(e),"DecodeBase64ToString",0,o,"EncodeArrayBufferToBase64",0,e=>{let t=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);return"function"==typeof t.toBase64?t.toBase64():function(e){let t,r,a,o,s,n,i,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="",u=0;for(;u<e.length;)t=e[u++],r=u<e.length?e[u++]:NaN,a=u<e.length?e[u++]:NaN,o=t>>2,s=(3&t)<<4|r>>4,n=(15&r)<<2|a>>6,i=63&a,isNaN(r)?n=i=64:isNaN(a)&&(i=64),c+=l.charAt(o)+l.charAt(s)+l.charAt(n)+l.charAt(i);return c}(t)}],49311);let s=[];function n(e,t,r){try{if(e())return t(),!0}catch(e){return r?.(e),!0}return!1}e.s(["TimingTools",0,class{static SetImmediate(e){0===s.length&&setTimeout(()=>{let e=s;for(let t of(s=[],e))t()},1),s.push(e)}},"_RetryWithInterval",0,(e,t,r,a=16,o=3e4,s=!0,i)=>{if(s&&n(e,t,r))return null;let l=setInterval(()=>{n(e,t,r)?clearInterval(l):(o-=a)<0&&(clearInterval(l),r?.(Error("Operation timed out after maximum retries. "+(i||"")),!0))},a);return()=>clearInterval(l)}],23240)},38118,e=>{"use strict";var t=e.i(13379),r=e.i(96704);function a(e){switch(e){case 5120:case 5121:return 1;case 5122:case 5123:case 5131:return 2;case 5124:case 5125:case 5126:return 4;default:throw Error(`Invalid type '${e}'`)}}function o(e,t,o,s,n,i,l,c){let u=Array(s),f=Array(s);if(e instanceof Array){let r=t/4,a=o/4;for(let t=0;t<i;t+=s){for(let t=0;t<s;t++)u[t]=f[t]=e[r+t];c(f,t);for(let t=0;t<s;t++)u[t]!==f[t]&&(e[r+t]=f[t]);r+=a}}else{let d=ArrayBuffer.isView(e)?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(e),g=a(n);for(let e=0;e<i;e+=s){for(let e=0,a=t;e<s;e++,a+=g)u[e]=f[e]=function(e,t,a,o){switch(t){case 5120:{let t=e.getInt8(a);return o&&(t=Math.max(t/127,-1)),t}case 5121:{let t=e.getUint8(a);return o&&(t/=255),t}case 5122:{let t=e.getInt16(a,!0);return o&&(t=Math.max(t/32767,-1)),t}case 5123:{let t=e.getUint16(a,!0);return o&&(t/=65535),t}case 5131:return(0,r.FromHalfFloat)(e.getUint16(a,!0));case 5124:return e.getInt32(a,!0);case 5125:return e.getUint32(a,!0);case 5126:return e.getFloat32(a,!0);default:throw Error(`Invalid component type ${t}`)}}(d,n,a,l);c(f,e);for(let e=0,a=t;e<s;e++,a+=g)u[e]!==f[e]&&function(e,t,a,o,s){switch(t){case 5120:o&&(s=Math.round(127*s)),e.setInt8(a,s);break;case 5121:o&&(s=Math.round(255*s)),e.setUint8(a,s);break;case 5122:o&&(s=Math.round(32767*s)),e.setInt16(a,s,!0);break;case 5123:o&&(s=Math.round(65535*s)),e.setUint16(a,s,!0);break;case 5131:e.setUint16(a,(0,r.ToHalfFloat)(s),!0);break;case 5124:e.setInt32(a,s,!0);break;case 5125:e.setUint32(a,s,!0);break;case 5126:e.setFloat32(a,s,!0);break;default:throw Error(`Invalid component type ${t}`)}}(d,n,a,l,f[e]);t+=o}}}e.s(["CopyFloatData",0,function(e,r,s,n,i,l,c,u){let f=r*a(s),d=c*r;if(u.length!==d)throw Error("Output length is not valid");if(5126!==s||i!==f)return void o(e,n,i,r,s,d,l,(e,t)=>{for(let a=0;a<r;a++)u[t+a]=e[a]});if(e instanceof Array){let t=n/4;u.set(e,t)}else if(ArrayBuffer.isView(e)){let r=e.byteOffset+n;if((3&r)!=0){t.Logger.Warn("Float array must be aligned to 4-bytes border"),u.set(new Float32Array(e.buffer.slice(r,r+d*Float32Array.BYTES_PER_ELEMENT)));return}let a=new Float32Array(e.buffer,r,d);u.set(a)}else{let t=new Float32Array(e,n,d);u.set(t)}},"EnumerateFloatValues",0,o,"GetBlobBufferSource",0,function(e){let t=e.buffer;if(t instanceof ArrayBuffer)return e;let r=new ArrayBuffer(e.byteLength);return new Uint8Array(r).set(new Uint8Array(t,e.byteOffset,e.byteLength)),r},"GetFloatData",0,function(e,r,s,n,i,l,c,u){let f=r*a(s),d=c*r;if(5126!==s||i!==f){let t=new Float32Array(d);return o(e,n,i,r,s,d,l,(e,a)=>{for(let o=0;o<r;o++)t[a+o]=e[o]}),t}if(!(e instanceof Array||e instanceof Float32Array)||0!==n||e.length!==d)if(e instanceof Array){let t=n/4;return e.slice(t,t+d)}else{if(!ArrayBuffer.isView(e))return new Float32Array(e,n,d);let r=e.byteOffset+n;return((3&r)!=0&&(t.Logger.Warn("Float array must be aligned to 4-bytes border"),u=!0),u)?new Float32Array(e.buffer.slice(r,r+d*Float32Array.BYTES_PER_ELEMENT)):new Float32Array(e.buffer,r,d)}return u?e.slice():e},"GetTypeByteLength",0,a,"GetTypedArrayData",0,function(e,r,s,n,i,l,c){let u,f=a(s),d=function(e){switch(e){case 5120:return Int8Array;case 5121:return Uint8Array;case 5122:return Int16Array;case 5123:case 5131:return Uint16Array;case 5124:return Int32Array;case 5125:return Uint32Array;case 5126:return Float32Array;default:throw Error(`Invalid component type '${e}'`)}}(s),g=l*r;if(Array.isArray(e)){if((3&n)!=0||(3&i)!=0)throw Error("byteOffset and byteStride must be a multiple of 4 for number[] data.");let t=n/4,a=i/4;if(t+(l-1)*a+r>e.length)throw Error("Last accessed index is out of bounds.");if(a<r)throw Error("Data stride cannot be smaller than the component size.");if(a!==r){let t=new d(g);return o(e,n,i,r,s,g,!1,(e,a)=>{for(let o=0;o<r;o++)t[a+o]=e[o]}),t}return new d(e.slice(t,t+g))}let p=n;if(ArrayBuffer.isView(e)?(u=e.buffer,p+=e.byteOffset):u=e,p+(l-1)*i+r*f>u.byteLength)throw Error("Last accessed byte is out of bounds.");let m=r*f;if(i<m)throw Error("Byte stride cannot be smaller than the component's byte size.");if(i!==m){let e=new d(g),t=new Uint8Array(u,p),a=new Uint8Array(e.buffer),o=r*f;for(let e=0,r=0,s=0;e<l;e++,r+=i,s+=o)a.set(t.subarray(r,r+o),s);return e}return(1!==f&&(p&f-1)!=0&&(t.Logger.Warn("Array must be aligned to border of element size. Data will be copied."),c=!0),c)?new d(u.slice(p,p+g*f)):new d(u,p,g)}])},46712,e=>{"use strict";var t=e.i(65295),r=e.i(64545),a=e.i(99267),o=e.i(29822),s=e.i(6805),n=e.i(92605),i=e.i(49311),l=e.i(81623),c=e.i(13379),u=e.i(23240),f=e.i(38118);let d=new RegExp(/^data:([^,]+\/[^,]+)?;base64,/i);class g extends n.RuntimeError{constructor(e,r){super(e,n.ErrorCodes.LoadFileError),this.name="LoadFileError",n.BaseError._setPrototypeOf(this,g.prototype),r instanceof t.WebRequest?this.request=r:this.file=r}}class p extends n.RuntimeError{constructor(e,t){super(e,n.ErrorCodes.RequestFileError),this.request=t,this.name="RequestFileError",n.BaseError._setPrototypeOf(this,p.prototype)}}class m extends n.RuntimeError{constructor(e,t){super(e,n.ErrorCodes.ReadFileError),this.file=t,this.name="ReadFileError",n.BaseError._setPrototypeOf(this,m.prototype)}}let h={DefaultRetryStrategy:s.RetryStrategy.ExponentialBackoff(),BaseUrl:"",CorsBehavior:"anonymous",PreprocessUrl:e=>e,ScriptBaseUrl:"",ScriptPreprocessUrl:e=>e,CleanUrl:e=>e=e.replace(/#/gm,"%23")},y=(e,t)=>{if((!e||0!==e.indexOf("data:"))&&h.CorsBehavior)if("string"==typeof h.CorsBehavior||h.CorsBehavior instanceof String)t.crossOrigin=h.CorsBehavior;else{let r=h.CorsBehavior(e);r&&(t.crossOrigin=r)}},b=(e,t,r,o,s)=>{let n=new FileReader,i={onCompleteObservable:new a.Observable,abort:()=>n.abort()};return n.onloadend=()=>i.onCompleteObservable.notifyObservers(i),s&&(n.onerror=()=>{s(new m(`Unable to read ${e.name}`,e))}),n.onload=e=>{t(e.target.result)},r&&(n.onprogress=r),o?n.readAsArrayBuffer(e):n.readAsText(e),i},L=(e,t,r,s,n,i,l)=>{if(e.name)return b(e,t,r,n,i?e=>{i(void 0,e)}:void 0);if(-1!==e.indexOf("file:")){let a=decodeURIComponent(e.substring(5).toLowerCase());0===a.indexOf("./")&&(a=a.substring(2));let s=o.FilesInputStore.FilesToLoad[a];if(s)return b(s,t,r,n,i?e=>i(void 0,new g(e.message,e.file)):void 0)}let{match:f,type:d}=U(e);if(f){let r={onCompleteObservable:new a.Observable,abort:()=>()=>{}};try{let r=n?w(e):_(e);t(r,void 0,d)}catch(e){i?i(void 0,e):c.Logger.Error(e.message||"Failed to parse the Data URL")}return u.TimingTools.SetImmediate(()=>{r.onCompleteObservable.notifyObservers(r)}),r}return v(e,(e,r)=>{t(e,r?.responseURL,r?.getResponseHeader("content-type"))},r,s,n,i?e=>{i(e.request,new g(e.message,e.request))}:void 0,l)},v=(e,o,s,n,i,u,f)=>{null!==n&&(n??(n=l.EngineStore.LastCreatedScene?.offlineProvider)),e=h.CleanUrl(e),e=h.PreprocessUrl(e);let d=h.BaseUrl+e,g=!1,m={onCompleteObservable:new a.Observable,abort:()=>g=!0},y=()=>{let e,a=new t.WebRequest,n=null,l=()=>{a&&(s&&a.removeEventListener("progress",s),e&&a.removeEventListener("readystatechange",e),a.removeEventListener("loadend",y))},y=()=>{l(),m.onCompleteObservable.notifyObservers(m),m.onCompleteObservable.clear(),s=void 0,e=null,y=null,u=void 0,f=void 0,o=void 0};m.abort=()=>{g=!0,y&&y(),a&&a.readyState!==(XMLHttpRequest.DONE||4)&&a.abort(),null!==n&&(clearTimeout(n),n=null),a=null};let b=e=>{let t=e.message||"Unknown error";u&&a?u(new p(t,a)):c.Logger.Error(t)},L=c=>{if(a){if(a.open("GET",d),f)try{f(a)}catch(e){b(e);return}i&&(a.responseType="arraybuffer"),s&&a.addEventListener("progress",s),y&&a.addEventListener("loadend",y),e=()=>{if(!g&&a&&a.readyState===(XMLHttpRequest.DONE||4)){if(e&&a.removeEventListener("readystatechange",e),a.status>=200&&a.status<300||0===a.status&&(!(0,r.IsWindowObjectExist)()||C())){let e=i?a.response:a.responseText;if(null!==e){try{o&&o(e,a)}catch(e){b(e)}return}}let s=h.DefaultRetryStrategy;if(s){let e=s(d,a,c);if(-1!==e){l(),a=new t.WebRequest,n=setTimeout(()=>L(c+1),e);return}}let f=new p("Error status: "+a.status+" "+a.statusText+" - Unable to load "+d,a);u&&u(f)}},a.addEventListener("readystatechange",e),a.send()}};L(0)};if(n&&n.enableSceneOffline&&!e.startsWith("blob:")){let t=e=>{e&&e.status>400?u&&u(e):y()};n.open(()=>{n&&n.loadFile(h.BaseUrl+e,e=>{!g&&o&&o(e),m.onCompleteObservable.notifyObservers(m)},s?e=>{!g&&s&&s(e)}:void 0,t,i)},t)}else y();return m},C=()=>"u">typeof location&&"file:"===location.protocol,U=e=>{let t=d.exec(e);return null===t||0===t.length?{match:!1,type:""}:{match:!0,type:t[0].replace("data:","").replace(";base64,","")}};function w(e){return(0,i.DecodeBase64ToBinary)(e.split(",")[1])}let _=e=>(0,i.DecodeBase64ToString)(e.split(",")[1]);e.s(["DecodeBase64UrlToBinary",0,w,"FileToolsOptions",0,h,"IsBase64DataUrl",0,e=>d.test(e),"LoadFile",0,L,"LoadImage",0,(e,r,a,s,n="",c,u=l.EngineStore.LastCreatedEngine)=>{let d;if("u"<typeof HTMLImageElement&&!u?._features.forceBitmapOverHTMLImageElement)return a("LoadImage is only supported in web or BabylonNative environments."),null;let g=!1;if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))if("u">typeof Blob&&"u">typeof URL){let t;t=e instanceof ArrayBuffer?e:(0,f.GetBlobBufferSource)(e),d=URL.createObjectURL(new Blob([t],{type:n})),g=!0}else d=`data:${n};base64,`+(0,i.EncodeArrayBufferToBase64)(e);else e instanceof Blob?(d=URL.createObjectURL(e),g=!0):(d=h.CleanUrl(e),d=h.PreprocessUrl(d));let p=t=>{if(a){let r=d||e.toString();a(`Error while trying to load image: ${0===r.indexOf("http")||r.length<=128?r:r.slice(0,128)+"..."}`,t)}};if(u?._features.forceBitmapOverHTMLImageElement)return L(d,t=>{u.createImageBitmap(new Blob([t],{type:n}),{premultiplyAlpha:"none",colorSpaceConversion:"none",...c}).then(e=>{r(e),g&&URL.revokeObjectURL(d)}).catch(t=>{a&&a("Error while trying to load image: "+e,t)})},void 0,s||void 0,!0,(e,t)=>{p(t)}),null;let m=new Image;!1;y(d,m);let b=[],v=()=>{for(let e of b)e.target.removeEventListener(e.name,e.handler);b.length=0};for(let e of(b.push({target:m,name:"load",handler:()=>{v(),r(m),g&&m.src&&URL.revokeObjectURL(m.src)}}),b.push({target:m,name:"error",handler:e=>{v(),p(e),g&&m.src&&URL.revokeObjectURL(m.src)}}),b.push({target:document,name:"securitypolicyviolation",handler:e=>{if(e.blockedURI!==m.src||"report"===e.disposition)return;v();let t=Error(`CSP violation of policy ${e.effectiveDirective} ${e.blockedURI}. Current policy is ${e.originalPolicy}`);l.EngineStore.UseFallbackTexture=!1,p(t),g&&m.src&&URL.revokeObjectURL(m.src),m.src=""}}),b))e.target.addEventListener(e.name,e.handler);let C="blob:"===d.substring(0,5),U="data:"===d.substring(0,5),w=()=>{C||U||!t.WebRequest.IsCustomRequestAvailable?m.src=d:L(d,(e,t,r)=>{let a=new Blob([e],{type:!n&&r?r:n}),o=URL.createObjectURL(a);g=!0,m.src=o},void 0,s||void 0,!0,(e,t)=>{p(t)})};if(!C&&!U&&s&&s.enableTexturesOffline)s.open(()=>{s&&s.loadImage(d,m)},w);else{if(-1!==d.indexOf("file:")){let e=decodeURIComponent(d.substring(5).toLowerCase());if(o.FilesInputStore.FilesToLoad[e]&&"u">typeof URL){try{let t;try{t=URL.createObjectURL(o.FilesInputStore.FilesToLoad[e])}catch(r){t=URL.createObjectURL(o.FilesInputStore.FilesToLoad[e])}m.src=t,g=!0}catch(e){m.src=""}return m}}w()}return m},"ReadFile",0,b,"RequestFile",0,v,"SetCorsBehavior",0,y])},84768,e=>{"use strict";e.s(["RandomGUID",0,function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}])},98105,e=>{"use strict";var t=e.i(13379),r=e.i(77052);class a{static Instantiate(e){if(this.RegisteredExternalClasses&&this.RegisteredExternalClasses[e])return this.RegisteredExternalClasses[e];let a=(0,r.GetClass)(e);if(a)return a;t.Logger.Warn(e+" not found, you may have missed an import.");let o=e.split("."),s="u">typeof window?window:"u">typeof globalThis?globalThis:this;for(let e=0,t=o.length;e<t;e++)s=s[o[e]];return"function"!=typeof s?null:s}}a.RegisteredExternalClasses={},e.s(["InstantiationTools",0,a])},65740,71265,e=>{"use strict";var t,r=e.i(99267),a=e.i(64545),o=e.i(13379);let s=(e,t,r)=>!e||e.getClassName&&"Mesh"===e.getClassName()?null:e.getClassName&&("SubMesh"===e.getClassName()||"PhysicsBody"===e.getClassName())?e.clone(t):e.clone?e.clone():Array.isArray(e)?e.slice():r&&"object"==typeof e?{...e}:null;class n{static DeepCopy(e,t,r,a,n=!1){for(let i of function(e){let t=[];do for(let r of Object.getOwnPropertyNames(e))-1===t.indexOf(r)&&t.push(r);while(e=Object.getPrototypeOf(e))return t}(e)){if("_"===i[0]&&(!a||-1===a.indexOf(i))||i.endsWith("Observable")||r&&-1!==r.indexOf(i))continue;let l=e[i],c=typeof l;if("function"!==c)try{if("object"===c)if(l instanceof Uint8Array)t[i]=Uint8Array.from(l);else if(l instanceof Array){if(t[i]=[],l.length>0)if("object"==typeof l[0])for(let e=0;e<l.length;e++){let r=s(l[e],t,n);-1===t[i].indexOf(r)&&t[i].push(r)}else t[i]=l.slice(0)}else t[i]=s(l,t,n);else t[i]=l}catch(e){o.Logger.Warn(e.message)}}}}e.s(["DeepCopier",0,n],71265);var i=e.i(36395),l=e.i(75405),c=e.i(65295),u=e.i(81623),f=e.i(46712),d=e.i(23240),g=e.i(98105),p=e.i(84768);class m{static get BaseUrl(){return f.FileToolsOptions.BaseUrl}static set BaseUrl(e){f.FileToolsOptions.BaseUrl=e}static get CleanUrl(){return f.FileToolsOptions.CleanUrl}static set CleanUrl(e){f.FileToolsOptions.CleanUrl=e}static IsAbsoluteUrl(e){return 0===e.indexOf("//")||!(-1===e.indexOf("://")||-1===e.indexOf(".")||-1===e.indexOf("/")||e.indexOf(":")>e.indexOf("/"))&&(!!(e.indexOf("://")<e.indexOf("."))||0===e.indexOf("data:")||0===e.indexOf("blob:"))}static set ScriptBaseUrl(e){f.FileToolsOptions.ScriptBaseUrl=e}static get ScriptBaseUrl(){return f.FileToolsOptions.ScriptBaseUrl}static set CDNBaseUrl(e){t.ScriptBaseUrl=e,t.AssetBaseUrl=e}static set ScriptPreprocessUrl(e){f.FileToolsOptions.ScriptPreprocessUrl=e}static get ScriptPreprocessUrl(){return f.FileToolsOptions.ScriptPreprocessUrl}static get DefaultRetryStrategy(){return f.FileToolsOptions.DefaultRetryStrategy}static set DefaultRetryStrategy(e){f.FileToolsOptions.DefaultRetryStrategy=e}static get CorsBehavior(){return f.FileToolsOptions.CorsBehavior}static set CorsBehavior(e){f.FileToolsOptions.CorsBehavior=e}static get UseFallbackTexture(){return u.EngineStore.UseFallbackTexture}static set UseFallbackTexture(e){u.EngineStore.UseFallbackTexture=e}static get RegisteredExternalClasses(){return g.InstantiationTools.RegisteredExternalClasses}static set RegisteredExternalClasses(e){g.InstantiationTools.RegisteredExternalClasses=e}static get fallbackTexture(){return u.EngineStore.FallbackTexture}static set fallbackTexture(e){u.EngineStore.FallbackTexture=e}static FetchToRef(e,t,r,a,o,s){let n=((Math.abs(e)*r%r|0)+(Math.abs(t)*a%a|0)*r)*4;s.r=o[n]/255,s.g=o[n+1]/255,s.b=o[n+2]/255,s.a=o[n+3]/255}static Mix(e,t,r){return 0}static Instantiate(e){return g.InstantiationTools.Instantiate(e)}static SetImmediate(e){d.TimingTools.SetImmediate(e)}static IsExponentOfTwo(e){return!0}static FloatRound(e){return Math.fround(e)}static GetFilename(e){let t=e.lastIndexOf("/");return t<0?e:e.substring(t+1)}static GetFolderPath(e,t=!1){let r=e.lastIndexOf("/");return r<0?t?e:"":e.substring(0,r+1)}static ToDegrees(e){return 180*e/Math.PI}static ToRadians(e){return e*Math.PI/180}static SmoothAngleChange(e,t,r=.9){let a=this.ToRadians(e),o=this.ToRadians(t);return this.ToDegrees(Math.atan2((1-r)*Math.sin(o)+r*Math.sin(a),(1-r)*Math.cos(o)+r*Math.cos(a)))}static MakeArray(e,t){return!0!==t&&(void 0===e||null==e)?null:Array.isArray(e)?e:[e]}static GetPointerPrefix(e){return(0,a.IsWindowObjectExist)()&&!window.PointerEvent?"mouse":"pointer"}static SetCorsBehavior(e,t){(0,f.SetCorsBehavior)(e,t)}static SetReferrerPolicyBehavior(e,t){t.referrerPolicy=e}static get PreprocessUrl(){return f.FileToolsOptions.PreprocessUrl}static set PreprocessUrl(e){f.FileToolsOptions.PreprocessUrl=e}static LoadImage(e,t,r,a,o,s){return(0,f.LoadImage)(e,t,r,a,o,s)}static LoadFile(e,t,r,a,o,s){return(0,f.LoadFile)(e,t,r,a,o,s)}static async LoadFileAsync(e,t=!0){return await new Promise((r,a)=>{(0,f.LoadFile)(e,e=>{r(e)},void 0,void 0,t,(e,t)=>{a(t)})})}static GetAssetUrl(e){if(!e)return"";if(t.AssetBaseUrl&&e.startsWith(t._DefaultAssetsUrl)){let r=t.AssetBaseUrl.endsWith("/")?t.AssetBaseUrl.slice(0,-1):t.AssetBaseUrl;return e.replace(t._DefaultAssetsUrl,r)}return e}static GetBabylonScriptURL(e,r){if(!e)return"";if(e.startsWith(t._DefaultCdnUrl)){if(t.ScriptBaseUrl){let r=t.ScriptBaseUrl.endsWith("/")?t.ScriptBaseUrl.slice(0,-1):t.ScriptBaseUrl;e=e.replace(t._DefaultCdnUrl,r)}else if(t._CdnVersion){let r=`${t._DefaultCdnUrl}/v${t._CdnVersion}`;e.startsWith(r)||(e=e.replace(t._DefaultCdnUrl,r))}}return e=t.ScriptPreprocessUrl(e),r&&!t.IsAbsoluteUrl(e)&&(e=t.GetAbsoluteUrl(e)),e}static LoadBabylonScript(e,r,a,o){e=t.GetBabylonScriptURL(e),t.LoadScript(e,r,a)}static async LoadBabylonScriptAsync(e){return e=t.GetBabylonScriptURL(e),await t.LoadScriptAsync(e)}static _LoadScriptNative(e,r,a){_native&&t.LoadFile(e,e=>{try{Function(e).apply(null),r&&r()}catch(e){a&&a("LoadScript Error",e)}},void 0,void 0,!1,(e,t)=>{a&&a("LoadScript Error",t)})}static _LoadScriptWeb(e,t,r,o,s=!1){if("function"==typeof importScripts){try{importScripts(e),t&&t()}catch(t){r?.(`Unable to load script '${e}' in worker`,t)}return}if(!(0,a.IsWindowObjectExist)())return void r?.(`Cannot load script '${e}' outside of a window or a worker`);let n=document.getElementsByTagName("head")[0],i=document.createElement("script");s?(i.setAttribute("type","module"),i.innerText=e):(i.setAttribute("type","text/javascript"),i.setAttribute("src",e)),o&&(i.id=o),i.onload=()=>{t&&t()},i.onerror=t=>{r&&r(`Unable to load script '${e}'`,t)},n.appendChild(i)}static async LoadScriptAsync(e,t){return await new Promise((r,a)=>{this.LoadScript(e,()=>{r()},(e,t)=>{a(t||Error(e))},t)})}static ReadFileAsDataURL(e,t,a){let o=new FileReader,s={onCompleteObservable:new r.Observable,abort:()=>o.abort()};return o.onloadend=()=>{s.onCompleteObservable.notifyObservers(s)},o.onload=e=>{t(e.target.result)},o.onprogress=a,o.readAsDataURL(e),s}static ReadFile(e,t,r,a,o){return(0,f.ReadFile)(e,t,r,a,o)}static FileAsURL(e){let t=new Blob([e]);return window.URL.createObjectURL(t)}static Format(e,t=2){return e.toFixed(t)}static DeepCopy(e,t,r,a){n.DeepCopy(e,t,r,a)}static IsEmpty(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}static RegisterTopRootEvents(e,t){for(let r=0;r<t.length;r++){let a=t[r];e.addEventListener(a.name,a.handler,!1);try{window.parent&&window.parent.addEventListener(a.name,a.handler,!1)}catch(e){}}}static UnregisterTopRootEvents(e,t){for(let r=0;r<t.length;r++){let a=t[r];e.removeEventListener(a.name,a.handler);try{e.parent&&e.parent.removeEventListener(a.name,a.handler)}catch(e){}}}static async DumpFramebuffer(e,t,r,a,o="image/png",s,n){throw(0,l._WarnImport)("DumpTools")}static DumpData(e,t,r,a,o="image/png",s,n=!1,i=!1,c){throw(0,l._WarnImport)("DumpTools")}static async DumpDataAsync(e,t,r,a="image/png",o,s=!1,n=!1,i){throw(0,l._WarnImport)("DumpTools")}static _IsOffScreenCanvas(e){return void 0!==e.convertToBlob}static ToBlob(e,r,a="image/png",o){t._IsOffScreenCanvas(e)||e.toBlob||(e.toBlob=function(e,t,r){setTimeout(()=>{let a=atob(this.toDataURL(t,r).split(",")[1]),o=a.length,s=new Uint8Array(o);for(let e=0;e<o;e++)s[e]=a.charCodeAt(e);e(new Blob([s]))})}),t._IsOffScreenCanvas(e)?e.convertToBlob({type:a,quality:o}).then(e=>r(e)):e.toBlob(function(e){r(e)},a,o)}static DownloadBlob(e,r){if("download"in document.createElement("a")){if(!r){let e=new Date;r="screenshot_"+((e.getFullYear()+"-"+(e.getMonth()+1)).slice(2)+"-"+e.getDate()+"_"+e.getHours()+"-")+("0"+e.getMinutes()).slice(-2)+".png"}t.Download(e,r)}else if(e&&"u">typeof URL){let t=URL.createObjectURL(e),r=window.open("");if(!r)return;let a=r.document.createElement("img");a.onload=function(){URL.revokeObjectURL(t)},a.src=t,r.document.body.appendChild(a)}}static EncodeScreenshotCanvasData(e,r,a="image/png",o,s){if("string"!=typeof o&&r){if(r){if(t._IsOffScreenCanvas(e))return void e.convertToBlob({type:a,quality:s}).then(e=>{let t=new FileReader;t.readAsDataURL(e),t.onloadend=()=>{r(t.result)}});r(e.toDataURL(a,s))}}else this.ToBlob(e,function(e){e&&t.DownloadBlob(e,o),r&&r("")},a,s)}static Download(e,t){if("u"<typeof URL)return;let r=window.URL.createObjectURL(e),a=document.createElement("a");document.body.appendChild(a),a.style.display="none",a.href=r,a.download=t,a.addEventListener("click",()=>{a.parentElement&&a.parentElement.removeChild(a)}),a.click(),window.URL.revokeObjectURL(r)}static BackCompatCameraNoPreventDefault(e){return"boolean"==typeof e[0]?e[0]:"boolean"==typeof e[1]&&e[1]}static CreateScreenshot(e,t,r,a,o="image/png",s=!1,n){throw(0,l._WarnImport)("ScreenshotTools")}static async CreateScreenshotAsync(e,t,r,a="image/png",o){throw(0,l._WarnImport)("ScreenshotTools")}static CreateScreenshotUsingRenderTarget(e,t,r,a,o="image/png",s=1,n=!1,i,c=!1,u=!1,f=!0,d,g){throw(0,l._WarnImport)("ScreenshotTools")}static async CreateScreenshotUsingRenderTargetAsync(e,t,r,a="image/png",o=1,s=!1,n,i=!1,c=!1,u=!0,f,d){throw(0,l._WarnImport)("ScreenshotTools")}static RandomId(){return(0,p.RandomGUID)()}static IsBase64(e){return(0,f.IsBase64DataUrl)(e)}static DecodeBase64(e){return(0,f.DecodeBase64UrlToBinary)(e)}static get errorsCount(){return o.Logger.errorsCount}static Log(e){o.Logger.Log(e)}static Warn(e){o.Logger.Warn(e)}static Error(e){o.Logger.Error(e)}static get LogCache(){return o.Logger.LogCache}static ClearLogCache(){o.Logger.ClearLogCache()}static set LogLevels(e){o.Logger.LogLevels=e}static set PerformanceLogLevel(e){(e&t.PerformanceUserMarkLogLevel)===t.PerformanceUserMarkLogLevel?_native?.enablePerformanceLogging?(_native.enablePerformanceLogging(1),t.StartPerformanceCounter=t._StartMarkNative,t.EndPerformanceCounter=t._EndMarkNative):(t.StartPerformanceCounter=t._StartUserMark,t.EndPerformanceCounter=t._EndUserMark):(e&t.PerformanceConsoleLogLevel)===t.PerformanceConsoleLogLevel?_native?.enablePerformanceLogging?(_native.enablePerformanceLogging(2),t.StartPerformanceCounter=t._StartMarkNative,t.EndPerformanceCounter=t._EndMarkNative):(t.StartPerformanceCounter=t._StartPerformanceConsole,t.EndPerformanceCounter=t._EndPerformanceConsole):(t.StartPerformanceCounter=t._StartPerformanceCounterDisabled,t.EndPerformanceCounter=t._EndPerformanceCounterDisabled,_native?.disablePerformanceLogging?.())}static _StartPerformanceCounterDisabled(e,t){}static _EndPerformanceCounterDisabled(e,t){}static _StartUserMark(e,r=!0){if(!t._Performance){if(!(0,a.IsWindowObjectExist)())return;t._Performance=window.performance}r&&t._Performance.mark&&t._Performance.mark(e+"-Begin")}static _EndUserMark(e,r=!0){r&&t._Performance.mark&&(t._Performance.mark(e+"-End"),t._Performance.measure(e,e+"-Begin",e+"-End"))}static _StartPerformanceConsole(e,r=!0){r&&(t._StartUserMark(e,r),console.time&&console.time(e))}static _EndPerformanceConsole(e,r=!0){r&&(t._EndUserMark(e,r),console.timeEnd(e))}static _StartMarkNative(e,r=!0){if(r&&_native?.startPerformanceCounter)if(t._NativePerformanceCounterHandles.has(e))t.Warn(`Performance counter with name ${e} is already started.`);else{let r=_native.startPerformanceCounter(e);t._NativePerformanceCounterHandles.set(e,r)}}static _EndMarkNative(e,r=!0){if(r&&_native?.endPerformanceCounter){let r=t._NativePerformanceCounterHandles.get(e);r?(_native.endPerformanceCounter(r),t._NativePerformanceCounterHandles.delete(e)):t.Warn(`Performance counter with name ${e} was not started.`)}}static get Now(){return i.PrecisionDate.Now}static GetClassName(e,t=!1){let r=null;return!t&&e.getClassName?r=e.getClassName():(e instanceof Object&&(r=(t?e:Object.getPrototypeOf(e)).constructor.__bjsclassName__),r||(r=typeof e)),r}static First(e,t){for(let r of e)if(t(r))return r;return null}static getFullClassName(e,t=!1){let r=null,a=null;if(!t&&e.getClassName)r=e.getClassName();else{if(e instanceof Object){let o=t?e:Object.getPrototypeOf(e);r=o.constructor.__bjsclassName__,a=o.constructor.__bjsmoduleName__}r||(r=typeof e)}return r?(null!=a?a+".":"")+r:null}static async DelayAsync(e){await new Promise(t=>{setTimeout(()=>{t()},e)})}static IsSafari(){return!!(0,a.IsNavigatorAvailable)()&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}t=m,m.AssetBaseUrl="",m.UseCustomRequestHeaders=!1,m.CustomRequestHeaders=c.WebRequest.CustomRequestHeaders,m.GetDOMTextContent=a.GetDOMTextContent,m._DefaultCdnUrl="https://cdn.babylonjs.com",m._CdnVersion="9.13.0",m._DefaultAssetsUrl="https://assets.babylonjs.com/core",m.LoadScript="u"<typeof _native?t._LoadScriptWeb:t._LoadScriptNative,m.GetAbsoluteUrl="object"==typeof document?e=>{let t=document.createElement("a");return t.href=e,t.href}:"function"==typeof URL&&"object"==typeof location?e=>new URL(e,location.origin).href:()=>{throw Error("Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.")},m.NoneLogLevel=o.Logger.NoneLogLevel,m.MessageLogLevel=o.Logger.MessageLogLevel,m.WarningLogLevel=o.Logger.WarningLogLevel,m.ErrorLogLevel=o.Logger.ErrorLogLevel,m.AllLogLevel=o.Logger.AllLogLevel,m.IsWindowObjectExist=a.IsWindowObjectExist,m.PerformanceNoneLogLevel=0,m.PerformanceUserMarkLogLevel=1,m.PerformanceConsoleLogLevel=2,m._NativePerformanceCounterHandles=new Map,m.StartPerformanceCounter=t._StartPerformanceCounterDisabled,m.EndPerformanceCounter=t._EndPerformanceCounterDisabled;class h{constructor(e,t,r,a=0){this.iterations=e,this.index=a-1,this._done=!1,this._fn=t,this._successCallback=r}executeNext(){this._done||(this.index+1<this.iterations?(++this.index,this._fn(this)):this.breakLoop())}breakLoop(){this._done=!0,this._successCallback()}static Run(e,t,r,a=0){let o=new h(e,t,r,a);return o.executeNext(),o}static SyncAsyncForLoop(e,t,r,a,o,s=0){return h.Run(Math.ceil(e/t),a=>{o&&o()?a.breakLoop():setTimeout(()=>{for(let s=0;s<t;++s){let n=a.index*t+s;if(n>=e)break;if(r(n),o&&o()){a.breakLoop();break}}a.executeNext()},s)},a)}}e.s(["AsyncLoop",0,h,"Tools",0,m],65740)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62238,42279,t=>{"use strict";let e=1/1.2;t.s(["ZOOM_IN_FACTOR",0,e,"ZOOM_OUT_FACTOR",0,1.2,"disableWheelZoom",0,function(t){t.inputs.removeByType("ArcRotateCameraMouseWheelInput")},"stepZoom",0,function(t,e){let s=t.lowerRadiusLimit??.01,a=t.upperRadiusLimit??1/0;t.radius=Math.min(a,Math.max(s,t.radius*e))}],62238);var s=t.i(29212);t.s(["ZoomButtons",0,function({onZoom:t}){let a="grid h-8 w-8 place-items-center rounded-md border border-edge bg-ink/80 text-lg leading-none text-fg backdrop-blur transition hover:bg-ink hover:text-white";return(0,s.jsxs)("div",{className:"absolute right-3 top-3 flex flex-col gap-1",children:[(0,s.jsx)("button",{type:"button","aria-label":"Zoom in",className:a,onClick:()=>t(e),children:"+"}),(0,s.jsx)("button",{type:"button","aria-label":"Zoom out",className:a,onClick:()=>t(1.2),children:"−"})]})}],42279)},59683,37660,t=>{"use strict";t.s(["attachMeshHover",0,function(t,e,s){let a=0,n=null,i=e=>{let i=e.offsetX,r=e.offsetY;a||(a=requestAnimationFrame(()=>{var e,l;let c;a=0;let o=t.pick(i,r,t=>t.isPickable&&t.isEnabled()),h=o?.pickedMesh?(e=o.pickedMesh,l=o.thinInstanceIndex??-1,(c=e.metadata)?l>=0&&c.hoverLabels?c.hoverLabels[l]??null:c.hoverLabel??null:null):null;h?s({label:h,x:i,y:r}):null!==n&&s(null),n=h}))},r=()=>{a&&(cancelAnimationFrame(a),a=0),null!==n&&(n=null,s(null))};return e.addEventListener("pointermove",i),e.addEventListener("pointerleave",r),()=>{e.removeEventListener("pointermove",i),e.removeEventListener("pointerleave",r),a&&cancelAnimationFrame(a)}}],59683);var e=t.i(29212),s=t.i(56054);t.s(["HeatLegend",0,function({title:t,lowLabel:a="low",highLabel:n="high",note:i}){return(0,e.jsxs)("div",{className:"pointer-events-none absolute bottom-3 left-3 rounded-md border border-edge bg-ink/80 px-3 py-2 text-fg backdrop-blur-sm",children:[(0,e.jsx)("div",{className:"mb-1 text-xs font-medium text-fg",children:t}),(0,e.jsx)("div",{className:"h-2 w-36 rounded-sm",style:{background:s.HEAT_GRADIENT}}),(0,e.jsxs)("div",{className:"mt-1 flex w-36 justify-between text-[10px] text-fg-muted",children:[(0,e.jsx)("span",{children:a}),(0,e.jsx)("span",{children:n})]}),i?(0,e.jsx)("div",{className:"mt-1 max-w-44 text-[10px] leading-tight text-fg-muted",children:i}):null]})}],37660)},38413,t=>{"use strict";var e=t.i(29212),s=t.i(94179),a=t.i(56054),n=t.i(62238),i=t.i(59683),r=t.i(37660),l=t.i(93425),c=t.i(42279);function o({shape:t,onChange:s}){let a=t=>`h-8 px-2.5 text-xs font-medium leading-none transition first:rounded-l-md last:rounded-r-md ${t?"bg-ink text-white":"bg-ink/80 text-fg hover:text-white"}`,n="sphere"===t,i="cube"===t;return(0,e.jsxs)("div",{className:"absolute left-3 top-3 flex overflow-hidden rounded-md border border-edge backdrop-blur",role:"group","aria-label":"Voxel marker shape",children:[(0,e.jsx)("button",{type:"button",className:a(n),"aria-pressed":n,onClick:()=>s("sphere"),children:"Spheres"}),(0,e.jsx)("button",{type:"button",className:a(i),"aria-pressed":i,onClick:()=>s("cube"),children:"Cubes"})]})}t.s(["WorldHeatmap3D",0,function({voxels:h,cellSize:u,proxyMeshes:d=[],title:m="World heatmap (3D)",subtitle:j="Pointer hit-points voxel-binned in world space — drag to orbit, +/- to zoom",legendTitle:k="Pointer-hit density",legendLow:f="few hits",legendHigh:b="most hits",legendNote:v="Each marker is a voxel where the pointer hit your scene. Color & size scale with hits, normalized to the busiest cell.",emptyLabel:x="No 3D hit-points in range."}){let p=(0,s.useRef)(null),y=(0,s.useRef)(null),[g,w]=(0,s.useState)("loading"),[z,q]=(0,s.useState)(null),[A,M]=(0,s.useState)("sphere"),[_,C]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=p.current;if(!e)return;if(0===h.length&&0===d.length)return void w("empty");let s=!1,r=null;return w("loading"),q(null),(async()=>{try{let[{Engine:l},{Scene:c},{ArcRotateCamera:o},{HemisphericLight:m},{Vector3:j,Color3:k,Color4:f,Matrix:b},{MeshBuilder:v},{StandardMaterial:x}]=await Promise.all([t.A(66022),t.A(48505),t.A(53976),t.A(42436),t.A(89370),t.A(67141),t.A(20693),t.A(9607),t.A(96664)]);if(s)return;let p=h.reduce((t,e)=>Math.max(t,e.count),1),g=0,z=0,q=0,M=0;for(let t of h)g+=(t.vx+.5)*u,z+=(t.vy+.5)*u,q+=(t.vz+.5)*u,M++;if(0===M)for(let t of d)g+=(t.aabb[0]+t.aabb[3])/2,z+=(t.aabb[1]+t.aabb[4])/2,q+=(t.aabb[2]+t.aabb[5])/2,M++;let _=new j(g/M,z/M,q/M),P=4*u;for(let t of h){let e=(t.vx+.5)*u-_.x,s=(t.vy+.5)*u-_.y,a=(t.vz+.5)*u-_.z;P=Math.max(P,Math.sqrt(e*e+s*s+a*a))}for(let t of d){let e=(t.aabb[0]+t.aabb[3])/2-_.x,s=(t.aabb[1]+t.aabb[4])/2-_.y,a=(t.aabb[2]+t.aabb[5])/2-_.z;P=Math.max(P,Math.sqrt(e*e+s*s+a*a))}let L=new l(e,!0,{preserveDrawingBuffer:!1}),N=new c(L);N.clearColor=new f(.04,.05,.07,1);let R=new o("world-cam",Math.PI/4,Math.PI/3,2.4*P,_,N);if(R.attachControl(e,!0),(0,n.disableWheelZoom)(R),y.current=R,new m("world-light",new j(.4,1,.3),N),d.length>0){let t=v.CreateBox("scene-proxy",{size:1},N),e=new x("scene-proxy-mat",N);e.wireframe=!0,e.disableLighting=!0,e.emissiveColor=new k(.32,.4,.52),e.alpha=.35,t.material=e,t.isPickable=!0,t.thinInstanceEnablePicking=!0,t.metadata={hoverLabels:d.map(t=>t.name)};let s=d.length,a=new Float32Array(16*s);for(let t=0;t<s;t++){let e=d[t].aabb,s=Math.max(e[3]-e[0],.001),n=Math.max(e[4]-e[1],.001),i=Math.max(e[5]-e[2],.001);b.Scaling(s,n,i).multiply(b.Translation((e[0]+e[3])/2,(e[1]+e[4])/2,(e[2]+e[5])/2)).copyToArray(a,16*t)}t.thinInstanceSetBuffer("matrix",a,16,!0)}if(h.length>0){let t="cube"===A?v.CreateBox("world-voxel",{size:.9*u},N):v.CreateSphere("world-voxel",{diameter:.9*u,segments:6},N),e=new x("world-voxel-mat",N);e.diffuseColor=new k(1,1,1),e.specularColor=new k(0,0,0),t.material=e;let s=h.length,n=new Float32Array(16*s),i=new Float32Array(4*s),r=new Float32Array(s),l=Math.max(.02*P,.25*u)/(.9*u);for(let t=0;t<s;t++){let e=h[t],s=e.count/p,c=l*(.5+.5*s);r[t]=c,b.Scaling(c,c,c).multiply(b.Translation((e.vx+.5)*u,(e.vy+.5)*u,(e.vz+.5)*u)).copyToArray(n,16*t);let[o,d,m]=(0,a.heatRgb)(s);i[4*t]=o,i[4*t+1]=d,i[4*t+2]=m,i[4*t+3]=1}t.thinInstanceSetBuffer("matrix",n,16,!1),t.thinInstanceSetBuffer("color",i,4,!0);let c=R.radius,o=0,d=()=>{let e=Math.min(8,Math.max(.6,R.radius/c));if(!(.01>Math.abs(e-o))){o=e;for(let t=0;t<s;t++){let s=r[t]*e,a=16*t;n[a]=s,n[a+5]=s,n[a+10]=s}t.thinInstanceBufferUpdated("matrix")}};d(),N.onBeforeRenderObservable.add(d)}L.runRenderLoop(()=>N.render());let T=()=>L.resize();window.addEventListener("resize",T);let B=(0,i.attachMeshHover)(N,e,C);w("ready"),r=()=>{window.removeEventListener("resize",T),B(),C(null),y.current=null,N.dispose(),L.dispose()}}catch(t){if(s)return;w("error"),q(t instanceof Error?t.message:"Failed to render heatmap.")}})(),()=>{s=!0,r?.()}},[h,u,d,A]),(0,e.jsx)(l.Panel,{title:m,subtitle:j,children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("canvas",{ref:p,className:"aspect-video w-full rounded-lg border border-edge bg-ink"}),_?(0,e.jsx)("div",{className:"pointer-events-none absolute z-10 max-w-[16rem] truncate rounded border border-edge bg-ink/90 px-1.5 py-0.5 text-xs text-white shadow backdrop-blur",style:{left:_.x+12,top:_.y+12},children:_.label}):null,"ready"===g?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o,{shape:A,onChange:M}),(0,e.jsx)(c.ZoomButtons,{onZoom:t=>y.current&&(0,n.stepZoom)(y.current,t)}),(0,e.jsx)(r.HeatLegend,{title:k,lowLabel:f,highLabel:b,note:v})]}):(0,e.jsx)("div",{className:"pointer-events-none absolute inset-0 grid place-items-center text-sm text-fg-muted",children:"loading"===g?"Rendering…":"empty"===g?x:"error"===g?z??"Heatmap unavailable.":null})]})})}])},25453,t=>{t.n(t.i(38413))},66022,t=>{t.v(e=>Promise.all(["static/chunks/0ys9-ozuluawt.js","static/chunks/2ycvtdd68gub7.js","static/chunks/0v82oqyoy9zol.js","static/chunks/18u58lorfahxi.js","static/chunks/1nj82er7msdto.js","static/chunks/0ufbyo1x3qkmo.js","static/chunks/1yehxf-fmeicg.js"].map(e=>t.l(e))).then(()=>e(94080)))},48505,t=>{t.v(e=>Promise.all(["static/chunks/3v5ha25nxo43j.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3t06schbtqonl.js","static/chunks/1nj82er7msdto.js","static/chunks/3nz-dh9d7cehk.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2u6shh3oeycm-.js"].map(e=>t.l(e))).then(()=>e(73073)))},53976,t=>{t.v(e=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/10r_824wzt8hj.js","static/chunks/2aor7m-wbis85.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/0v82oqyoy9zol.js","static/chunks/25b9x-li-tvk2.js","static/chunks/2aelw3far6rii.js","static/chunks/0aznt7717miff.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/3t06schbtqonl.js","static/chunks/18u58lorfahxi.js"].map(e=>t.l(e))).then(()=>e(18662)))},42436,t=>{t.v(e=>Promise.all(["static/chunks/37vzwr3ciejf1.js","static/chunks/157d9euci08yu.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(e=>t.l(e))).then(()=>e(12847)))},89370,t=>{t.v(e=>Promise.all(["static/chunks/0dm32-jq30tg8.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(e=>t.l(e))).then(()=>e(62566)))},67141,t=>{t.v(e=>Promise.all(["static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3mqy-84_ul3t2.js","static/chunks/1_aahautsz2v_.js","static/chunks/3t06schbtqonl.js","static/chunks/1thjncpj7u6pq.js","static/chunks/10r_824wzt8hj.js","static/chunks/1vdjn0pkoyypn.js","static/chunks/1nj82er7msdto.js","static/chunks/0aznt7717miff.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2aelw3far6rii.js","static/chunks/3nz-dh9d7cehk.js"].map(e=>t.l(e))).then(()=>e(97998)))},20693,t=>{t.v(e=>Promise.all(["static/chunks/1-61zh4waha61.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/1zx2q-r32thv1.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3nz-dh9d7cehk.js","static/chunks/2u6shh3oeycm-.js","static/chunks/18u58lorfahxi.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/3t06schbtqonl.js"].map(e=>t.l(e))).then(()=>e(32550)))},9607,t=>{t.v(e=>Promise.all(["static/chunks/2szdcpl41-kzv.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/3t06schbtqonl.js","static/chunks/10r_824wzt8hj.js","static/chunks/0aznt7717miff.js","static/chunks/1_aahautsz2v_.js","static/chunks/1nj82er7msdto.js","static/chunks/2aelw3far6rii.js","static/chunks/18u58lorfahxi.js","static/chunks/0v82oqyoy9zol.js"].map(e=>t.l(e))).then(()=>e(26831)))},96664,t=>{t.v(e=>Promise.all(["static/chunks/1o1d0p-v1z8ty.js","static/chunks/3v3-7fio3nw_t.js","static/chunks/0v82oqyoy9zol.js","static/chunks/3t06schbtqonl.js","static/chunks/3pufs8g4ui943.js","static/chunks/1nj82er7msdto.js","static/chunks/2-sjjedfr0kfq.js","static/chunks/18u58lorfahxi.js","static/chunks/2u6shh3oeycm-.js","static/chunks/3nz-dh9d7cehk.js"].map(e=>t.l(e))).then(()=>e(44981)))}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18662,t=>{"use strict";var e,i,a=t.i(10272),s=t.i(37143),n=t.i(99267),o=t.i(96265),r=t.i(46703),h=t.i(34548),l=t.i(40408),u=t.i(21222),c=t.i(36395),_=t.i(89030);class p{constructor(){this._zoomStopsAnimation=!1,this._idleRotationSpeed=.05,this._idleRotationWaitTime=2e3,this._idleRotationSpinupTime=2e3,this.targetAlpha=null,this._attachedCamera=null,this._isPointerDown=!1,this._lastFrameTime=null,this._lastInteractionTime=-1/0,this._cameraRotationSpeed=0,this._lastFrameRadius=0}get name(){return"AutoRotation"}set zoomStopsAnimation(t){this._zoomStopsAnimation=t}get zoomStopsAnimation(){return this._zoomStopsAnimation}set idleRotationSpeed(t){this._idleRotationSpeed=t}get idleRotationSpeed(){return this._idleRotationSpeed}set idleRotationWaitTime(t){this._idleRotationWaitTime=t}get idleRotationWaitTime(){return this._idleRotationWaitTime}set idleRotationSpinupTime(t){this._idleRotationSpinupTime=t}get idleRotationSpinupTime(){return this._idleRotationSpinupTime}get rotationInProgress(){return Math.abs(this._cameraRotationSpeed)>0}get attachedNode(){return this._attachedCamera}init(){}attach(t){this._attachedCamera=t;let e=this._attachedCamera.getScene();this._onPrePointerObservableObserver=e.onPrePointerObservable.add(t=>{if(t.type===u.PointerEventTypes.POINTERDOWN){this._isPointerDown=!0;return}t.type===u.PointerEventTypes.POINTERUP&&(this._isPointerDown=!1)}),this._onAfterCheckInputsObserver=t.onAfterCheckInputsObservable.add(()=>{if(this._reachTargetAlpha())return;let t=c.PrecisionDate.Now,e=0;null!=this._lastFrameTime&&(e=t-this._lastFrameTime),this._lastFrameTime=t,this._applyUserInteraction();let i=Math.max(Math.min((t-this._lastInteractionTime-this._idleRotationWaitTime)/this._idleRotationSpinupTime,1),0);this._cameraRotationSpeed=this._idleRotationSpeed*i,this._attachedCamera&&(this._attachedCamera.alpha-=this._cameraRotationSpeed*(e/1e3))})}detach(){if(!this._attachedCamera)return;let t=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&t.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._attachedCamera=null,this._lastFrameTime=null}resetLastInteractionTime(t){this._lastInteractionTime=t??c.PrecisionDate.Now}_reachTargetAlpha(){return!!this._attachedCamera&&!!this.targetAlpha&&Math.abs(this._attachedCamera.alpha-this.targetAlpha)<_.Epsilon}_userIsZooming(){return!!this._attachedCamera&&0!==this._attachedCamera.inertialRadiusOffset}_shouldAnimationStopForInteraction(){if(!this._attachedCamera)return!1;let t=!1;return this._lastFrameRadius===this._attachedCamera.radius&&0!==this._attachedCamera.inertialRadiusOffset&&(t=!0),this._lastFrameRadius=this._attachedCamera.radius,this._zoomStopsAnimation?t:this._userIsZooming()}_applyUserInteraction(){this._userIsMoving()&&!this._shouldAnimationStopForInteraction()&&(this._lastInteractionTime=c.PrecisionDate.Now)}_userIsMoving(){return!!this._attachedCamera&&(0!==this._attachedCamera.inertialAlphaOffset||0!==this._attachedCamera.inertialBetaOffset||0!==this._attachedCamera.inertialRadiusOffset||0!==this._attachedCamera.inertialPanningX||0!==this._attachedCamera.inertialPanningY||this._isPointerDown)}}t.i(75991);class d{constructor(){this._easingMode=d.EASINGMODE_EASEIN}setEasingMode(t){let e=Math.min(Math.max(t,0),2);this._easingMode=e}getEasingMode(){return this._easingMode}easeInCore(t){throw Error("You must implement this method")}ease(t){switch(this._easingMode){case d.EASINGMODE_EASEIN:return this.easeInCore(t);case d.EASINGMODE_EASEOUT:return 1-this.easeInCore(1-t)}return t>=.5?(1-this.easeInCore((1-t)*2))*.5+.5:.5*this.easeInCore(2*t)}}d.EASINGMODE_EASEIN=0,d.EASINGMODE_EASEOUT=1,d.EASINGMODE_EASEINOUT=2;var m=t.i(70653);class g{constructor(t,e,i){this.name=t,this.from=e,this.to=i}clone(){return new g(this.name,this.from,this.to)}}var O=t.i(54361);t.i(65295);let f=Object.freeze(new o.Quaternion(0,0,0,0)),T=Object.freeze(o.Vector3.Zero()),A=Object.freeze(o.Vector2.Zero()),I=Object.freeze(O.Size.Zero()),y=Object.freeze(m.Color3.Black()),M=Object.freeze(new m.Color4(0,0,0,0)),v={key:0,repeatCount:0,loopMode:2};class P{static _PrepareAnimation(t,e,i,a,s,n,r,h){let l;if(!isNaN(parseFloat(s))&&isFinite(s)?l=P.ANIMATIONTYPE_FLOAT:s instanceof o.Quaternion?l=P.ANIMATIONTYPE_QUATERNION:s instanceof o.Vector3?l=P.ANIMATIONTYPE_VECTOR3:s instanceof o.Vector2?l=P.ANIMATIONTYPE_VECTOR2:s instanceof m.Color3?l=P.ANIMATIONTYPE_COLOR3:s instanceof m.Color4?l=P.ANIMATIONTYPE_COLOR4:s instanceof O.Size&&(l=P.ANIMATIONTYPE_SIZE),void 0==l)return null;let u=new P(t,e,i,l,r);return u.setKeys([{frame:0,value:s},{frame:a,value:n}]),void 0!==h&&u.setEasingFunction(h),u}get runtimeAnimations(){return this._runtimeAnimations}get hasRunningRuntimeAnimations(){for(let t of this._runtimeAnimations)if(!t.isStopped())return!0;return!1}constructor(t,e,i,a,s,n){this.name=t,this.targetProperty=e,this.framePerSecond=i,this.dataType=a,this.loopMode=s,this.enableBlending=n,this._easingFunction=null,this._runtimeAnimations=[],this._events=[],this.blendingSpeed=.01,this._ranges={},this._coreAnimation=null,this.targetPropertyPath=e.split("."),this.dataType=a,this.loopMode=void 0===s?P.ANIMATIONLOOPMODE_CYCLE:s,this.uniqueId=P._UniqueIdGenerator++}toString(t){let e="Name: "+this.name+", property: "+this.targetProperty;if(e+=", datatype: "+["Float","Vector3","Quaternion","Matrix","Color3","Vector2"][this.dataType],e+=", nKeys: "+(this._keys?this._keys.length:"none"),e+=", nRanges: "+(this._ranges?Object.keys(this._ranges).length:"none"),t){e+=", Ranges: {";let t=!0;for(let i in this._ranges)t||(e+=", "),t=!1,e+=i;e+="}"}return e}addEvent(t){this._events.push(t),this._events.sort((t,e)=>t.frame-e.frame)}removeEvents(t){for(let e=0;e<this._events.length;e++)this._events[e].frame===t&&(this._events.splice(e,1),e--)}getEvents(){return this._events}createRange(t,e,i){this._ranges[t]||(this._ranges[t]=new g(t,e,i))}deleteRange(t,e=!0){let i=this._ranges[t];if(i){if(e){let t=i.from,e=i.to;for(let i=this._keys.length-1;i>=0;i--)this._keys[i].frame>=t&&this._keys[i].frame<=e&&this._keys.splice(i,1)}this._ranges[t]=null}}getRange(t){return this._ranges[t]}getKeys(){return this._keys}getHighestFrame(){let t=0;for(let e=0,i=this._keys.length;e<i;e++)t<this._keys[e].frame&&(t=this._keys[e].frame);return t}getEasingFunction(){return this._easingFunction}setEasingFunction(t){this._easingFunction=t}floatInterpolateFunction(t,e,i){return(0,r.Lerp)(t,e,i)}floatInterpolateFunctionWithTangents(t,e,i,a,s){return(0,r.Hermite)(t,e,i,a,s)}quaternionInterpolateFunction(t,e,i){return o.Quaternion.Slerp(t,e,i)}quaternionInterpolateFunctionWithTangents(t,e,i,a,s){return o.Quaternion.Hermite(t,e,i,a,s).normalize()}vector3InterpolateFunction(t,e,i){return o.Vector3.Lerp(t,e,i)}vector3InterpolateFunctionWithTangents(t,e,i,a,s){return o.Vector3.Hermite(t,e,i,a,s)}vector2InterpolateFunction(t,e,i){return o.Vector2.Lerp(t,e,i)}vector2InterpolateFunctionWithTangents(t,e,i,a,s){return o.Vector2.Hermite(t,e,i,a,s)}sizeInterpolateFunction(t,e,i){return O.Size.Lerp(t,e,i)}color3InterpolateFunction(t,e,i){return m.Color3.Lerp(t,e,i)}color3InterpolateFunctionWithTangents(t,e,i,a,s){return m.Color3.Hermite(t,e,i,a,s)}color4InterpolateFunction(t,e,i){return m.Color4.Lerp(t,e,i)}color4InterpolateFunctionWithTangents(t,e,i,a,s){return m.Color4.Hermite(t,e,i,a,s)}_getKeyValue(t){return"function"==typeof t?t():t}evaluate(t){return v.key=0,this._interpolate(t,v)}_interpolate(t,e,i=!1){let a;if(e.loopMode===P.ANIMATIONLOOPMODE_CONSTANT&&e.repeatCount>0)return e.highLimitValue.clone?e.highLimitValue.clone():e.highLimitValue;let s=this._keys;if(this._coreAnimation)a=this._coreAnimation._key;else{let n=s.length;for(a=e.key;a>=0&&t<s[a].frame;)--a;for(;a+1<=n-1&&t>=s[a+1].frame;)++a;if(e.key=a,a<0)return i?void 0:this._getKeyValue(s[0].value);if(a+1>n-1)return i?void 0:this._getKeyValue(s[n-1].value);this._key=a}let n=s[a],o=s[a+1];if(i&&(t===n.frame||t===o.frame))return;let r=this._getKeyValue(n.value),h=this._getKeyValue(o.value);if(1===n.interpolation)if(o.frame>t)return r;else return h;let l=void 0!==n.outTangent&&void 0!==o.inTangent,u=o.frame-n.frame,c=(t-n.frame)/u,_=n.easingFunction||this.getEasingFunction();switch(_&&(c=_.ease(c)),this.dataType){case P.ANIMATIONTYPE_FLOAT:{let t=l?this.floatInterpolateFunctionWithTangents(r,n.outTangent*u,h,o.inTangent*u,c):this.floatInterpolateFunction(r,h,c);switch(e.loopMode){case P.ANIMATIONLOOPMODE_CYCLE:case P.ANIMATIONLOOPMODE_CONSTANT:case P.ANIMATIONLOOPMODE_YOYO:return t;case P.ANIMATIONLOOPMODE_RELATIVE:case P.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return(e.offsetValue??0)*e.repeatCount+t}break}case P.ANIMATIONTYPE_QUATERNION:{let t=l?this.quaternionInterpolateFunctionWithTangents(r,n.outTangent.scale(u),h,o.inTangent.scale(u),c):this.quaternionInterpolateFunction(r,h,c);switch(e.loopMode){case P.ANIMATIONLOOPMODE_CYCLE:case P.ANIMATIONLOOPMODE_CONSTANT:case P.ANIMATIONLOOPMODE_YOYO:break;case P.ANIMATIONLOOPMODE_RELATIVE:case P.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return t.addInPlace((e.offsetValue||f).scale(e.repeatCount))}return t}case P.ANIMATIONTYPE_VECTOR3:{let t=l?this.vector3InterpolateFunctionWithTangents(r,n.outTangent.scale(u),h,o.inTangent.scale(u),c):this.vector3InterpolateFunction(r,h,c);switch(e.loopMode){case P.ANIMATIONLOOPMODE_CYCLE:case P.ANIMATIONLOOPMODE_CONSTANT:case P.ANIMATIONLOOPMODE_YOYO:return t;case P.ANIMATIONLOOPMODE_RELATIVE:case P.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return t.add((e.offsetValue||T).scale(e.repeatCount))}break}case P.ANIMATIONTYPE_VECTOR2:{let t=l?this.vector2InterpolateFunctionWithTangents(r,n.outTangent.scale(u),h,o.inTangent.scale(u),c):this.vector2InterpolateFunction(r,h,c);switch(e.loopMode){case P.ANIMATIONLOOPMODE_CYCLE:case P.ANIMATIONLOOPMODE_CONSTANT:case P.ANIMATIONLOOPMODE_YOYO:return t;case P.ANIMATIONLOOPMODE_RELATIVE:case P.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return t.add((e.offsetValue||A).scale(e.repeatCount))}break}case P.ANIMATIONTYPE_SIZE:switch(e.loopMode){case P.ANIMATIONLOOPMODE_CYCLE:case P.ANIMATIONLOOPMODE_CONSTANT:case P.ANIMATIONLOOPMODE_YOYO:return this.sizeInterpolateFunction(r,h,c);case P.ANIMATIONLOOPMODE_RELATIVE:case P.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return this.sizeInterpolateFunction(r,h,c).add((e.offsetValue||I).scale(e.repeatCount))}break;case P.ANIMATIONTYPE_COLOR3:{let t=l?this.color3InterpolateFunctionWithTangents(r,n.outTangent.scale(u),h,o.inTangent.scale(u),c):this.color3InterpolateFunction(r,h,c);switch(e.loopMode){case P.ANIMATIONLOOPMODE_CYCLE:case P.ANIMATIONLOOPMODE_CONSTANT:case P.ANIMATIONLOOPMODE_YOYO:return t;case P.ANIMATIONLOOPMODE_RELATIVE:case P.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return t.add((e.offsetValue||y).scale(e.repeatCount))}break}case P.ANIMATIONTYPE_COLOR4:{let t=l?this.color4InterpolateFunctionWithTangents(r,n.outTangent.scale(u),h,o.inTangent.scale(u),c):this.color4InterpolateFunction(r,h,c);switch(e.loopMode){case P.ANIMATIONLOOPMODE_CYCLE:case P.ANIMATIONLOOPMODE_CONSTANT:case P.ANIMATIONLOOPMODE_YOYO:return t;case P.ANIMATIONLOOPMODE_RELATIVE:case P.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return t.add((e.offsetValue||M).scale(e.repeatCount))}break}case P.ANIMATIONTYPE_MATRIX:switch(e.loopMode){case P.ANIMATIONLOOPMODE_CYCLE:case P.ANIMATIONLOOPMODE_CONSTANT:case P.ANIMATIONLOOPMODE_YOYO:if(P.AllowMatricesInterpolation)return this.matrixInterpolateFunction(r,h,c,e.workValue);return r;case P.ANIMATIONLOOPMODE_RELATIVE:case P.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT:return r}}return 0}matrixInterpolateFunction(t,e,i,a){return P.AllowMatrixDecomposeForInterpolation?a?(o.Matrix.DecomposeLerpToRef(t,e,i,a),a):o.Matrix.DecomposeLerp(t,e,i):a?(o.Matrix.LerpToRef(t,e,i,a),a):o.Matrix.Lerp(t,e,i)}clone(t=!1){let e=new P(this.name,this.targetPropertyPath.join("."),this.framePerSecond,this.dataType,this.loopMode);if(e.enableBlending=this.enableBlending,e.blendingSpeed=this.blendingSpeed,this._keys&&e.setKeys(this._keys,!1,t),this._ranges)for(let t in e._ranges={},this._ranges){let i=this._ranges[t];i&&(e._ranges[t]=i.clone())}return e}setKeys(t,e=!1,i=!1){if(e)this._keys=t;else if(this._keys=t.slice(0),i)for(let t=0;t<this._keys.length;t++){let e=this._keys[t];this._keys[t]={frame:e.frame,value:e.value.clone?e.value.clone():e.value,inTangent:e.inTangent&&e.inTangent.clone?e.inTangent.clone():e.inTangent,outTangent:e.outTangent&&e.outTangent.clone?e.outTangent.clone():e.outTangent,interpolation:e.interpolation,lockedTangent:e.lockedTangent,easingFunction:e.easingFunction}}}createKeyForFrame(t){v.key=0;let e=this._interpolate(t,v,!0);if(!e)return this._keys[v.key].frame===t?v.key:v.key+1;let i={frame:t,value:e.clone?e.clone():e};return this._keys.splice(v.key+1,0,i),v.key+1}serialize(){let 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;let e=this.dataType;t.keys=[];let i=this.getKeys();for(let a=0;a<i.length;a++){let s=i[a],n={};switch(n.frame=s.frame,e){case P.ANIMATIONTYPE_FLOAT:n.values=[s.value],void 0!==s.inTangent&&n.values.push(s.inTangent),void 0!==s.outTangent&&(void 0===s.inTangent&&n.values.push(void 0),n.values.push(s.outTangent)),void 0!==s.interpolation&&(void 0===s.inTangent&&n.values.push(void 0),void 0===s.outTangent&&n.values.push(void 0),n.values.push(s.interpolation));break;case P.ANIMATIONTYPE_QUATERNION:case P.ANIMATIONTYPE_MATRIX:case P.ANIMATIONTYPE_VECTOR3:case P.ANIMATIONTYPE_COLOR3:case P.ANIMATIONTYPE_COLOR4:n.values=s.value.asArray(),void 0!=s.inTangent&&n.values.push(s.inTangent.asArray()),void 0!=s.outTangent&&(void 0===s.inTangent&&n.values.push(void 0),n.values.push(s.outTangent.asArray())),void 0!==s.interpolation&&(void 0===s.inTangent&&n.values.push(void 0),void 0===s.outTangent&&n.values.push(void 0),n.values.push(s.interpolation))}t.keys.push(n)}for(let e in t.ranges=[],this._ranges){let i=this._ranges[e];if(!i)continue;let a={};a.name=e,a.from=i.from,a.to=i.to,t.ranges.push(a)}return t}static _UniversalLerp(t,e,i){let a=t.constructor;return a.Lerp?a.Lerp(t,e,i):a.Slerp?a.Slerp(t,e,i):t.toFixed?t*(1-i)+i*e:e}}P._UniqueIdGenerator=0,P.AllowMatricesInterpolation=!1,P.AllowMatrixDecomposeForInterpolation=!0,P.InheritOriginalValueFromActiveAnimations=!1,P.SnippetUrl="https://snippet.babylonjs.com",P.ANIMATIONTYPE_FLOAT=0,P.ANIMATIONTYPE_VECTOR3=1,P.ANIMATIONTYPE_QUATERNION=2,P.ANIMATIONTYPE_MATRIX=3,P.ANIMATIONTYPE_COLOR3=4,P.ANIMATIONTYPE_COLOR4=7,P.ANIMATIONTYPE_VECTOR2=5,P.ANIMATIONTYPE_SIZE=6,P.ANIMATIONLOOPMODE_RELATIVE=0,P.ANIMATIONLOOPMODE_CYCLE=1,P.ANIMATIONLOOPMODE_CONSTANT=2,P.ANIMATIONLOOPMODE_YOYO=4,P.ANIMATIONLOOPMODE_RELATIVE_FROM_CURRENT=5;class C{constructor(){this.transitionDuration=450,this.lowerRadiusTransitionRange=2,this.upperRadiusTransitionRange=-2,this._autoTransitionRange=!1,this._attachedCamera=null,this._radiusIsAnimating=!1,this._radiusBounceTransition=null,this._animatables=[]}get name(){return"Bouncing"}get autoTransitionRange(){return this._autoTransitionRange}set autoTransitionRange(t){if(this._autoTransitionRange===t)return;this._autoTransitionRange=t;let e=this._attachedCamera;e&&(t?this._onMeshTargetChangedObserver=e.onMeshTargetChangedObservable.add(t=>{if(t&&(t.computeWorldMatrix(!0),t.getBoundingInfo)){let e=t.getBoundingInfo().diagonalLength;this.lowerRadiusTransitionRange=.05*e,this.upperRadiusTransitionRange=.05*e}}):this._onMeshTargetChangedObserver&&e.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver))}get attachedNode(){return this._attachedCamera}init(){}attach(t){this._attachedCamera=t,this._onAfterCheckInputsObserver=t.onAfterCheckInputsObservable.add(()=>{this._attachedCamera&&(this._isRadiusAtLimit(this._attachedCamera.lowerRadiusLimit)&&this._applyBoundRadiusAnimation(this.lowerRadiusTransitionRange),this._isRadiusAtLimit(this._attachedCamera.upperRadiusLimit)&&this._applyBoundRadiusAnimation(this.upperRadiusTransitionRange))})}detach(){this._attachedCamera&&(this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null)}_isRadiusAtLimit(t){return!!this._attachedCamera&&this._attachedCamera.radius===t&&!this._radiusIsAnimating}_applyBoundRadiusAnimation(t){if(!this._attachedCamera)return;this._radiusBounceTransition||(C.EasingFunction.setEasingMode(C.EasingMode),this._radiusBounceTransition=P.CreateAnimation("radius",P.ANIMATIONTYPE_FLOAT,60,C.EasingFunction)),this._cachedWheelPrecision=this._attachedCamera.wheelPrecision,this._attachedCamera.wheelPrecision=1/0,this._attachedCamera.inertialRadiusOffset=0,this.stopAllAnimations(),this._radiusIsAnimating=!0;let e=P.TransitionTo("radius",this._attachedCamera.radius+t,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusBounceTransition,this.transitionDuration,()=>this._clearAnimationLocks());e&&this._animatables.push(e)}_clearAnimationLocks(){this._radiusIsAnimating=!1,this._attachedCamera&&(this._attachedCamera.wheelPrecision=this._cachedWheelPrecision)}stopAllAnimations(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0].onAnimationEnd=null,this._animatables[0].stop(),this._animatables.shift()}}C.EasingFunction=new class extends d{constructor(t=1){super(),this.amplitude=t}easeInCore(t){return Math.pow(t,3)-t*Math.max(0,this.amplitude)*Math.sin(3.141592653589793*t)}}(.3),C.EasingMode=d.EASINGMODE_EASEOUT;class R{constructor(){this.onTargetFramingAnimationEndObservable=new n.Observable,this._mode=R.FitFrustumSidesMode,this._radiusScale=1,this._positionScale=.5,this._defaultElevation=.3,this._elevationReturnTime=1500,this._elevationReturnWaitTime=1e3,this._zoomStopsAnimation=!1,this._framingTime=1500,this.autoCorrectCameraLimitsAndSensibility=!0,this._attachedCamera=null,this._isPointerDown=!1,this._lastInteractionTime=-1/0,this._animatables=[],this._betaIsAnimating=!1}get name(){return"Framing"}set mode(t){this._mode=t}get mode(){return this._mode}set radiusScale(t){this._radiusScale=t}get radiusScale(){return this._radiusScale}set positionScale(t){this._positionScale=t}get positionScale(){return this._positionScale}set defaultElevation(t){this._defaultElevation=t}get defaultElevation(){return this._defaultElevation}set elevationReturnTime(t){this._elevationReturnTime=t}get elevationReturnTime(){return this._elevationReturnTime}set elevationReturnWaitTime(t){this._elevationReturnWaitTime=t}get elevationReturnWaitTime(){return this._elevationReturnWaitTime}set zoomStopsAnimation(t){this._zoomStopsAnimation=t}get zoomStopsAnimation(){return this._zoomStopsAnimation}set framingTime(t){this._framingTime=t}get framingTime(){return this._framingTime}get attachedNode(){return this._attachedCamera}init(){}attach(t){this._attachedCamera=t;let e=this._attachedCamera.getScene();R.EasingFunction.setEasingMode(R.EasingMode),this._onPrePointerObservableObserver=e.onPrePointerObservable.add(t=>{if(t.type===u.PointerEventTypes.POINTERDOWN){this._isPointerDown=!0;return}t.type===u.PointerEventTypes.POINTERUP&&(this._isPointerDown=!1)}),this._onMeshTargetChangedObserver=t.onMeshTargetChangedObservable.add(t=>{t&&t.getBoundingInfo&&this.zoomOnMesh(t,void 0,()=>{this.onTargetFramingAnimationEndObservable.notifyObservers()})}),this._onAfterCheckInputsObserver=t.onAfterCheckInputsObservable.add(()=>{this._applyUserInteraction(),this._maintainCameraAboveGround()})}detach(){if(!this._attachedCamera)return;let t=this._attachedCamera.getScene();this._onPrePointerObservableObserver&&t.onPrePointerObservable.remove(this._onPrePointerObservableObserver),this._onAfterCheckInputsObserver&&this._attachedCamera.onAfterCheckInputsObservable.remove(this._onAfterCheckInputsObserver),this._onMeshTargetChangedObserver&&this._attachedCamera.onMeshTargetChangedObservable.remove(this._onMeshTargetChangedObserver),this._attachedCamera=null}zoomOnMesh(t,e=!1,i=null){t.computeWorldMatrix(!0);let a=t.getBoundingInfo().boundingBox;this.zoomOnBoundingInfo(a.minimumWorld,a.maximumWorld,e,i)}zoomOnMeshHierarchy(t,e=!1,i=null){t.computeWorldMatrix(!0);let a=t.getHierarchyBoundingVectors(!0);this.zoomOnBoundingInfo(a.min,a.max,e,i)}zoomOnMeshesHierarchy(t,e=!1,i=null){let a=new o.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new o.Vector3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let e=0;e<t.length;e++){let i=t[e].getHierarchyBoundingVectors(!0);o.Vector3.CheckExtends(i.min,a,s),o.Vector3.CheckExtends(i.max,a,s)}this.zoomOnBoundingInfo(a,s,e,i)}zoomOnBoundingInfo(t,e,i=!1,a=null){let s;if(!this._attachedCamera)return!1;let n=t.y,r=n+(e.y-n)*this._positionScale,h=e.subtract(t).scale(.5);if(!isFinite(r))return!1;if(i)s=new o.Vector3(0,r,0);else{let e=t.add(h);s=new o.Vector3(e.x,r,e.z)}this._vectorTransition||(this._vectorTransition=P.CreateAnimation("target",P.ANIMATIONTYPE_VECTOR3,60,R.EasingFunction)),this._betaIsAnimating=!0;let l=P.TransitionTo("target",s,this._attachedCamera,this._attachedCamera.getScene(),60,this._vectorTransition,this._framingTime);l&&this._animatables.push(l);let u=0;if(this._mode===R.FitFrustumSidesMode){let i=this._calculateLowerRadiusFromModelBoundingSphere(t,e);this.autoCorrectCameraLimitsAndSensibility&&(this._attachedCamera.lowerRadiusLimit=h.length()+this._attachedCamera.minZ),u=i}else this._mode===R.IgnoreBoundsSizeMode&&(u=this._calculateLowerRadiusFromModelBoundingSphere(t,e),this.autoCorrectCameraLimitsAndSensibility&&null===this._attachedCamera.lowerRadiusLimit&&(this._attachedCamera.lowerRadiusLimit=this._attachedCamera.minZ));if(this.autoCorrectCameraLimitsAndSensibility){let i=e.subtract(t).length();this._attachedCamera.panningSensibility=5e3/i,this._attachedCamera.wheelPrecision=100/u}return this._radiusTransition||(this._radiusTransition=P.CreateAnimation("radius",P.ANIMATIONTYPE_FLOAT,60,R.EasingFunction)),(l=P.TransitionTo("radius",u,this._attachedCamera,this._attachedCamera.getScene(),60,this._radiusTransition,this._framingTime,()=>{this.stopAllAnimations(),a&&a(),this._attachedCamera&&this._attachedCamera.useInputToRestoreState&&this._attachedCamera.storeState()}))&&this._animatables.push(l),!0}_calculateLowerRadiusFromModelBoundingSphere(t,e){let i=this._attachedCamera;if(!i)return 0;let a=i._calculateLowerRadiusFromModelBoundingSphere(t,e,this._radiusScale);return i.lowerRadiusLimit&&this._mode===R.IgnoreBoundsSizeMode&&(a=a<i.lowerRadiusLimit?i.lowerRadiusLimit:a),i.upperRadiusLimit&&(a=a>i.upperRadiusLimit?i.upperRadiusLimit:a),a}_maintainCameraAboveGround(){if(this._elevationReturnTime<0)return;let t=c.PrecisionDate.Now-this._lastInteractionTime,e=.5*Math.PI-this._defaultElevation,i=.5*Math.PI;if(this._attachedCamera&&!this._betaIsAnimating&&this._attachedCamera.beta>i&&t>=this._elevationReturnWaitTime){this._betaIsAnimating=!0,this.stopAllAnimations(),this._betaTransition||(this._betaTransition=P.CreateAnimation("beta",P.ANIMATIONTYPE_FLOAT,60,R.EasingFunction));let t=P.TransitionTo("beta",e,this._attachedCamera,this._attachedCamera.getScene(),60,this._betaTransition,this._elevationReturnTime,()=>{this._clearAnimationLocks(),this.stopAllAnimations()});t&&this._animatables.push(t)}}_clearAnimationLocks(){this._betaIsAnimating=!1}_applyUserInteraction(){this.isUserIsMoving&&(this._lastInteractionTime=c.PrecisionDate.Now,this.stopAllAnimations(),this._clearAnimationLocks())}stopAllAnimations(){for(this._attachedCamera&&(this._attachedCamera.animations=[]);this._animatables.length;)this._animatables[0]&&(this._animatables[0].onAnimationEnd=null,this._animatables[0].stop()),this._animatables.shift()}get isUserIsMoving(){return!!this._attachedCamera&&(0!==this._attachedCamera.inertialAlphaOffset||0!==this._attachedCamera.inertialBetaOffset||0!==this._attachedCamera.inertialRadiusOffset||0!==this._attachedCamera.inertialPanningX||0!==this._attachedCamera.inertialPanningY||this._isPointerDown)}}R.EasingFunction=new class extends d{constructor(t=2){super(),this.exponent=t}easeInCore(t){return this.exponent<=0?t:(Math.exp(this.exponent*t)-1)/(Math.exp(this.exponent)-1)}},R.EasingMode=d.EASINGMODE_EASEINOUT,R.IgnoreBoundsSizeMode=0,R.FitFrustumSidesMode=1;var E=t.i(59576),b=t.i(58302),N=t.i(95190),S=t.i(65740);class L{constructor(){this._currentMousePointerIdDown=-1,this.buttons=[0,1,2]}attachControl(t){t=S.Tools.BackCompatCameraNoPreventDefault(arguments);let e=this.camera.getEngine(),i=e.getInputElement(),a=0,s=null;this._pointA=null,this._pointB=null,this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._pointerInput=n=>{let o=n.event,r="touch"===o.pointerType;if(n.type!==u.PointerEventTypes.POINTERMOVE&&-1===this.buttons.indexOf(o.button))return;let h=o.target;if(this._altKey=o.altKey,this._ctrlKey=o.ctrlKey,this._metaKey=o.metaKey,this._shiftKey=o.shiftKey,this._buttonsPressed=o.buttons,e.isPointerLock){let t=o.movementX,e=o.movementY;this.onTouch(null,t,e),this._pointA=null,this._pointB=null}else if(n.type!==u.PointerEventTypes.POINTERDOWN&&n.type!==u.PointerEventTypes.POINTERDOUBLETAP&&r&&this._pointA?.pointerId!==o.pointerId&&this._pointB?.pointerId!==o.pointerId)return;else if(n.type===u.PointerEventTypes.POINTERDOWN&&(-1===this._currentMousePointerIdDown||r)){try{h?.setPointerCapture(o.pointerId)}catch(t){}if(null===this._pointA)this._pointA={x:o.clientX,y:o.clientY,pointerId:o.pointerId,type:o.pointerType,button:o.button};else{if(null!==this._pointB)return;this._pointB={x:o.clientX,y:o.clientY,pointerId:o.pointerId,type:o.pointerType,button:o.button}}-1!==this._currentMousePointerIdDown||r||(this._currentMousePointerIdDown=o.pointerId),this.onButtonDown(o),!t&&(o.preventDefault(),i&&i.focus())}else if(n.type===u.PointerEventTypes.POINTERDOUBLETAP)this.onDoubleTap(o.pointerType);else if(n.type===u.PointerEventTypes.POINTERUP&&(this._currentMousePointerIdDown===o.pointerId||r)){try{h?.releasePointerCapture(o.pointerId)}catch(t){}r||(this._pointB=null),e._badOS?this._pointA=this._pointB=null:this._pointB&&this._pointA&&this._pointA.pointerId==o.pointerId?(this._pointA=this._pointB,this._pointB=null):this._pointA&&this._pointB&&this._pointB.pointerId==o.pointerId?this._pointB=null:this._pointA=this._pointB=null,(0!==a||s)&&(this.onMultiTouch(this._pointA,this._pointB,a,0,s,null),a=0,s=null),this._currentMousePointerIdDown=-1,this.onButtonUp(o),t||o.preventDefault()}else if(n.type===u.PointerEventTypes.POINTERMOVE){if(t||o.preventDefault(),this._pointA&&null===this._pointB){let t=o.clientX-this._pointA.x,e=o.clientY-this._pointA.y;this._pointA.x=o.clientX,this._pointA.y=o.clientY,this.onTouch(this._pointA,t,e)}else if(this._pointA&&this._pointB){let t=this._pointA.pointerId===o.pointerId?this._pointA:this._pointB;t.x=o.clientX,t.y=o.clientY;let e=this._pointA.x-this._pointB.x,i=this._pointA.y-this._pointB.y,r=e*e+i*i,h={x:(this._pointA.x+this._pointB.x)/2,y:(this._pointA.y+this._pointB.y)/2,pointerId:o.pointerId,type:n.type};this.onMultiTouch(this._pointA,this._pointB,a,r,s,h),s=h,a=r}}},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._pointerInput,u.PointerEventTypes.POINTERDOWN|u.PointerEventTypes.POINTERUP|u.PointerEventTypes.POINTERMOVE|u.PointerEventTypes.POINTERDOUBLETAP),this._onLostFocus=()=>{this._pointA=this._pointB=null,a=0,s=null,this.onLostFocus()},this._contextMenuBind=t=>this.onContextMenu(t),i&&i.addEventListener("contextmenu",this._contextMenuBind,!1);let n=this.camera.getScene().getEngine().getHostWindow();n&&S.Tools.RegisterTopRootEvents(n,[{name:"blur",handler:this._onLostFocus}])}detachControl(){if(this._onLostFocus){let t=this.camera.getScene().getEngine().getHostWindow();t&&S.Tools.UnregisterTopRootEvents(t,[{name:"blur",handler:this._onLostFocus}])}if(this._observer){if(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._contextMenuBind){let t=this.camera.getScene().getEngine().getInputElement();t&&t.removeEventListener("contextmenu",this._contextMenuBind)}this._onLostFocus=null}this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._buttonsPressed=0,this._currentMousePointerIdDown=-1}getClassName(){return"BaseCameraPointersInput"}getSimpleName(){return"pointers"}onDoubleTap(t){}onTouch(t,e,i){}onMultiTouch(t,e,i,a,s,n){}onContextMenu(t){t.preventDefault()}onButtonDown(t){}onButtonUp(t){}onLostFocus(){}}(0,a.__decorate)([(0,s.serialize)()],L.prototype,"buttons",void 0);class D extends L{constructor(){super(...arguments),this.pinchZoom=!0,this.multiTouchPanning=!0,this.multiTouchPanAndZoom=!0,this._isPinching=!1,this._twoFingerActivityCount=0,this._shouldStartPinchZoom=!1}_computePinchZoom(t,e){}_computeMultiTouchPanning(t,e){}onMultiTouch(t,e,i,a,s,n){0===i&&null===s||(0!==a||null!==n)&&(this.multiTouchPanAndZoom?(this._computePinchZoom(i,a),this._computeMultiTouchPanning(s,n)):this.multiTouchPanning&&this.pinchZoom?(this._twoFingerActivityCount++,this._isPinching||this._shouldStartPinchZoom?(this._computePinchZoom(i,a),this._isPinching=!0):this._computeMultiTouchPanning(s,n)):this.multiTouchPanning?this._computeMultiTouchPanning(s,n):this.pinchZoom&&this._computePinchZoom(i,a))}onButtonUp(t){this._twoFingerActivityCount=0,this._isPinching=!1}onLostFocus(){this._twoFingerActivityCount=0,this._isPinching=!1}}(0,a.__decorate)([(0,s.serialize)()],D.prototype,"pinchZoom",void 0),(0,a.__decorate)([(0,s.serialize)()],D.prototype,"multiTouchPanning",void 0),(0,a.__decorate)([(0,s.serialize)()],D.prototype,"multiTouchPanAndZoom",void 0);class w extends D{constructor(){super(...arguments),this.buttons=[0,1,2],this.angularSensibilityX=1e3,this.angularSensibilityY=1e3,this.pinchPrecision=12,this.pinchDeltaPercentage=0,this.useNaturalPinchZoom=!1,this.panningSensibility=1e3,this.pinchInwards=!0,this._activeEntry=null,this._pointerLockConditions={button:0,modifiers:{}},this._pointerModifiers={ctrl:!1,alt:!1,shift:!1},this._pointerConditions={modifiers:this._pointerModifiers}}getClassName(){return"ArcRotateCameraPointersInput"}_computeMultiTouchPanning(t,e){if(t&&e){let i=e.x-t.x,a=e.y-t.y,s=this.camera.movement.input.getEntry("pointer","pan"),n=s?.sensitivity??(0!==this.panningSensibility?1/this.panningSensibility:0);0!==n&&(this.camera.movement.activeInput=!0,this.camera.movement.panAccumulatedPixels.x+=-i*n,this.camera.movement.panAccumulatedPixels.y+=a*n)}}_computePinchZoom(t,e){let i=this.camera.radius||w.MinimumRadiusForPinch;if(this.useNaturalPinchZoom)this.camera.radius=i*Math.sqrt(t)/Math.sqrt(e);else if(this.pinchDeltaPercentage){let a=(e-t)*.001*i*this.pinchDeltaPercentage;this.camera.movement.activeInput=!0,this.camera.movement.zoomAccumulatedPixels+=a}else{let i=(e-t)/(this.pinchPrecision*(this.pinchInwards?1:-1)*(this.angularSensibilityX+this.angularSensibilityY)/2);this.camera.movement.activeInput=!0,this.camera.movement.zoomAccumulatedPixels+=i}}onTouch(t,e,i){let a=this._activeEntry??(this.camera.getEngine().isPointerLock?this.camera.movement.input.resolveInteraction("pointer",this._pointerLockConditions):null);if(a){if("pan"===a.interaction){let t=a.sensitivity??(0!==this.panningSensibility?1/this.panningSensibility:0);0!==t&&(this.camera.movement.activeInput=!0,this.camera.movement.panAccumulatedPixels.x+=-e*t,this.camera.movement.panAccumulatedPixels.y+=i*t)}else if("rotate"===a.interaction){let t=a.sensitivityX??a.sensitivity??1/this.angularSensibilityX,s=a.sensitivityY??a.sensitivity??1/this.angularSensibilityY;this.camera.movement.activeInput=!0,this.camera.movement.rotationAccumulatedPixels.x+=-e*t,this.camera.movement.rotationAccumulatedPixels.y+=-i*s}}}onDoubleTap(){this.camera.useInputToRestoreState&&this.camera.restoreState()}onMultiTouch(t,e,i,a,s,n){this._shouldStartPinchZoom=this._twoFingerActivityCount<20&&Math.abs(Math.sqrt(a)-Math.sqrt(i))>this.camera.pinchToPanMaxDistance,super.onMultiTouch(t,e,i,a,s,n)}onButtonDown(t){this._pointerConditions.button=t.button,this._pointerModifiers.ctrl=t.ctrlKey,this._pointerModifiers.alt=t.altKey,this._pointerModifiers.shift=t.shiftKey,this._activeEntry=this.camera.movement.input.resolveInteraction("pointer",this._pointerConditions),super.onButtonDown(t)}onButtonUp(t){this._activeEntry=null,super.onButtonUp(t)}onLostFocus(){this._activeEntry=null,super.onLostFocus()}}w.MinimumRadiusForPinch=.001,(0,a.__decorate)([(0,s.serialize)()],w.prototype,"buttons",void 0),(0,a.__decorate)([(0,s.serialize)()],w.prototype,"angularSensibilityX",void 0),(0,a.__decorate)([(0,s.serialize)()],w.prototype,"angularSensibilityY",void 0),(0,a.__decorate)([(0,s.serialize)()],w.prototype,"pinchPrecision",void 0),(0,a.__decorate)([(0,s.serialize)()],w.prototype,"pinchDeltaPercentage",void 0),(0,a.__decorate)([(0,s.serialize)()],w.prototype,"useNaturalPinchZoom",void 0),(0,a.__decorate)([(0,s.serialize)()],w.prototype,"panningSensibility",void 0),N.CameraInputTypes.ArcRotateCameraPointersInput=w;var B=t.i(36365);class x{constructor(){this.keysUp=[38],this.keysDown=[40],this.keysLeft=[37],this.keysRight=[39],this.keysReset=[220],this.keysZoomIn=[187,107],this.keysZoomOut=[189,109],this.panningSensibility=50,this.zoomingSensibility=25,this.angularSpeed=.01,this._useAltToZoom=!0,this._keys=[],this._keyboardModifiers={ctrl:!1,alt:!1},this._keyboardConditions={modifiers:this._keyboardModifiers}}get useAltToZoom(){return this._useAltToZoom}set useAltToZoom(t){this._useAltToZoom=t,this._applyUseAltToZoomToInputMap()}_applyUseAltToZoomToInputMap(){if(!this.camera?.movement)return;let t=this.camera.movement.input,e=t.getEntry("keyboard","zoom",{modifiers:{alt:!0}});!this._useAltToZoom&&e?t.inputMap.splice(t.inputMap.indexOf(e),1):this._useAltToZoom&&!e&&t.addEntry({source:"keyboard",modifiers:{alt:!0},interaction:"zoom"})}attachControl(t){t=S.Tools.BackCompatCameraNoPreventDefault(arguments),this._onCanvasBlurObserver||(this._scene=this.camera.getScene(),this._engine=this._scene.getEngine(),this._applyUseAltToZoomToInputMap(),this._onCanvasBlurObserver=this._engine.onCanvasBlurObservable.add(()=>{this._keys.length=0}),this._onKeyboardObserver=this._scene.onKeyboardObservable.add(e=>{let i=e.event;if(!i.metaKey){if(e.type===B.KeyboardEventTypes.KEYDOWN)this._ctrlPressed=i.ctrlKey,this._altPressed=i.altKey,(-1!==this.keysUp.indexOf(i.keyCode)||-1!==this.keysDown.indexOf(i.keyCode)||-1!==this.keysLeft.indexOf(i.keyCode)||-1!==this.keysRight.indexOf(i.keyCode)||-1!==this.keysReset.indexOf(i.keyCode)||-1!==this.keysZoomIn.indexOf(i.keyCode)||-1!==this.keysZoomOut.indexOf(i.keyCode))&&(-1===this._keys.indexOf(i.keyCode)&&this._keys.push(i.keyCode),i.preventDefault&&!t&&i.preventDefault());else if(-1!==this.keysUp.indexOf(i.keyCode)||-1!==this.keysDown.indexOf(i.keyCode)||-1!==this.keysLeft.indexOf(i.keyCode)||-1!==this.keysRight.indexOf(i.keyCode)||-1!==this.keysReset.indexOf(i.keyCode)||-1!==this.keysZoomIn.indexOf(i.keyCode)||-1!==this.keysZoomOut.indexOf(i.keyCode)){let e=this._keys.indexOf(i.keyCode);e>=0&&this._keys.splice(e,1),i.preventDefault&&!t&&i.preventDefault()}}}))}detachControl(){this._scene&&(this._onKeyboardObserver&&this._scene.onKeyboardObservable.remove(this._onKeyboardObserver),this._onCanvasBlurObserver&&this._engine.onCanvasBlurObservable.remove(this._onCanvasBlurObserver),this._onKeyboardObserver=null,this._onCanvasBlurObserver=null),this._keys.length=0}checkInputs(){if(this._onKeyboardObserver){let t=this.camera,e=t.movement.input;this._keyboardModifiers.ctrl=this._ctrlPressed,this._keyboardModifiers.alt=this._altPressed;for(let i=0;i<this._keys.length;i++){let a=this._keys[i];if(this._keyboardConditions.key=a,-1===this.keysReset.indexOf(a)){let t=e.resolveInteraction("keyboard",this._keyboardConditions);if(t){if("pan"===t.interaction){let i=t.sensitivity??1/this.panningSensibility;-1!==this.keysLeft.indexOf(a)?e.handlers.pan(-i,0):-1!==this.keysRight.indexOf(a)?e.handlers.pan(i,0):-1!==this.keysUp.indexOf(a)?e.handlers.pan(0,i):-1!==this.keysDown.indexOf(a)&&e.handlers.pan(0,-i)}else if("zoom"===t.interaction){let i=t.sensitivity??1/this.zoomingSensibility;-1!==this.keysUp.indexOf(a)||-1!==this.keysZoomIn.indexOf(a)?e.handlers.zoom(i):(-1!==this.keysDown.indexOf(a)||-1!==this.keysZoomOut.indexOf(a))&&e.handlers.zoom(-i)}else if("rotate"===t.interaction){let i=t.sensitivity??this.angularSpeed;-1!==this.keysLeft.indexOf(a)?e.handlers.rotate(-i,0):-1!==this.keysRight.indexOf(a)?e.handlers.rotate(i,0):-1!==this.keysUp.indexOf(a)?e.handlers.rotate(0,-i):-1!==this.keysDown.indexOf(a)&&e.handlers.rotate(0,i)}}}-1!==this.keysReset.indexOf(a)&&t.useInputToRestoreState&&t.restoreState()}}}getClassName(){return"ArcRotateCameraKeyboardMoveInput"}getSimpleName(){return"keyboard"}}(0,a.__decorate)([(0,s.serialize)()],x.prototype,"keysUp",void 0),(0,a.__decorate)([(0,s.serialize)()],x.prototype,"keysDown",void 0),(0,a.__decorate)([(0,s.serialize)()],x.prototype,"keysLeft",void 0),(0,a.__decorate)([(0,s.serialize)()],x.prototype,"keysRight",void 0),(0,a.__decorate)([(0,s.serialize)()],x.prototype,"keysReset",void 0),(0,a.__decorate)([(0,s.serialize)()],x.prototype,"keysZoomIn",void 0),(0,a.__decorate)([(0,s.serialize)()],x.prototype,"keysZoomOut",void 0),(0,a.__decorate)([(0,s.serialize)()],x.prototype,"panningSensibility",void 0),(0,a.__decorate)([(0,s.serialize)()],x.prototype,"zoomingSensibility",void 0),(0,a.__decorate)([(0,s.serialize)()],x.prototype,"angularSpeed",void 0),(0,a.__decorate)([(0,s.serialize)()],x.prototype,"useAltToZoom",null),N.CameraInputTypes.ArcRotateCameraKeyboardMoveInput=x;var k=t.i(65002),V=t.i(76696);class F{constructor(){this.wheelPrecision=3,this.zoomToMouseLocation=!1,this.wheelDeltaPercentage=0,this.customComputeDeltaFromMouseWheel=null,this._viewOffset=new o.Vector3(0,0,0),this._globalOffset=new o.Vector3(0,0,0),this._inertialPanning=o.Vector3.Zero(),this._zoomToMouseRadiusOffset=0}_computeDeltaFromMouseWheelLegacyEvent(t,e){let i=.01*t*this.wheelDeltaPercentage*e;return t>0?i/(1+this.wheelDeltaPercentage):i*(1+this.wheelDeltaPercentage)}attachControl(t){t=S.Tools.BackCompatCameraNoPreventDefault(arguments),this._wheel=e=>{let i;if(e.type!==u.PointerEventTypes.POINTERWHEEL)return;let a=e.event,s=a.deltaMode===V.EventConstants.DOM_DELTA_LINE?40:1,n=-(a.deltaY*s);if(this.customComputeDeltaFromMouseWheel)i=this.customComputeDeltaFromMouseWheel(n,this,a);else if(this.wheelDeltaPercentage){if((i=this._computeDeltaFromMouseWheelLegacyEvent(n,this.camera.radius))>0){let t=this.zoomToMouseLocation?this._zoomToMouseRadiusOffset:this.camera.inertialRadiusOffset,e=this.camera.radius,a=t+i;for(let t=0;t<20&&!(e<=a)&&!(.001>Math.abs(a*this.camera.inertia));t++)e-=a,a*=this.camera.inertia;e=(0,r.Clamp)(e,0,Number.MAX_VALUE),i=this._computeDeltaFromMouseWheelLegacyEvent(n,e)}}else{let t=this.camera.movement.input.getEntry("wheel","zoom");i=n*(t?.sensitivity??1/(40*this.wheelPrecision))}i&&(this.zoomToMouseLocation?(this._hitPlane||this._updateHitPlane(),this._zoomToMouse(i)):this.camera.movement.zoomAccumulatedPixels+=i),a.preventDefault&&!t&&a.preventDefault()},this._observer=this.camera.getScene()._inputManager._addCameraPointerObserver(this._wheel,u.PointerEventTypes.POINTERWHEEL),this.zoomToMouseLocation&&this._inertialPanning.setAll(0)}detachControl(){this._observer&&(this.camera.getScene()._inputManager._removeCameraPointerObserver(this._observer),this._observer=null,this._wheel=null)}checkInputs(){if(!this.zoomToMouseLocation)return;let t=this.camera;if(Math.abs(this._zoomToMouseRadiusOffset)+this._inertialPanning.lengthSquared()+Math.abs(t.inertialAlphaOffset)+Math.abs(t.inertialBetaOffset)+Math.abs(t.inertialRadiusOffset)){this._updateHitPlane(),t.target.addInPlace(this._inertialPanning),t.radius-=this._zoomToMouseRadiusOffset;let e=t.movement.getFrameIndependentDecay(t.inertia);this._inertialPanning.scaleInPlace(e),this._zoomToMouseRadiusOffset*=e,this._zeroIfClose(this._inertialPanning),Math.abs(this._zoomToMouseRadiusOffset)<_.Epsilon&&(this._zoomToMouseRadiusOffset=0)}}getClassName(){return"ArcRotateCameraMouseWheelInput"}getSimpleName(){return"mousewheel"}_updateHitPlane(){let t=this.camera,e=t.target.subtract(t.position);this._hitPlane=k.Plane.FromPositionAndNormal(t.target,e)}_getPosition(){let t=this.camera,e=t.getScene(),i=e.createPickingRay(e.pointerX,e.pointerY,o.Matrix.Identity(),t,!1);(0!==t.targetScreenOffset.x||0!==t.targetScreenOffset.y)&&(this._viewOffset.set(t.targetScreenOffset.x,t.targetScreenOffset.y,0),t.getViewMatrix().invertToRef(t._cameraTransformMatrix),this._globalOffset=o.Vector3.TransformNormal(this._viewOffset,t._cameraTransformMatrix),i.origin.addInPlace(this._globalOffset));let a=0;return this._hitPlane&&(a=i.intersectsPlane(this._hitPlane)??0),i.origin.addInPlace(i.direction.scaleInPlace(a))}_zoomToMouse(t){let e=this.camera,i=1-e.inertia,a=e.movement.getFrameIndependentInputScale(e.inertia);if(e.lowerRadiusLimit){let s=e.lowerRadiusLimit??0;e.radius-(this._zoomToMouseRadiusOffset+t*a)/i<s&&(t=((e.radius-s)*i-this._zoomToMouseRadiusOffset)/a)}if(e.upperRadiusLimit){let s=e.upperRadiusLimit??0;e.radius-(this._zoomToMouseRadiusOffset+t*a)/i>s&&(t=((e.radius-s)*i-this._zoomToMouseRadiusOffset)/a)}let s=t/i/e.radius,n=this._getPosition(),r=o.TmpVectors.Vector3[6];n.subtractToRef(e.target,r),r.scaleInPlace(s),r.scaleInPlace(i),r.scaleInPlace(a),this._inertialPanning.addInPlace(r),this._zoomToMouseRadiusOffset+=t*a}_zeroIfClose(t){Math.abs(t.x)<_.Epsilon&&(t.x=0),Math.abs(t.y)<_.Epsilon&&(t.y=0),Math.abs(t.z)<_.Epsilon&&(t.z=0)}}(0,a.__decorate)([(0,s.serialize)()],F.prototype,"wheelPrecision",void 0),(0,a.__decorate)([(0,s.serialize)()],F.prototype,"zoomToMouseLocation",void 0),(0,a.__decorate)([(0,s.serialize)()],F.prototype,"wheelDeltaPercentage",void 0),N.CameraInputTypes.ArcRotateCameraMouseWheelInput=F;var z=N,Y=t.i(75405);class U extends z.CameraInputsManager{constructor(t){super(t)}addMouseWheel(){return this.add(new F),this}addPointers(){return this.add(new w),this}addKeyboard(){return this.add(new x),this}}(e=U.prototype).addVRDeviceOrientation??(e.addVRDeviceOrientation=(0,Y._MissingSideEffect)("ArcRotateCameraInputsManager","addVRDeviceOrientation")),(i=U.prototype).addGamepad??(i.addGamepad=(0,Y._MissingSideEffect)("ArcRotateCameraInputsManager","addGamepad"));var Z=t.i(77052),W=t.i(16074),K=t.i(63764);class X extends W.CameraMovement{constructor(t,e,i){super(t,e,i),this.input=new K.InputMapper({pan:(t,e)=>{this.panAccumulatedPixels.x+=t,this.panAccumulatedPixels.y+=e},rotate:(t,e)=>{this.rotationAccumulatedPixels.x+=t,this.rotationAccumulatedPixels.y+=e},zoom:t=>{this.zoomAccumulatedPixels+=t}},()=>this._createDefaultInputMap())}_createDefaultInputMap(){return[{source:"pointer",button:0,modifiers:{ctrl:!0},interaction:"pan"},{source:"pointer",button:0,interaction:"rotate"},{source:"pointer",button:2,interaction:"pan"},{source:"wheel",interaction:"zoom"},{source:"keyboard",key:[187,107,189,109],interaction:"zoom"},{source:"keyboard",modifiers:{ctrl:!0},interaction:"pan"},{source:"keyboard",modifiers:{alt:!0},interaction:"zoom"},{source:"keyboard",interaction:"rotate"}]}}function H(t){let e=Math.PI/2;return(0!==t.x||0!==t.z)&&(e=Math.acos(t.x/Math.sqrt(Math.pow(t.x,2)+Math.pow(t.z,2)))),t.z<0&&(e=2*Math.PI-e),e}function G(t,e){return Math.acos(t/e)}function q(t,e){return isNaN(t)?e:t}class Q extends b.TargetCamera{get target(){return this._target}set target(t){this.setTarget(t)}get targetHost(){return this._targetHost}set targetHost(t){t&&this.setTarget(t)}getTarget(){return this.target}get position(){return this._position}set position(t){this.setPosition(t)}set upVector(t){this._upToYMatrix||(this._yToUpMatrix=new o.Matrix,this._upToYMatrix=new o.Matrix,this._upVector=o.Vector3.Zero()),t.normalize(),this._upVector.copyFrom(t),this.setMatUp()}get upVector(){return this._upVector}setMatUp(){o.Matrix.RotationAlignToRef(o.Vector3.UpReadOnly,this._upVector,this._yToUpMatrix),o.Matrix.RotationAlignToRef(this._upVector,o.Vector3.UpReadOnly,this._upToYMatrix)}get inertialAlphaOffset(){if(0!==this._inertialAlphaOffset)return this._inertialAlphaOffset;if(0!==this.movement.rotationAccumulatedPixels.x)return this.movement.rotationAccumulatedPixels.x;let t=this.movement.rotationDeltaCurrentFrame.x;return Math.abs(t)<this._rotationEpsilon?0:t}set inertialAlphaOffset(t){this._inertialAlphaOffset=t,0===t&&this.movement.resetRotationVelocity()}get inertialBetaOffset(){if(0!==this._inertialBetaOffset)return this._inertialBetaOffset;if(0!==this.movement.rotationAccumulatedPixels.y)return this.movement.rotationAccumulatedPixels.y;let t=this.movement.rotationDeltaCurrentFrame.y;return Math.abs(t)<this._rotationEpsilon?0:t}set inertialBetaOffset(t){this._inertialBetaOffset=t,0===t&&this.movement.resetRotationVelocity()}get inertialRadiusOffset(){if(0!==this._inertialRadiusOffset)return this._inertialRadiusOffset;if(0!==this.movement.zoomAccumulatedPixels)return this.movement.zoomAccumulatedPixels;let t=this.movement.zoomDeltaCurrentFrame;return Math.abs(t)<this.speed*this._rotationEpsilon?0:t}set inertialRadiusOffset(t){this._inertialRadiusOffset=t,0===t&&this.movement.resetZoomVelocity()}get panningInertia(){return this._panningInertia}set panningInertia(t){this._panningInertia=t,this.movement&&(this.movement.panInertia=t)}get inertia(){return this._inertia}set inertia(t){this._inertia=t,this.movement&&(this.movement.rotationInertia=t,this.movement.zoomInertia=t)}get angularSensibilityX(){let t=this.inputs.attached.pointers;return t?t.angularSensibilityX:0}set angularSensibilityX(t){let e=this.inputs.attached.pointers;e&&(e.angularSensibilityX=t)}get angularSensibilityY(){let t=this.inputs.attached.pointers;return t?t.angularSensibilityY:0}set angularSensibilityY(t){let e=this.inputs.attached.pointers;e&&(e.angularSensibilityY=t)}get pinchPrecision(){let t=this.inputs.attached.pointers;return t?t.pinchPrecision:0}set pinchPrecision(t){let e=this.inputs.attached.pointers;e&&(e.pinchPrecision=t)}get pinchDeltaPercentage(){let t=this.inputs.attached.pointers;return t?t.pinchDeltaPercentage:0}set pinchDeltaPercentage(t){let e=this.inputs.attached.pointers;e&&(e.pinchDeltaPercentage=t)}get useNaturalPinchZoom(){let t=this.inputs.attached.pointers;return!!t&&t.useNaturalPinchZoom}set useNaturalPinchZoom(t){let e=this.inputs.attached.pointers;e&&(e.useNaturalPinchZoom=t)}get panningSensibility(){let t=this.inputs.attached.pointers;return t?t.panningSensibility:0}set panningSensibility(t){let e=this.inputs.attached.pointers;e&&(e.panningSensibility=t)}get keysUp(){let t=this.inputs.attached.keyboard;return t?t.keysUp:[]}set keysUp(t){let e=this.inputs.attached.keyboard;e&&(e.keysUp=t)}get keysDown(){let t=this.inputs.attached.keyboard;return t?t.keysDown:[]}set keysDown(t){let e=this.inputs.attached.keyboard;e&&(e.keysDown=t)}get keysLeft(){let t=this.inputs.attached.keyboard;return t?t.keysLeft:[]}set keysLeft(t){let e=this.inputs.attached.keyboard;e&&(e.keysLeft=t)}get keysRight(){let t=this.inputs.attached.keyboard;return t?t.keysRight:[]}set keysRight(t){let e=this.inputs.attached.keyboard;e&&(e.keysRight=t)}get wheelPrecision(){let t=this.inputs.attached.mousewheel;return t?t.wheelPrecision:0}set wheelPrecision(t){let e=this.inputs.attached.mousewheel;e&&(e.wheelPrecision=t)}get zoomToMouseLocation(){let t=this.inputs.attached.mousewheel;return!!t&&t.zoomToMouseLocation}set zoomToMouseLocation(t){let e=this.inputs.attached.mousewheel;e&&(e.zoomToMouseLocation=t)}get wheelDeltaPercentage(){let t=this.inputs.attached.mousewheel;return t?t.wheelDeltaPercentage:0}set wheelDeltaPercentage(t){let e=this.inputs.attached.mousewheel;e&&(e.wheelDeltaPercentage=t)}get _useCtrlForPanning(){return this._useCtrlForPanningInternal}set _useCtrlForPanning(t){this._useCtrlForPanningInternal=t;let e=this.movement.input,i=e.getEntry("keyboard","pan",{modifiers:{ctrl:!0}});!t&&i?e.inputMap.splice(e.inputMap.indexOf(i),1):t&&!i&&e.addEntry({source:"keyboard",modifiers:{ctrl:!0},interaction:"pan"});let a=e.getEntry("pointer","pan",{modifiers:{ctrl:!0}});!t&&a?e.inputMap.splice(e.inputMap.indexOf(a),1):t&&!a&&e.addEntry({source:"pointer",button:0,modifiers:{ctrl:!0},interaction:"pan"})}get _panningMouseButton(){return this._panningMouseButtonInternal}set _panningMouseButton(t){this._panningMouseButtonInternal=t;let e=this.movement.input.getEntry("pointer","pan",{modifiers:{}});e&&(e.button=t)}get isInterpolating(){return this._isInterpolating}get bouncingBehavior(){return this._bouncingBehavior}get useBouncingBehavior(){return null!=this._bouncingBehavior}set useBouncingBehavior(t){t!==this.useBouncingBehavior&&(t?(this._bouncingBehavior=new C,this.addBehavior(this._bouncingBehavior)):this._bouncingBehavior&&(this.removeBehavior(this._bouncingBehavior),this._bouncingBehavior=null))}get framingBehavior(){return this._framingBehavior}get useFramingBehavior(){return null!=this._framingBehavior}set useFramingBehavior(t){t!==this.useFramingBehavior&&(t?(this._framingBehavior=new R,this.addBehavior(this._framingBehavior)):this._framingBehavior&&(this.removeBehavior(this._framingBehavior),this._framingBehavior=null))}get autoRotationBehavior(){return this._autoRotationBehavior}get useAutoRotationBehavior(){return null!=this._autoRotationBehavior}set useAutoRotationBehavior(t){t!==this.useAutoRotationBehavior&&(t?(this._autoRotationBehavior=new p,this.addBehavior(this._autoRotationBehavior)):this._autoRotationBehavior&&(this.removeBehavior(this._autoRotationBehavior),this._autoRotationBehavior=null))}constructor(t,e,i,a,s,r,h=!0){super(t,o.Vector3.Zero(),r,h),this._inertialAlphaOffset=0,this._inertialBetaOffset=0,this._inertialRadiusOffset=0,this.lowerAlphaLimit=null,this.upperAlphaLimit=null,this.lowerBetaLimit=.01,this.upperBetaLimit=Math.PI-.01,this.lowerRadiusLimit=null,this.upperRadiusLimit=null,this.lowerTargetYLimit=-1/0,this.inertialPanningX=0,this.inertialPanningY=0,this.pinchToPanMaxDistance=20,this.panningDistanceLimit=null,this.panningOriginTarget=o.Vector3.Zero(),this._panningInertia=.9,this._inertia=.9,this.zoomOnFactor=1,this.targetScreenOffset=o.Vector2.Zero(),this.allowUpsideDown=!0,this.useInputToRestoreState=!0,this.restoreStateInterpolationFactor=0,this._currentInterpolationFactor=0,this._viewMatrix=new o.Matrix,this._useCtrlForPanningInternal=!0,this._panningMouseButtonInternal=2,this.panningAxis=new o.Vector3(1,1,0),this._transformedDirection=new o.Vector3,this.mapPanning=!1,this._isInterpolating=!1,this.onMeshTargetChangedObservable=new n.Observable,this.checkCollisions=!1,this.collisionRadius=new o.Vector3(.5,.5,.5),this._previousPosition=o.Vector3.Zero(),this._collisionVelocity=o.Vector3.Zero(),this._newPosition=o.Vector3.Zero(),this._computationVector=o.Vector3.Zero(),this._goalAlpha=NaN,this._goalBeta=NaN,this._goalRadius=NaN,this._goalTarget=new o.Vector3(NaN,NaN,NaN),this._goalTargetScreenOffset=new o.Vector2(NaN,NaN),this._onCollisionPositionChange=(t,e,i=null)=>{i?(this.setPosition(e),this.onCollide&&this.onCollide(i)):this._previousPosition.copyFrom(this._position);let a=Math.cos(this.alpha),s=Math.sin(this.alpha),n=Math.cos(this.beta),o=Math.sin(this.beta);0===o&&(o=1e-4);let r=this._getTargetPosition();this._computationVector.copyFromFloats(this.radius*a*o,this.radius*n,this.radius*s*o),r.addToRef(this._computationVector,this._newPosition),this._position.copyFrom(this._newPosition);let h=this.upVector;this.allowUpsideDown&&this.beta<0&&(h=(h=h.clone()).negate()),this._computeViewMatrix(this._position,r,h),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y),this._collisionTriggered=!1},this._target=o.Vector3.Zero(),s&&this.setTarget(s),this.alpha=e,this.beta=i,this.radius=a,this.getViewMatrix(),this.inputs=new U(this),this.inputs.addKeyboard().addMouseWheel().addPointers(),this.movement=new X(this.getScene(),this._position),this.movement.rotationInertia=this._inertia,this.movement.zoomInertia=this._inertia,this.movement.panInertia=this._panningInertia}_initCache(){super._initCache(),this._cache._target=new o.Vector3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this._cache.alpha=void 0,this._cache.beta=void 0,this._cache.radius=void 0,this._cache.targetScreenOffset=o.Vector2.Zero()}_updateCache(t){t||super._updateCache(),this._cache._target.copyFrom(this._getTargetPosition()),this._cache.alpha=this.alpha,this._cache.beta=this.beta,this._cache.radius=this.radius,this._cache.targetScreenOffset.copyFrom(this.targetScreenOffset)}_getTargetPosition(){if(this._targetHost&&this._targetHost.getAbsolutePosition){let t=this._targetHost.getAbsolutePosition();this._targetBoundingCenter?t.addToRef(this._targetBoundingCenter,this._target):this._target.copyFrom(t)}let t=this._getLockedTargetPosition();return t||this._target}storeState(){return this._storedAlpha=this.alpha,this._storedBeta=this.beta,this._storedRadius=this.radius,this._storedTarget=this._getTargetPosition().clone(),this._storedTargetScreenOffset=this.targetScreenOffset.clone(),super.storeState()}_restoreStateValues(){return this.hasStateStored()&&this.restoreStateInterpolationFactor>_.Epsilon&&this.restoreStateInterpolationFactor<1?(this.interpolateTo(this._storedAlpha,this._storedBeta,this._storedRadius,this._storedTarget,this._storedTargetScreenOffset,this.restoreStateInterpolationFactor),!0):!!super._restoreStateValues()&&(this.setTarget(this._storedTarget.clone()),this.alpha=this._storedAlpha,this.beta=this._storedBeta,this.radius=this._storedRadius,this.targetScreenOffset=this._storedTargetScreenOffset.clone(),this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,!0)}stopInterpolation(){this._goalAlpha=NaN,this._goalBeta=NaN,this._goalRadius=NaN,this._goalTarget.set(NaN,NaN,NaN),this._goalTargetScreenOffset.set(NaN,NaN)}interpolateTo(t=this.alpha,e=this.beta,i=this.radius,a=this.target,s=this.targetScreenOffset,n){this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0,null!=n?this._currentInterpolationFactor=n:0!==this.restoreStateInterpolationFactor?this._currentInterpolationFactor=this.restoreStateInterpolationFactor:this._currentInterpolationFactor=.1,this._goalAlpha=q(t,this._goalAlpha),this._goalBeta=q(e,this._goalBeta),this._goalRadius=q(i,this._goalRadius),this._goalTarget.set(q(a.x,this._goalTarget.x),q(a.y,this._goalTarget.y),q(a.z,this._goalTarget.z)),this._goalTargetScreenOffset.set(q(s.x,this._goalTargetScreenOffset.x),q(s.y,this._goalTargetScreenOffset.y)),this._goalAlpha=(0,r.Clamp)(this._goalAlpha,this.lowerAlphaLimit??-1/0,this.upperAlphaLimit??1/0),this._goalBeta=(0,r.Clamp)(this._goalBeta,this.lowerBetaLimit??-1/0,this.upperBetaLimit??1/0),this._goalRadius=(0,r.Clamp)(this._goalRadius,this.lowerRadiusLimit??-1/0,this.upperRadiusLimit??1/0),this._goalTarget.y=(0,r.Clamp)(this._goalTarget.y,this.lowerTargetYLimit??-1/0,1/0),this._isInterpolating=!0}_isSynchronizedViewMatrix(){return!!super._isSynchronizedViewMatrix()&&this._cache._target.equals(this._getTargetPosition())&&this._cache.alpha===this.alpha&&this._cache.beta===this.beta&&this._cache.radius===this.radius&&this._cache.targetScreenOffset.equals(this.targetScreenOffset)}attachControl(t,e,i=!0,a=2){let s=arguments;e=S.Tools.BackCompatCameraNoPreventDefault(s),this._useCtrlForPanning=i,this._panningMouseButton=a,"boolean"==typeof s[0]&&(s.length>1&&(this._useCtrlForPanning=s[1]),s.length>2&&(this._panningMouseButton=s[2])),this.inputs.attachElement(e),this._reset=()=>{this.inertialAlphaOffset=0,this.inertialBetaOffset=0,this.inertialRadiusOffset=0,this.inertialPanningX=0,this.inertialPanningY=0}}detachControl(){this.inputs.detachElement(),this._reset&&this._reset()}_applyRotationAndZoomDelta(t,e,i){let a=this.invertRotation?-1:1,s=t*this._calculateHandednessMultiplier();this.beta<0&&(s*=-1),this.alpha+=s*a,this.beta+=e*a,this.radius-=i}_applyPanDelta(t,e){let i=o.TmpVectors.Vector3[0].copyFromFloats(t,e,e);if(this._viewMatrix.invertToRef(this._cameraTransformMatrix),i.multiplyInPlace(this.panningAxis),o.Vector3.TransformNormalToRef(i,this._cameraTransformMatrix,this._transformedDirection),this.mapPanning){let t=this.upVector,e=o.Vector3.CrossToRef(this._transformedDirection,t,this._transformedDirection);o.Vector3.CrossToRef(t,e,this._transformedDirection)}else this.panningAxis.y||(this._transformedDirection.y=0);if(!this._targetHost)if(this.panningDistanceLimit)this._transformedDirection.addInPlace(this._target),o.Vector3.DistanceSquared(this._transformedDirection,this.panningOriginTarget)<=this.panningDistanceLimit*this.panningDistanceLimit&&this._target.copyFrom(this._transformedDirection);else{if(this.parent){let t=o.TmpVectors.Matrix[0];this.parent.getWorldMatrix().getRotationMatrixToRef(t),t.transposeToRef(t),o.Vector3.TransformCoordinatesToRef(this._transformedDirection,t,this._transformedDirection)}this._target.addInPlace(this._transformedDirection)}}_checkInputs(){if(this._collisionTriggered)return;this.inputs.checkInputs();let t=!1;this.movement.computeCurrentFrameDeltas();let e=this.movement.rotationDeltaCurrentFrame,i=this.movement.zoomDeltaCurrentFrame,a=this.movement.panDeltaCurrentFrame;if((0!==e.x||0!==e.y||0!==i||0!==a.x||0!==a.y)&&(t=!0,(0!==e.x||0!==e.y||0!==i)&&this._applyRotationAndZoomDelta(e.x,e.y,i),(0!==a.x||0!==a.y)&&this._applyPanDelta(a.x,a.y)),(0!==this._inertialAlphaOffset||0!==this._inertialBetaOffset||0!==this._inertialRadiusOffset)&&(this._applyRotationAndZoomDelta(this._inertialAlphaOffset,this._inertialBetaOffset,this._inertialRadiusOffset),this._inertialAlphaOffset*=this.inertia,this._inertialBetaOffset*=this.inertia,this._inertialRadiusOffset*=this.inertia,Math.abs(this._inertialAlphaOffset)<this._rotationEpsilon&&(this._inertialAlphaOffset=0),Math.abs(this._inertialBetaOffset)<this._rotationEpsilon&&(this._inertialBetaOffset=0),Math.abs(this._inertialRadiusOffset)<this.speed*this._rotationEpsilon&&(this._inertialRadiusOffset=0),t=!0),0!==this.inertialPanningX||0!==this.inertialPanningY){this._applyPanDelta(this.inertialPanningX,this.inertialPanningY),this.inertialPanningX*=this.panningInertia,this.inertialPanningY*=this.panningInertia;let e=this.speed*this._panningEpsilon;Math.abs(this.inertialPanningX)<e&&(this.inertialPanningX=0),Math.abs(this.inertialPanningY)<e&&(this.inertialPanningY=0),t=!0}if(t)this.stopInterpolation();else if(this._isInterpolating){let t=!1,e=1-Math.pow(2,-(this._scene.getEngine().getDeltaTime()/1e3)/this._currentInterpolationFactor),i=q(this._goalRadius,this.radius);if(!isNaN(this._goalTarget.x)||!isNaN(this._goalTarget.y)||!isNaN(this._goalTarget.z)){let a=o.TmpVectors.Vector3[0].set(q(this._goalTarget.x,this._target.x),q(this._goalTarget.y,this._target.y),q(this._goalTarget.z,this._target.z));o.Vector3.LerpToRef(this.target,a,e,this._target),10*o.Vector3.Distance(this.target,a)/i<_.Epsilon?(this._goalTarget.set(NaN,NaN,NaN),this.target.copyFrom(a),this.setTarget(this.target,!1,!0,!0)):t=!0}if(!isNaN(this._goalAlpha)||!isNaN(this._goalBeta)){let i=o.Quaternion.RotationAlphaBetaGammaToRef(q(this._goalAlpha,this.alpha),q(this._goalBeta,this.beta),0,o.TmpVectors.Quaternion[0]),a=o.Quaternion.RotationAlphaBetaGammaToRef(this.alpha,this.beta,0,o.TmpVectors.Quaternion[1]),s=o.Quaternion.SlerpToRef(a,i,e,o.TmpVectors.Quaternion[2]);s.normalize();let n=s.toAlphaBetaGammaToRef(o.TmpVectors.Vector3[0]);if(this.alpha=n.x,this.beta=n.y,s.isApprox(i,_.Epsilon/5)){this._goalAlpha=NaN,this._goalBeta=NaN;let t=i.toAlphaBetaGammaToRef(o.TmpVectors.Vector3[0]);this.alpha=t.x,this.beta=t.y}else t=!0}if(isNaN(this._goalRadius)||(this.radius+=(i-this.radius)*e,Math.abs(i/this.radius-1)<_.Epsilon?(this._goalRadius=NaN,this.radius=i):t=!0),!isNaN(this._goalTargetScreenOffset.x)||!isNaN(this._goalTargetScreenOffset.y)){let i=o.TmpVectors.Vector2[0].set(q(this._goalTargetScreenOffset.x,this.targetScreenOffset.x),q(this._goalTargetScreenOffset.y,this.targetScreenOffset.y));o.Vector2.LerpToRef(this.targetScreenOffset,i,e,this.targetScreenOffset),o.Vector2.Distance(this.targetScreenOffset,i)<_.Epsilon?(this._goalTargetScreenOffset.set(NaN,NaN),this.targetScreenOffset.copyFrom(i)):t=!0}this._isInterpolating=t}this._checkLimits(),super._checkInputs()}_checkLimits(){null===this.lowerBetaLimit||void 0===this.lowerBetaLimit?this.allowUpsideDown&&this.beta>Math.PI&&(this.beta=this.beta-2*Math.PI):this.beta<this.lowerBetaLimit&&(this.beta=this.lowerBetaLimit),null===this.upperBetaLimit||void 0===this.upperBetaLimit?this.allowUpsideDown&&this.beta<-Math.PI&&(this.beta=this.beta+2*Math.PI):this.beta>this.upperBetaLimit&&(this.beta=this.upperBetaLimit),null!==this.lowerAlphaLimit&&this.alpha<this.lowerAlphaLimit&&(this.alpha=this.lowerAlphaLimit),null!==this.upperAlphaLimit&&this.alpha>this.upperAlphaLimit&&(this.alpha=this.upperAlphaLimit),null!==this.lowerRadiusLimit&&this.radius<this.lowerRadiusLimit&&(this.radius=this.lowerRadiusLimit,this.inertialRadiusOffset=0),null!==this.upperRadiusLimit&&this.radius>this.upperRadiusLimit&&(this.radius=this.upperRadiusLimit,this.inertialRadiusOffset=0),this.target.y=Math.max(this.target.y,this.lowerTargetYLimit)}rebuildAnglesAndRadius(){this._position.subtractToRef(this._getTargetPosition(),this._computationVector),(0!==this._upVector.x||1!==this._upVector.y||0!==this._upVector.z)&&o.Vector3.TransformCoordinatesToRef(this._computationVector,this._upToYMatrix,this._computationVector),this.radius=this._computationVector.length(),0===this.radius&&(this.radius=1e-4);let t=this.alpha;this.alpha=H(this._computationVector),this.beta=G(this._computationVector.y,this.radius);let e=Math.round((t-this.alpha)/(2*Math.PI));this.alpha+=2*e*Math.PI,this._checkLimits()}setPosition(t){this._position.equals(t)||(this._position.copyFrom(t),this.rebuildAnglesAndRadius())}setTarget(t,e=!1,i=!1,a=!1){if(a=this.overrideCloneAlphaBetaRadius??a,t.computeWorldMatrix)e&&t.getBoundingInfo?this._targetBoundingCenter=t.getBoundingInfo().boundingBox.centerWorld.clone():this._targetBoundingCenter=null,t.computeWorldMatrix(),this._targetHost=t,this._target=this._getTargetPosition(),this.onMeshTargetChangedObservable.notifyObservers(this._targetHost);else{let e=this._getTargetPosition();if(e&&!i&&e.equals(t))return;this._targetHost=null,this._target=t,this._targetBoundingCenter=null,this.onMeshTargetChangedObservable.notifyObservers(null)}a||this.rebuildAnglesAndRadius()}_getViewMatrix(){let t=Math.cos(this.alpha),e=Math.sin(this.alpha),i=Math.cos(this.beta),a=Math.sin(this.beta);0===a&&(a=1e-4),0===this.radius&&(this.radius=1e-4);let s=this._getTargetPosition();if(this._computationVector.copyFromFloats(this.radius*t*a,this.radius*i,this.radius*e*a),(0!==this._upVector.x||1!==this._upVector.y||0!==this._upVector.z)&&o.Vector3.TransformCoordinatesToRef(this._computationVector,this._yToUpMatrix,this._computationVector),s.addToRef(this._computationVector,this._newPosition),this.getScene().collisionsEnabled&&this.checkCollisions){let t=this.getScene().collisionCoordinator;this._collider||(this._collider=t.createCollider()),this._collider._radius=this.collisionRadius,this._newPosition.subtractToRef(this._position,this._collisionVelocity),this._collisionTriggered=!0,t.getNewPosition(this._position,this._collisionVelocity,this._collider,3,null,this._onCollisionPositionChange,this.uniqueId)}else{this._position.copyFrom(this._newPosition);let t=this.upVector;this.allowUpsideDown&&a<0&&(t=t.negate()),this._computeViewMatrix(this._position,s,t),this._viewMatrix.addAtIndex(12,this.targetScreenOffset.x),this._viewMatrix.addAtIndex(13,this.targetScreenOffset.y)}return this._currentTarget.copyFrom(s),this._viewMatrix}zoomOn(t,e=!1){t=t||this.getScene().meshes;let i=l.Mesh.MinMax(t),a=this._calculateLowerRadiusFromModelBoundingSphere(i.min,i.max);if(a=Math.max(Math.min(a,this.upperRadiusLimit||Number.MAX_VALUE),this.lowerRadiusLimit||0),this.radius=a*this.zoomOnFactor,this.mode===E.Camera.ORTHOGRAPHIC_CAMERA){let t=this.getScene().getEngine().getAspectRatio(this),e=a*this.zoomOnFactor/2;this.orthoLeft=-e*t,this.orthoRight=e*t,this.orthoBottom=-e,this.orthoTop=e}this.focusOn({min:i.min,max:i.max,distance:a},e)}focusOn(t,e=!1){let i,a;if(void 0===t.min){let e=t||this.getScene().meshes;i=l.Mesh.MinMax(e),a=o.Vector3.Distance(i.min,i.max)}else i=t,a=t.distance;this._target=l.Mesh.Center(i),e||(this.maxZ=2*a)}createRigCamera(t,e){let i=0;switch(this.cameraRigMode){case E.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case E.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case E.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:case E.Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:case E.Camera.RIG_MODE_VR:i=this._cameraRigParams.stereoHalfAngle*(0===e?1:-1);break;case E.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:i=this._cameraRigParams.stereoHalfAngle*(0===e?-1:1)}let a=new Q(t,this.alpha+i,this.beta,this.radius,this._target,this.getScene());return a._cameraRigParams={},a.isRigCamera=!0,a.rigParent=this,a.upVector=this.upVector,a.mode=this.mode,a.orthoLeft=this.orthoLeft,a.orthoRight=this.orthoRight,a.orthoBottom=this.orthoBottom,a.orthoTop=this.orthoTop,a}_updateRigCameras(){let t=this._rigCameras[0],e=this._rigCameras[1];switch(t.beta=e.beta=this.beta,this.cameraRigMode){case E.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:case E.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:case E.Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:case E.Camera.RIG_MODE_STEREOSCOPIC_INTERLACED:case E.Camera.RIG_MODE_VR:t.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle,e.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle;break;case E.Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:t.alpha=this.alpha+this._cameraRigParams.stereoHalfAngle,e.alpha=this.alpha-this._cameraRigParams.stereoHalfAngle}super._updateRigCameras()}_calculateLowerRadiusFromModelBoundingSphere(t,e,i=1){let a=o.Vector3.Distance(t,e),s=this.getScene().getEngine().getAspectRatio(this),n=Math.tan(this.fov/2),r=n*s,h=.5*a*i;return Math.max(h*Math.sqrt(1+1/(r*r)),h*Math.sqrt(1+1/(n*n)))}dispose(){this.inputs.clear(),super.dispose()}getClassName(){return"ArcRotateCamera"}}(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"alpha",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"beta",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"radius",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"overrideCloneAlphaBetaRadius",void 0),(0,a.__decorate)([(0,s.serializeAsVector3)("target")],Q.prototype,"_target",void 0),(0,a.__decorate)([(0,s.serializeAsMeshReference)("targetHost")],Q.prototype,"_targetHost",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"inertialAlphaOffset",null),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"inertialBetaOffset",null),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"inertialRadiusOffset",null),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"lowerAlphaLimit",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"upperAlphaLimit",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"lowerBetaLimit",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"upperBetaLimit",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"lowerRadiusLimit",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"upperRadiusLimit",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"lowerTargetYLimit",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"inertialPanningX",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"inertialPanningY",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"pinchToPanMaxDistance",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"panningDistanceLimit",void 0),(0,a.__decorate)([(0,s.serializeAsVector3)()],Q.prototype,"panningOriginTarget",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"panningInertia",null),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"zoomToMouseLocation",null),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"zoomOnFactor",void 0),(0,a.__decorate)([(0,s.serializeAsVector2)()],Q.prototype,"targetScreenOffset",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"allowUpsideDown",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"useInputToRestoreState",void 0),(0,a.__decorate)([(0,s.serialize)()],Q.prototype,"restoreStateInterpolationFactor",void 0);let j=!1;function J(){j||(j=!0,h.Node.AddNodeConstructor("ArcRotateCamera",(t,e)=>()=>new Q(t,0,0,1,o.Vector3.Zero(),e)),(0,Z.RegisterClass)("BABYLON.ArcRotateCamera",Q))}t.s(["ArcRotateCamera",0,Q,"ComputeAlpha",0,H,"ComputeBeta",0,G,"RegisterArcRotateCamera",0,J],35238),J(),t.s([],34273),t.i(34273),t.i(35238),t.s(["ArcRotateCamera",0,Q,"ComputeAlpha",0,H,"ComputeBeta",0,G,"RegisterArcRotateCamera",0,J],18662)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40422,i=>{"use strict";i.s([],68083),i.i(68083);var n=i.i(71379);i.s(["ThinEngine",()=>n.ThinEngine],40422)}]);
@@ -0,0 +1,9 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2689,e=>{"use strict";var t=e.i(12423);let r="postprocessVertexShader",s=`attribute position: vec2<f32>;uniform scale: vec2<f32>;varying vUV: vec2<f32>;const madd=vec2(0.5,0.5);
2
+ #define CUSTOM_VERTEX_DEFINITIONS
3
+ @vertex
4
+ fn main(input : VertexInputs)->FragmentInputs {
5
+ #define CUSTOM_VERTEX_MAIN_BEGIN
6
+ vertexOutputs.vUV=(vertexInputs.position*madd+madd)*uniforms.scale;vertexOutputs.position=vec4(vertexInputs.position,0.0,1.0);
7
+ #define CUSTOM_VERTEX_MAIN_END
8
+ }
9
+ `;t.ShaderStore.ShadersStoreWGSL[r]||(t.ShaderStore.ShadersStoreWGSL[r]=s),e.s(["postprocessVertexShaderWGSL",0,{name:r,shader:s}])}]);
@@ -0,0 +1,23 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88647,e=>{"use strict";var r=e.i(12423);let t="passCubePixelShader",u=`varying vec2 vUV;uniform samplerCube textureSampler;
2
+ #define CUSTOM_FRAGMENT_DEFINITIONS
3
+ void main(void)
4
+ {vec2 uv=vUV*2.0-1.0;
5
+ #ifdef POSITIVEX
6
+ gl_FragColor=textureCube(textureSampler,vec3(1.001,uv.y,uv.x));
7
+ #endif
8
+ #ifdef NEGATIVEX
9
+ gl_FragColor=textureCube(textureSampler,vec3(-1.001,uv.y,uv.x));
10
+ #endif
11
+ #ifdef POSITIVEY
12
+ gl_FragColor=textureCube(textureSampler,vec3(uv.y,1.001,uv.x));
13
+ #endif
14
+ #ifdef NEGATIVEY
15
+ gl_FragColor=textureCube(textureSampler,vec3(uv.y,-1.001,uv.x));
16
+ #endif
17
+ #ifdef POSITIVEZ
18
+ gl_FragColor=textureCube(textureSampler,vec3(uv,1.001));
19
+ #endif
20
+ #ifdef NEGATIVEZ
21
+ gl_FragColor=textureCube(textureSampler,vec3(uv,-1.001));
22
+ #endif
23
+ }`;r.ShaderStore.ShadersStore[t]||(r.ShaderStore.ShadersStore[t]=u),e.s(["passCubePixelShader",0,{name:t,shader:u}])}]);
@@ -0,0 +1,3 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,74441,e=>{"use strict";var r=e.i(12423);let o="lodPixelShader",t=`precision highp float;const float GammaEncodePowerApprox=1.0/2.2;varying vec2 vUV;uniform sampler2D textureSampler;uniform float lod;uniform vec2 texSize;uniform int gamma;void main(void)
2
+ {ivec2 textureDimensions=textureSize(textureSampler,0);gl_FragColor=texelFetch(textureSampler,ivec2(vUV*vec2(textureDimensions)),int(lod));if (gamma==0) {gl_FragColor.rgb=pow(gl_FragColor.rgb,vec3(GammaEncodePowerApprox));}}
3
+ `;r.ShaderStore.ShadersStore[o]||(r.ShaderStore.ShadersStore[o]=t),e.s(["lodPixelShader",0,{name:o,shader:t}])}]);